Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Net-Twitter CPAN distribution.

Report information
The Basics
Id: 43114
Status: resolved
Priority: 0/
Queue: Net-Twitter

People
Owner: cthom [...] cpan.org
Requestors: art-bitcard.org1 [...] pigdogs.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.06
Fixed in: (no value)



Subject: Feature request: Social Graph Methods
Hello! Thank you for Net-Twitter. It has already saved me a ton of work! Missing seems to be the two functions described as "Social Graph Methods" in the twitter rest api documentation: http://twitter.com/followers/ids.format http://twitter.com/friends/ids.format These return, in a single call, an array of -all- followers of a given id. These are different than using $t->followers($id) because they allow a single call to return all the followers. Using $t->followers is impossible to use in some cases, for example, attempting to list the 200,000 followers of "BarackObama". Thanks!
OK, I added this myself. I have no idea how to deal with this sort of thing so I'll just post the diffs here. I hope someone can add them to the module. The changes are pretty minimal and straightforward. *** /Users/art/.cpan/build/Net-Twitter-2.06-GvP7LS/lib/Net/Twitter.pm 2009-01-26 11:46:59.000000000 -0800 --- /Library/Perl/5.8.8/Net/Twitter.pm 2009-02-10 22:00:52.000000000 -0800 *************** *** 408,413 **** --- 408,429 ---- "user_b" => 1, }, }, + "ids_friends" => { + "blankargs" => 1, + "post" => 0, + "uri" => "/friends/ids/ID", + "args" => { + "id" => 0, + }, + }, + "ids_followers" => { + "blankargs" => 1, + "post" => 0, + "uri" => "/followers/ids/ID", + "args" => { + "id" => 0, + }, + }, "verify_credentials" => { "blankargs" => 1, "post" => 0, *************** *** 574,579 **** --- 590,597 ---- favorites followers user_timeline + ids_friends + ids_followers ); if ( ( !ref($args) ) && ( defined $args ) ) { *************** *** 1314,1319 **** --- 1332,1381 ---- =back + =head2 SOCIAL GRAPH METHODS + + =over + + =item C<ids_friends()> + + Returns an arrayref to an array of numeric IDs for every user the specified user is following. + Returns undef if an error occurs. + + Takes a hashref as an arg: + + =over + + =item C<id> + + OPTIONAL: User id or email address of a user other than the authenticated user, + in order to retrieve that user's friends. + + =back + + This method can take the "id" argument passed to it either as a single string, or in a hashref with a key + called "id". If passed as a string, no other args can be specified. + + =item C<ids_followers()> + + Returns an arrayref to an array of numeric IDs for every user the specified user is followed by. + Returns undef if an error occurs. + + If called without an argument returns the followers for the authenticating user, but can + pull followers for a specific ID. + + Accepts an optional hashref for arguments: + + =over + + =item C<id> + + OPTIONAL: The ID or screen name of the user for whom to request a list of followers. + + =back + + This method can take the "id" argument passed to it either as a single string, or in a hashref with a key + called "id". If passed as a string, no other args can be specified. + =head2 ACCOUNT METHODS =over
What will become 2.07 is on my local machine right now and includes these. This is exactly why 2.xx was written, to allow easier following of the moving target API. Unforunately my day job has got me scrambling and I haven't had time to finish off the release. I hope to do so in the next day or so. Thanks, -C