import urllib,sys
from bs4 import BeautifulSoup
#githuburl='https://github.com/search?utf8=%E2%9C%93&q=%22'+sys.argv[1]+'%22'
#googleurl='https://google.f0j0f.com/search?q=site:'+sys.argv[1]
#baiduurl= 'http://www.baidu.com/s?wd=site%3A'+sys.argv[1]
def gs(domain):
	githuburl='https://github.com/search?utf8=%E2%9C%93&q=%22'+domain+'%22'
	#github search 
	body=urllib.urlopen(githuburl)
	bodyread=body.read()
	soup=BeautifulSoup(bodyread,'lxml')
	if bodyread.find('class="counter') >-1 :
		print "Domainis:%s Github Search: %s"%(domain,soup.find('span',class_='counter').text)
	else:
		pass
		#print "Domain:%s Github Search: %s"%(domain,0)
'''#google search
body2=urllib.urlopen(googleurl)
bodyread2=body2.read()
if bodyread2.find('margin-left:53px') > -1:
	print "Domain:%s Google Search: %s"%(sys.argv[1],'Yes')
else:
	print "Domain:%s Google Search: %s"%(sys.argv[1],'No')
	print bodyread2
'''
def bs(domain):
	baiduurl= 'http://www.baidu.com/s?wd=site%3A'+domain
	#baidu search
	body3=urllib.urlopen(baiduurl)
	bodyread3=body3.read()
	if bodyread3.find('class="n"') > -1:
		print "Domainis:%s Baidu Search: %s"%(domain,'Yes')
	else:
		pass
		#print "Domain:%s Baidu Search: %s"%(domain,'No')
domain=open(sys.argv[-1]).readlines()
for i in domain:
	gs(i)
	bs(i)
