Any suggestions for a good twitter library (preferably in Ruby or Python)? I have a list of usernames, and I need to be able to programmatically follow these users.
I tried twitter4r in Ruby, but finding users doesn't seem to work. When I do
twitter = Twitter::Client.new(:login => 'mylogin', :password => 'mypassword') user = Twitter::User.find('ev', twitter)
...the user returned always seems to be some guy named "Jose Italo", no matter what username I try.
Similary, I tried python-twitter, but following users doesn't seem to work. When I do
api = twitter.Api(username='mylogin', password='mypassword') user = api.GetUser('ev') api.CreateFriendship(user)
...I get this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.5-i386/egg/twitter.py", line 1769, in CreateFriendship
File "build/bdist.macosx-10.5-i386/egg/simplejson/__init__.py", line 307, in loads
File "build/bdist.macosx-10.5-i386/egg/simplejson/decoder.py", line 335, in decode
File "build/bdist.macosx-10.5-i386/egg/simplejson/decoder.py", line 353, in raw_decode
ValueError: No JSON object could be decoded
So any suggestions for a working library, or how to get twitter4r or python-twitter working?