Skip to content

Instantly share code, notes, and snippets.

@batok
Created April 14, 2010 20:34
Show Gist options
  • Save batok/366317 to your computer and use it in GitHub Desktop.
Save batok/366317 to your computer and use it in GitHub Desktop.
@expose()
def sns(self,*args, **kwargs):
try:
d = json.loads(request.body)
except:
d = dict()
d[u"Message"] = "Dummy Message"
m = d.get(u"Message", "").encode("utf-8")
t = Twitter()
t.setauth(TW_USER,TW_PWD)
t.status_update(m)
@batok
Copy link
Author

batok commented Apr 14, 2010

You hava to import these at the beginning of the turbogears 2 controller

import json
from twyt.twitter import Twitter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment