forked from pkrumins/xgoogle
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of angryrancor/xgoogle
- Loading branch information
Showing
3 changed files
with
42 additions
and
5 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/python | ||
# | ||
# Justin Vieira ([email protected]) | ||
# http://www.rancorsoft.com -- Let's Rock Together. | ||
# | ||
# This program does a Google search for "super test results" and returns | ||
# all results. | ||
# | ||
|
||
from xgoogle.search import GoogleSearch, SearchError | ||
from threading import Thread | ||
from random import randint | ||
import time | ||
|
||
try: | ||
gs = GoogleSearch("super test results") | ||
gs.results_per_page = 50 | ||
displayedResults = 0 | ||
results = gs.get_results() | ||
while displayedResults < gs.num_results: | ||
for res in results: | ||
if res.title is not None: | ||
print res.title.encode('utf8') | ||
if res.desc is not None: | ||
print res.desc.encode('utf8') | ||
if res.url is not None: | ||
print res.url.encode('utf8') | ||
displayedResults += gs.results_per_page | ||
time.sleep(randint(15,60)) | ||
results = gs.get_results() | ||
except SearchError, e: | ||
print "Search failed: %s" % e | ||
|
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