Skip to content

Instantly share code, notes, and snippets.

@jessykate
Created July 25, 2010 16:23
Show Gist options
  • Save jessykate/489666 to your computer and use it in GitHub Desktop.
Save jessykate/489666 to your computer and use it in GitHub Desktop.
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