We Recommend

Learning Python Learning Python
The authors of Learning Python show you enough essentials of the Python scripting language to enable you to begin solving problems right away, then reveal more powerful aspects of the language one at a time. This approach is sure to appeal to programmers and system administrators who have urgent problems and a preference for learning by semi-guided experimentation.


Posted By

felipec on 05/02/07


Tagged

web20 twitter


Versions (?)


Who likes this?

4 people have marked this snippet as a favorite

jarjar2k7
gedittest
fukami
lukaszkorecki


Python Twitter


Published in: Python 


  1. import rest
  2.  
  3. class Connection:
  4. url = "https://twitter.com"
  5.  
  6. def __init__(self, username, password):
  7. self.conn = rest.Connection(self.url, username, password)
  8. self.status = Status(self.conn)
  9.  
  10. class Status:
  11. def __init__(self, conn):
  12. self.conn = conn
  13.  
  14. def update(self, message):
  15. res = self.conn.request_post("statuses/update.xml", {"status": message})

Report this snippet 

You need to login to post a comment.