Skip to content

Instantly share code, notes, and snippets.

@pathcl
Created May 14, 2015 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pathcl/d1cb9430d08904a42ec5 to your computer and use it in GitHub Desktop.
Save pathcl/d1cb9430d08904a42ec5 to your computer and use it in GitHub Desktop.
tarro$ cat google-scan.py
#!/usr/bin/env python
import re
import sys
import google
import urllib2
if len(sys.argv) < 2:
print sys.argv[0] + ": <dict>"
sys.exit(1)
fh = open(sys.argv[1])
for word in fh.readlines():
print "\nSearching for " + word.strip()
results = google.search(word.strip())
try:
for link in results:
if re.search("youtube", link) == None: print link
except KeyError:
pass
except urllib2.HTTPError, e:
print "Google search failed: " + str(e)
tarro $ cat text
intitle:''index.of'' python [pdf]
tarro $ ./google-scan.py text
Searching for intitle:''index.of'' python [pdf]
http://slav0nic.org.ua/static/books/python/
http://misc.crashdump.fr/eBooks/python/
http://meh.dustri.org/Programming/
http://kysmykseka.net/koti/wizardry/Programming/Python/
http://www.jeapedu.com/python-ebook/
http://www.mmnt.net/db/0/0/www.mans.edu.eg/Learn/Python/pdf
https://pypi.python.org/pypi?%3Aaction=search&term=pdf&submit=search
http://www.sistemas.ith.mx/raymundo/python/
http://kolos.math.uni.lodz.pl/~archive/Inne%20-%20Python/
http://swilliams.ca/python-tutorials/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment