Last active
June 14, 2017 04:50
-
-
Save singhpratyush/3753460c5c69f6e946cd6d1c2b88cf06 to your computer and use it in GitHub Desktop.
A small script that keeps requesting random searches from a loklak instance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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