Skip to content

Instantly share code, notes, and snippets.

@gslin
Created April 14, 2011 12:57
Show Gist options
  • Save gslin/919418 to your computer and use it in GitHub Desktop.
Save gslin/919418 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
use OAuth::Lite::Consumer;
use OAuth::Lite::Token;
use encoding ':locale';
INIT {
my $oauth = OAuth::Lite::Consumer->new(
consumer_key => 'xxx',
consumer_secret => 'xxx',
site => 'http://emma.pixnet.cc',
request_token_path => '/oauth/request_token',
access_token_path => '/oauth/access_token',
authorize_path => '/oauth/authorize',
);
my $res = $oauth->request(
method => 'GET',
url => 'http://emma.pixnet.cc/blog/articles',
token => OAuth::Lite::Token->new(
token => 'xxx',
secret => 'xxx',
),
params => {
format => 'json',
user => 'repeattest3', # 部落格僅限好友
sudo => 'repeattest3',
},
);
say $res->decoded_content;
}
__END__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment