Created
April 22, 2010 16:19
-
-
Save djacobs/375437 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require WWW::Instapaper::Client; | |
my $paper = WWW::Instapaper::Client->new( | |
username => 'hellotypepad@mac.com', # E-mail OR username | |
password => '', | |
); | |
my $result = $paper->add( | |
url => 'http://hello.typepad.com/hello/2010/04/hbos-treme-creator-david-simon-explains-it-all-for-you.html', | |
title => "Treme Story", # optional, will try to get automatically if not given | |
); | |
if (defined $result) { | |
print "URL added: ", $result->[0], "\n"; # http://instapaper.com/go/###### | |
print "Title: ", $result->[1], "\n"; # Title of page added | |
} | |
else { | |
# Must be an error | |
warn "Was error: " . $paper->error . "\n"; | |
} | |
__END__ | |
selection => 'Some text on the page', #optional |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment