Skip to content

Instantly share code, notes, and snippets.

@scarnecchia
Last active March 7, 2020 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scarnecchia/fa52b1a83dfe77386903ff530ca19b1a to your computer and use it in GitHub Desktop.
Save scarnecchia/fa52b1a83dfe77386903ff530ca19b1a to your computer and use it in GitHub Desktop.

The hashtag #covidー19 contains the Japanese character Chōonpu, with the Univode value of U+30FC ー KATAKANA-HIRAGANA PROLONGED SOUND MARK. This is creating some search difficulties on twitter.

The following seems to work in the streaming API (using Python):

WORDS = [u'#covidー19']
try:
    listener = StreamListener(api=tweepy.API(wait_on_rate_limit=True)) 
    streamer = tweepy.Stream(auth=auth, listener=listener)
    print("Tracking: " + str(WORDS))
    streamer.filter(track=WORDS)
except Exception:
    pass

For the search API, use the UTF 8 encoding E3 83 BC or q=covid%E3%83%BC19.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment