Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import urllib, json
- from random import choice
- import time
- sources = ["ChildPornography", "narcotics", "suicid"]
- def randomurl(searchfor):
- query = urllib.urlencode({'q': searchfor})
- url = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&%s' % query
- search_response = urllib.urlopen(url)
- search_results = search_response.read()
- results = json.loads(search_results)
- data = results['responseData']
- hits = data['results']
- return choice(hits)['url']
- def main():
- wordlist = open("words.txt").readlines() #dictionary of random words 1 per line
- for i in range(10):
- print randomurl(choice(wordlist))
- time.sleep(1)
- main()
Advertisement
Add Comment
Please, Sign In to add comment