Last active 1478979036

Randomises an emoji at the end of a twitter user name

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