コード例 #1
0
ファイル: quicktest.py プロジェクト: JinSun2014/Sourcefinder
def getSources(topic):
	#urls = ['http://www.postcrescent.com/article/20140517/APC03/305170255/Integrys-Energy-growing-shareholders-told', 
	#		'http://www.postcrescent.com/article/20140517/APC03/305170255/Integrys-Energy-growing-shareholders-told']
	urls = GoogleNews(topic)
	urls.extend(YahooFinance(topic))
	print urls

	print len(urls)


	#NEWER CODE
	numUrls = len(urls)
	threads = []
	names = []


	for i in range(0, numUrls):
		t= threading.Thread(target=worker, args=(i,urls[i],names))
		threads.append(t)
		t.start()

	for p in threads:
	     p.join()

	return names