Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
prompt the user for tweet text and return it urlencoded
#!/usr/bin/python
import urllib
def encode_tweet(tweet):
base_url="http://twitter.com/home?"
query = {"status": tweet}
return base_url+urllib.urlencode(query)
if __name__ == '__main__':
tweet = raw_input("paste or type a tweet to encode: ")
print ""
print encode_tweet(tweet)
print ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.