Matt Ramuta

28 December 2014

Filtering Twitter for emojis

I'm trying out Twitter Streaming API to check for new tweets that contain some special characters, like emojis. I'm using Tweepy and the biggest challenge I faced, was setting up emoji unicode IDs the correct way.

If I wanted to find an airplane emoji with a 4-digit id like 2708, there were no problems:


But the problem occured when I wanted to use an ID with 5-chars, like 1F602:


The above code wouldn't work. After some googling I realised that with 5 characters unicode ids you have to do things a little bit different. The thing that worked looks like this:


So "U000" (capital u and three zeros) instead of just lowercase "u".

You can see the whole example here:

Other useful links:

# Back