Created
July 25, 2010 16:23
-
-
Save jessykate/489666 to your computer and use it in GitHub Desktop.
prompt the user for tweet text and return it urlencoded
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
#!/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