It looks like you're new here. If you want to get involved, click one of these buttons!
import urllib2
import re
import threading
url = urllib2.urlopen('http://www.google.co.uk/#hl=en&xhr=t&q=xinapse&cp=5&pf=p&sclient=psy&site=&source=hp&aq=0&aqi=&aql=&oq=xinaps&pbx=1&fp=68704d3128309f03')
source = url.read()
r1 = re.compile('/<h2 class=(.*?)><a href=\\"(.*?)\\" class=(.*?)>/')
links = r1.findall(source)
for link in links:
print link
r1 = re.compile(r'<h3 class=\"r\"><a href=[\'\"]?([^\'\" >]+)')
import urllib, simplejson, sys
def searchgoogle(string):
msg string
searchquery = urllib.urlencode({'q':msg})
url = ('http://ajax.googleapis.com/ajax/services/search/web?v=1.0&' + searchstring
results = urllib.urlopen(url)
readrs = simplejson.loads(results.read())
searchresults = readrs['responseData'] ['results']
for x in searchresults:
titlex = x ['title'].replace('<b>','')
title = titlex.replace('</b>','')
msg = title + ': ' + x['url']
print msg
searchgoogle(\"iexploit\")
iExploit - Home: http://www.iexploit.org/
iExploit: http://www.iexploit.org/community/misc.php%3Faction%3Dmarkread
YouTube - iExploit's Channel: http://www.youtube.com/user/iExploit
iExploit (iExploitTweet) on Twitter: http://twitter.com/iexploittweet
Heres a quick example I whipped up using simplejson:
import urllib, simplejson, sys
def searchgoogle(string):
msg string
searchquery = urllib.urlencode({'q':msg})
url = ('http://ajax.googleapis.com/ajax/services/search/web?v=1.0&' + searchstring
results = urllib.urlopen(url)
readrs = simplejson.loads(results.read())
searchresults = readrs['responseData'] ['results']
for x in searchresults:
titlex = x ['title'].replace('<b>','')
title = titlex.replace('</b>','')
msg = title + ': ' + x['url']
print msg
searchgoogle(\"iexploit\")
Output:
iExploit - Home: http://www.iexploit.org/
iExploit: http://www.iexploit.org/community/misc.php%3Faction%3Dmarkread
YouTube - iExploit's Channel: http://www.youtube.com/user/iExploit
iExploit (iExploitTweet) on Twitter: http://twitter.com/iexploittweet
http://pypi.python.org/pypi/simplejson/
Enjoy :)
Heres a quick example I whipped up using simplejson:
import urllib, simplejson, sys
def searchgoogle(string):
msg string
searchquery = urllib.urlencode({'q':msg})
url = ('http://ajax.googleapis.com/ajax/services/search/web?v=1.0&' + searchstring
results = urllib.urlopen(url)
readrs = simplejson.loads(results.read())
searchresults = readrs['responseData'] ['results']
for x in searchresults:
titlex = x ['title'].replace('<b>','')
title = titlex.replace('</b>','')
msg = title + ': ' + x['url']
print msg
searchgoogle(\"iexploit\")
Output:
iExploit - Home: http://www.iexploit.org/
iExploit: http://www.iexploit.org/community/misc.php%3Faction%3Dmarkread
YouTube - iExploit's Channel: http://www.youtube.com/user/iExploit
iExploit (iExploitTweet) on Twitter: http://twitter.com/iexploittweet
http://pypi.python.org/pypi/simplejson/
Enjoy :)
Loads of errors for me also i dont have the package simple json how do i install it?
sudo aptitude install python-simplejson