[twitter-dev] Re: How to list followers, including icons and usernames?

2009-06-29 Thread Aaron Rankin

It looks like status/followers gets you part of the way there. First,
some questions for Twitter:

1) Does status/followers return statuses for distinct users? E.g., if
one of my followers has changed their status twice in the past minute,
will this method return the latest or both?
2) For every follower, will this definitely return the last status for
each, even if they've been idle for some time?

Since this returns statuses in batches of 100, to get all data for all
followers, you'll still to run a query for every 100 (including the
remainder at the end). At least in the JSON, status/followers doesn't
tell you how many followers there are. To know the number of queries
(pages of 100) to fetch, you also need to query followers/ids. It's
clearly better than 1 query per follower + 1 call to follower/ids for
the main user in question.

Is this the best way to get information for each follower of a given
user?


Thanks,
Aaron

On Jun 28, 12:41 pm, Abraham Williams 4bra...@gmail.com wrote:
 Check out this 
 method:http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0f...



 On Sun, Jun 28, 2009 at 12:26, Bemmubemmu@gmail.com wrote:

  I'm wanting to do a friend selector that looks something like the
  selector on Facebook, where the user sees a list of their followers'
  names and icons, and can select some of them. Right now the only way I
  can think of is first getting all IDs of followers from /followers/
  ids, and then calling /users/show.json?user_id= for each. Seems
  expensive and slow.

  What's the right way to do this? I see some apps have follower
  selectors, but I don't know if they screen scrape http://twitter.com/
  followers/1401881, or do as I just described and simply not work for
  people with too many followers.

  My dream API method would allow sorting by name or follower count,
  something like this:

  Query: /followers/list.json?sort=follower_countpage=1per_page=1000
  Response:
  [
   { 'id' : 12345, 'icon' : 'http://...somethingjpg', 'username' :
  'a' },
   { 'id' : 67890, 'icon' : 'http://...somethingjpg', 'username' :
  'b' },
   ...
  ]

  Since many users will probably have thousands of followers, I thought
  I could ease the

 --
 Abraham Williams | Community Evangelist |http://web608.org
 Hacker |http://abrah.am|http://twitter.com/abraham
 Project |http://fireeagle.labs.poseurtech.com
 This email is: [ ] blogable [x] ask first [ ] private.


[twitter-dev] Re: How to list followers, including icons and usernames?

2009-06-29 Thread Doug Williams
Aaron,
The best way to get all of the information including latest status from each
follower is to use the statuses/followers method. It will return the latest
status for each follower (no matter how long they have been idle) in line
with their profile information.

Thanks,
Doug


--
Do you follow me? http://twitter.com/dougw



On Mon, Jun 29, 2009 at 5:02 AM, Aaron Rankin aran...@gmail.com wrote:


 It looks like status/followers gets you part of the way there. First,
 some questions for Twitter:

 1) Does status/followers return statuses for distinct users? E.g., if
 one of my followers has changed their status twice in the past minute,
 will this method return the latest or both?
 2) For every follower, will this definitely return the last status for
 each, even if they've been idle for some time?

 Since this returns statuses in batches of 100, to get all data for all
 followers, you'll still to run a query for every 100 (including the
 remainder at the end). At least in the JSON, status/followers doesn't
 tell you how many followers there are. To know the number of queries
 (pages of 100) to fetch, you also need to query followers/ids. It's
 clearly better than 1 query per follower + 1 call to follower/ids for
 the main user in question.

 Is this the best way to get information for each follower of a given
 user?


 Thanks,
 Aaron

 On Jun 28, 12:41 pm, Abraham Williams 4bra...@gmail.com wrote:
  Check out this method:
 http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0f...
 
 
 
  On Sun, Jun 28, 2009 at 12:26, Bemmubemmu@gmail.com wrote:
 
   I'm wanting to do a friend selector that looks something like the
   selector on Facebook, where the user sees a list of their followers'
   names and icons, and can select some of them. Right now the only way I
   can think of is first getting all IDs of followers from /followers/
   ids, and then calling /users/show.json?user_id= for each. Seems
   expensive and slow.
 
   What's the right way to do this? I see some apps have follower
   selectors, but I don't know if they screen scrape http://twitter.com/
   followers/1401881, or do as I just described and simply not work for
   people with too many followers.
 
   My dream API method would allow sorting by name or follower count,
   something like this:
 
   Query: /followers/list.json?sort=follower_countpage=1per_page=1000
   Response:
   [
{ 'id' : 12345, 'icon' : 'http://...somethingjpg', 'username' :
   'a' },
{ 'id' : 67890, 'icon' : 'http://...somethingjpg', 'username' :
   'b' },
...
   ]
 
   Since many users will probably have thousands of followers, I thought
   I could ease the
 
  --
  Abraham Williams | Community Evangelist |http://web608.org
  Hacker |http://abrah.am|http://twitter.com/abraham
  Project |http://fireeagle.labs.poseurtech.com
  This email is: [ ] blogable [x] ask first [ ] private.



[twitter-dev] Re: How to list followers, including icons and usernames?

2009-06-29 Thread sull

yes it's a tough one all i wanted was to populate a dropdown menu
with followers names for direct message form.
would prefer a more efficient way.
but i am doing a follower import/update.
it's expensive on first session but not so bad if the user comes back
and only has a small batch of new followers.
still prefer a direct call to get usernames and ids.

this:
http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-followers%C2%A0ids

should return both ids.  numerical id and screen_name id.
they are both referred to ids elsewhere so both can be included in
this method without naming confusion.

i assume, however, that the querying for the screen_name and numeric
id is resource intensive on twitters end which is why it is not
available.
twitter assumes/hopes that you will import and cache.


On Jun 29, 8:02 am, Aaron Rankin aran...@gmail.com wrote:
 It looks like status/followers gets you part of the way there. First,
 some questions for Twitter:

 1) Does status/followers return statuses for distinct users? E.g., if
 one of my followers has changed their status twice in the past minute,
 will this method return the latest or both?
 2) For every follower, will this definitely return the last status for
 each, even if they've been idle for some time?

 Since this returns statuses in batches of 100, to get all data for all
 followers, you'll still to run a query for every 100 (including the
 remainder at the end). At least in the JSON, status/followers doesn't
 tell you how many followers there are. To know the number of queries
 (pages of 100) to fetch, you also need to query followers/ids. It's
 clearly better than 1 query per follower + 1 call to follower/ids for
 the main user in question.

 Is this the best way to get information for each follower of a given
 user?

 Thanks,
 Aaron

 On Jun 28, 12:41 pm, Abraham Williams 4bra...@gmail.com wrote:

  Check out this 
  method:http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0f...

  On Sun, Jun 28, 2009 at 12:26, Bemmubemmu@gmail.com wrote:

   I'm wanting to do a friend selector that looks something like the
   selector on Facebook, where the user sees a list of their followers'
   names and icons, and can select some of them. Right now the only way I
   can think of is first getting all IDs of followers from /followers/
   ids, and then calling /users/show.json?user_id= for each. Seems
   expensive and slow.

   What's the right way to do this? I see some apps have follower
   selectors, but I don't know if they screen scrape http://twitter.com/
   followers/1401881, or do as I just described and simply not work for
   people with too many followers.

   My dream API method would allow sorting by name or follower count,
   something like this:

   Query: /followers/list.json?sort=follower_countpage=1per_page=1000
   Response:
   [
    { 'id' : 12345, 'icon' : 'http://...somethingjpg', 'username' :
   'a' },
    { 'id' : 67890, 'icon' : 'http://...somethingjpg', 'username' :
   'b' },
    ...
   ]

   Since many users will probably have thousands of followers, I thought
   I could ease the

  --
  Abraham Williams | Community Evangelist |http://web608.org
  Hacker |http://abrah.am|http://twitter.com/abraham
  Project |http://fireeagle.labs.poseurtech.com
  This email is: [ ] blogable [x] ask first [ ] private.


[twitter-dev] Re: How to list followers, including icons and usernames?

2009-06-28 Thread Abraham Williams

Check out this method:
http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0friends

On Sun, Jun 28, 2009 at 12:26, Bemmubemmu@gmail.com wrote:

 I'm wanting to do a friend selector that looks something like the
 selector on Facebook, where the user sees a list of their followers'
 names and icons, and can select some of them. Right now the only way I
 can think of is first getting all IDs of followers from /followers/
 ids, and then calling /users/show.json?user_id= for each. Seems
 expensive and slow.

 What's the right way to do this? I see some apps have follower
 selectors, but I don't know if they screen scrape http://twitter.com/
 followers/1401881, or do as I just described and simply not work for
 people with too many followers.

 My dream API method would allow sorting by name or follower count,
 something like this:

 Query: /followers/list.json?sort=follower_countpage=1per_page=1000
 Response:
 [
  { 'id' : 12345, 'icon' : 'http://...somethingjpg', 'username' :
 'a' },
  { 'id' : 67890, 'icon' : 'http://...somethingjpg', 'username' :
 'b' },
  ...
 ]



 Since many users will probably have thousands of followers, I thought
 I could ease the




-- 
Abraham Williams | Community Evangelist | http://web608.org
Hacker | http://abrah.am | http://twitter.com/abraham
Project | http://fireeagle.labs.poseurtech.com
This email is: [ ] blogable [x] ask first [ ] private.