>>> import pytwitter
>>> twitter = pytwitter.pytwitter()
>>> twitter.help_test()
'<ok>true</ok>'
In the above example, 'help_test' is converted to http://twitter.com/help/test.xml using the power of __getattr__. Full code is here: http://svn.evil.ie/python/pytwitter. The whole thing is around 100 lines long.
Some methods are not working, like direct_messages, as pytwitter attempts to use this as http://twitter.com/direct/messages.xml instead of the real url of http://twitter.com/direct_messages.xml. I'll add exceptions as I get around to it. Thanks twitter. Thwitter.
0 comments:
Post a Comment