File: MakeUrlList.py

package info (click to toggle)
kodi 2%3A17.6%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 87,148 kB
  • sloc: cpp: 588,459; xml: 58,591; ansic: 42,735; sh: 12,932; makefile: 4,785; python: 2,803; objc: 1,075; perl: 1,041; cs: 624; java: 500; asm: 294; sed: 16
file content (16 lines) | stat: -rw-r--r-- 568 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import urllib2
import simplejson

# This example request includes an optional API key which you will need to
words = open('/usr/share/dict/words').readlines()
for word in words:
	word = word.rstrip()
	url = ('http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q='+word+'+https&userip=67.169.84.240')
	#print url
	#print word.rstrip()
	request = urllib2.Request(url, None, {'Referer': 'http://test.com'})
	response = urllib2.urlopen(request)

	results = simplejson.load(response)
	for result in results['responseData']['results']:
		print result['unescapedUrl']