Created
October 26, 2011 21:07
-
-
Save peterbe/1317863 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UpdateTwitterHandler(tornado.web.RequestHandler, tornado.auth.TwitterMixin): | |
@tornado.web.asynchronous | |
@tornado.gen.engine | |
def post(self): | |
access_token = self.get_current_user_access_token() | |
result = yield tornado.gen.Task(self.twitter_request, | |
"/account/update_profile_background_image", | |
image=open('new_image.png', 'rb').read(), | |
access_token=access_token) | |
print result | |
self.redirect("/?backgroundimage=updated") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment