updatename.py
· 460 B · Python
Raw
#!/usr/bin/env python
import tweepy
import json
import random
from emoji import unicode_codes
emoji = [e.encode('utf-8') for e in unicode_codes.EMOJI_UNICODE.values() if len(e.encode('utf-8')) == 4]
with open(".twitter_config.json") as f:
config = json.load(f)
auth = tweepy.OAuthHandler(config["ckey"], config["csec"])
auth.set_access_token(config["utok"], config["usec"])
api = tweepy.API(auth)
api.update_profile("Steven Smith " + random.choice(emoji))
| 1 | #!/usr/bin/env python |
| 2 | import tweepy |
| 3 | import json |
| 4 | import random |
| 5 | from emoji import unicode_codes |
| 6 | emoji = [e.encode('utf-8') for e in unicode_codes.EMOJI_UNICODE.values() if len(e.encode('utf-8')) == 4] |
| 7 | |
| 8 | with open(".twitter_config.json") as f: |
| 9 | config = json.load(f) |
| 10 | |
| 11 | auth = tweepy.OAuthHandler(config["ckey"], config["csec"]) |
| 12 | auth.set_access_token(config["utok"], config["usec"]) |
| 13 | api = tweepy.API(auth) |
| 14 | |
| 15 | api.update_profile("Steven Smith " + random.choice(emoji)) |