Net-Twitter
view release on metacpan or search on metacpan
rate_limit_status by user (the default), or by IP address, with
->rate_limit_status({ authenticate => 0 }).
- Added FAQ section to pod
3.02000 2009-06-21
- Added OAuth 1.0a support
- Added init_args user/pass for compat with NT 2.12
3.01000_01 2009-06-12
- Updated OAuth support for desktop app PIN numbers (oauth_verifier)
3.01000 2009-06-07
- Added support for the saved_search API methods.
3.00004 2009-06-06
- Fixed: accept extra args as a hashref (search behaved this way in 2.12)
3.00003 2009-06-03
- Added a workaround for JSON backends that don't handle booleans properly
# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.010.
Changes
LICENSE
MANIFEST
META.yml
Makefile.PL
README
dist.ini
examples/oauth_desktop.pl
examples/oauth_webapp.pl
lib/Net/Identica.pm
lib/Net/Twitter.pm
lib/Net/Twitter.pod
lib/Net/Twitter/API.pm
lib/Net/Twitter/Core.pm
lib/Net/Twitter/Error.pm
lib/Net/Twitter/Manual/MigratingToV1_1.pod
lib/Net/Twitter/OAuth.pm
lib/Net/Twitter/Role/API/Lists.pm
examples/oauth_desktop.pl view on Meta::CPAN
#!/usr/bin/perl
#
# Net::Twitter - OAuth desktop app example
#
use warnings;
use strict;
use Net::Twitter;
use File::Spec;
use Storable;
use Data::Dumper;
# You can replace the consumer tokens with your own;
# these tokens are for the Net::Twitter example app.
my %consumer_tokens = (
consumer_key => 'v8t3JILkStylbgnxGLOQ',
consumer_secret => '5r31rSMc0NPtBpHcK8MvnCLg2oAyFLx5eGOMkXM',
);
# $datafile = oauth_desktop.dat
my (undef, undef, $datafile) = File::Spec->splitpath($0);
$datafile =~ s/\..*/.dat/;
my $nt = Net::Twitter->new(traits => [qw/API::RESTv1_1/], %consumer_tokens);
my $access_tokens = eval { retrieve($datafile) } || [];
if ( @$access_tokens ) {
$nt->access_token($access_tokens->[0]);
$nt->access_token_secret($access_tokens->[1]);
}
lib/Net/Twitter/Role/OAuth.pm view on Meta::CPAN
=head1 IMPORTANT
Beginning with version 3.02, it is necessary for web applications to pass the
C<callback> parameter to C<get_authorization_url>. In the absence of a
callback parameter, when the user authorizes the application a PIN number is
displayed rather than redirecting the user back to your site.
=head1 EXAMPLES
See the C<examples> directory in this distribution for working examples of both
desktop and web applications.
Here's how to authorize users as a desktop app mode:
use Net::Twitter;
my $nt = Net::Twitter->new(
traits => ['API::RESTv1_1', 'OAuth'],
consumer_key => "YOUR-CONSUMER-KEY",
consumer_secret => "YOUR-CONSUMER-SECRET",
);
# You'll save the token and secret in cookie, config file or session database
lib/Net/Twitter/Role/OAuth.pm view on Meta::CPAN
=item authorized
Whether the client has the necessary credentials to be authorized.
Note that the credentials may be wrong and so the request may fail.
=item request_access_token(verifier => $verifier)
Request the access token, access token secret, user id and screen name for
this user. You must pass the PIN# (for desktop applications) or the
C<oauth_verifier> value, provided as a parameter to the oauth callback
(for web applications) as C<$verifier>.
The user must have authorized this app at the url given by C<get_authorization_url> first.
Returns the access_token, access_token_secret, user_id, and screen_name in a
list. Also sets them internally so that after calling this method, you can
immediately call API methods requiring authentication.
=item xauth($username, $password)
lib/Net/Twitter/Role/OAuth.pm view on Meta::CPAN
Exchanges the C<$username> and C<$password> for access tokens. This method has
the same return value as C<request_access_token>: access_token, access_token_secret,
user_id, and screen_name in a list. Also, like C<request_access_token>, it sets
the access_token and access_secret, internally, so you can immediately call API
methods requiring authentication.
=item get_authorization_url(callback => $callback_url)
Get the URL used to authorize the user. Returns a C<URI> object. For web
applications, pass your applications callback URL as the C<callback> parameter.
No arguments are required for desktop applications (C<callback> defaults to
C<oob>, out-of-band).
=item get_authentication_url(callback => $callback_url)
Get the URL used to authenticate the user with "Sign in with Twitter"
authentication flow. Returns a C<URI> object. For web applications, pass your
applications callback URL as the C<callback> parameter. No arguments are
required for desktop applications (C<callback> defaults to C<oob>, out-of-band).
=item access_token
Get or set the access token.
=item access_token_secret
Get or set the access token secret.
=item request_token
( run in 0.295 second using v1.01-cache-2.11-cpan-299005ec8e3 )