Skip to content

Instantly share code, notes, and snippets.

@blha303
Last active November 13, 2016 05:30
Show Gist options
  • Save blha303/96bc4099684e0f3e6f783c51dc77b654 to your computer and use it in GitHub Desktop.
Save blha303/96bc4099684e0f3e6f783c51dc77b654 to your computer and use it in GitHub Desktop.
Randomises an emoji at the end of a twitter user name
#!/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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment