Skip to content

Instantly share code, notes, and snippets.

@semifor
Created August 12, 2009 22:13
Show Gist options
  • Save semifor/166817 to your computer and use it in GitHub Desktop.
Save semifor/166817 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
# Accessing the HTTP::Response object on successful Net::Twitter API calls
use warnings;
use strict;
use Net::Twitter;
my $nt = Net::Twitter->new(netrc => 1, legacy => 0);
my $response;
$nt->ua->add_handler(response_done => sub { $response = shift });
my $r = $nt->user_timeline({ count => 1 });
warn $response->headers->as_string, "\n";
exit 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment