Fork me on GitHub

yonghao's twitter hack with extra function

by Yonghao Yu

28 Mar 2014

What I did

I create own application and add some function in tweethack.py. Now my application allow users to tweet media message.

To run it, you need to git clone my update version of tweethack:

https://github.com/yonghaoy/tweethack

The code I added:

elif tos == "tweet pictures":
    print "Let's tweet a picture from the command line!"

    while exit != True:
      tweet = raw_input("What would you like to tweet?  ")
      photo = open('img/unc.jpg','rb')
      twitter.update_status_with_media(status = tweet, media = photo)
      exit = raw_input("Type exit to go back or press enter to Tweet again.  ")
      if exit == "exit":
        exit = True

Access to my key

I have public my access secret in a google doc and share my doc to my google plus, and tag Elliot.

Demo:

For some reason, the picture won't show in github's post, but it works in my twitter

yonghao is a second year graduate year of SILS student. He is from China. Find Yonghao Yu on Twitter, Github, and on the web.
comments powered by Disqus