Jake,
There are two options. Since I don't know what you've looked into, I'll list them below.
You can use the social graph API [1] to gain a list of all other friend IDs in a single call. This method however does not return screen name of a user as explained in the linked discussion. This is, however a good method to easily get a complete list of a user's friends' IDs which could then be used with individual calls to the users/show method [2] to cache screen name values.
The second, and less API intensive method to retrieve a list of all screen names is to page and parse through a user's friends with paginated calls to the statuses/friends method [3].
There is some discussion of its merit in the bug description itself,
but you should star it if it would suit your needs.
-Chad
Lets move to architecture. I can see the following being highly effective:
[APPLICATION LOGIC] <-> [CACHING LAYER/DATABASE] <-> [TWITTER]
Where the application logic uses the social graph method to download the list of friends, then checks with the caching layer if a screen name has already been resolved. In the case that it has not been previously resolved, the caching layer accesses the data via a users/show call to Twitter.
The second, and less API intensive method to retrieve a list of all screen names is to page and parse through a user's friends with paginated calls to the statuses/friends method
Read the status ids into a holding table and run a routine that gently matches those ids to user /show api returns?
Regards,
David Neubauer
Doug
@dougw
--
Nick,
Are you using a caching layer? Initialization of the cache will of
course be slow since every user will need to be looked up with a
users/show call, but the cache should eventually pay off after the
most active users have been entered.
[1] - http://www.danga.com/memcached/
Doug Williams
@dougw
--
Nick,
Have you looked into memcached [1]? Attribute-value pair caching is
what it was designed to do. Perfect for the write-through cache that
is needed here. It will also handle the pesky details like resolution
expiry for you, too. If you would like help, ping me offline, I can
get you started.