Skip to content

Instantly share code, notes, and snippets.

@singhpratyush
Last active June 14, 2017 04:50
Show Gist options
  • Save singhpratyush/3753460c5c69f6e946cd6d1c2b88cf06 to your computer and use it in GitHub Desktop.
Save singhpratyush/3753460c5c69f6e946cd6d1c2b88cf06 to your computer and use it in GitHub Desktop.
A small script that keeps requesting random searches from a loklak instance
import os
import requests
link = 'http://api.wordnik.com/v4/words.json/randomWords?hasDictionaryDef=tru'
'e&minCorpusCount=0&minLength=5&maxLength=15&limit=1&api_key='
+ os.environ.get('WORDNIK_KEY')
loklak_host = 'http://35.188.118.126'
while True:
word = requests.get(link).json()[0]['word']
print(word)
requests.get(loklak_host + '/api/search.json?q=' + word)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment