Skip to content

Instantly share code, notes, and snippets.

@djacobs
Created April 22, 2010 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djacobs/375437 to your computer and use it in GitHub Desktop.
Save djacobs/375437 to your computer and use it in GitHub Desktop.
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