Friend Of A Friend In Twitter / IO Language
Tuesday, July 29th, 2008In recent presentations at RubyFringe (video/post forthcoming) and at Ruby.mn I talked about a small script I’d written in the IO Language to do a breadth-first friend-of-a-friend search to find a path/chain between two people on Twitter.
Per a number of requests, I’m posting the source.
It’s fairly raw, getting the IO language set up requires some work, and Twitter is enforcing rate limiting on unauthenticated API requests so it’s not quick, but it works.
Few details:
(1) The script caches API XML in a “data/” directory for future use. The directory is created if not already present.
(2) You’ll have to compile IO’s SGML and Socket/URL add-ons and their pre-requisites. Both require libs that your system may not have; look at the compiler errors to pick them out.