What is the shortest Twitter #hashtag that has never been used? As an additional constraint, let’s focus on the lexicographically first hashtag composed of ASCII letters only of that kind. Let’s skip dessert and use Python and the Twitter Search API to find out:
import urllib
import json
import itertools
import string
import time
k, max_k = 1, 10
while k < max_k:
for tag in itertools.product(string.ascii_lowercase, repeat=k):
tag = ''.join(tag)
print "Searching for #%s" % tag
search_url = 'https://search.twitter.com/search.json?q=%%23%s' % tag
while True:
search_result = json.loads(urllib.urlopen(search_url).read())
if 'results' in search_result:
break
print "Wait a few seconds because of Twitter Search API limit"
time.sleep(5)
search_result = search_result['results']
if not search_result:
print "Unused hashtag: #%s" % tag
k = max_k
break
k += 1
After a few minutes, the result: #agy. What could we use that one for?
I’m from the US. These suggestions may not be universal. ‘Agy’ brings to mind either ‘ageism’ or ‘aggie’ (as in Agricultural schools, https://en.wikipedia.org/wiki/Aggie#Schools). In the vein of the former sense, ‘agy’ might be a description of how someone behaves, or a feeling something (like music) gives you, as in ‘Beatles songs have an agy tonality, man’ (i.e. taking you back to a specific time in history). Phonetically, though, it rolls off more like the second one to me, but lexically, ‘agy’ and ‘aggie’ are fairly dissimilar. So it’s a toss-up.
The HN post about Mathics brought me here, incidentally. I usually poke around a place to get a sense of the person behind such a cool thing. Thanks, now.