コード例 #1
0
	def concurrent_make_request_for_profile(self):
		# Working under the assumption that python will clean this up once there's nothing left
		# to do for the thread.
		while self.q.empty() == False:
			keyword_from_queue = self.q.get()
			req = HatchRequest(self.request_type, keyword_from_queue)
			self.project_name_dict[keyword_from_queue] = req.make_request_for_profile(self.url)
			self.q.task_done()
コード例 #2
0
ファイル: app.py プロジェクト: filipmares/hatch
def find_domainr_profile():
	project_name = request.args.get('name', '')
	#TODO: This doesn't look like the right timestamp
	results = Results('domain', int(time.time()))
	req = HatchRequest('domainr', project_name)
	possible_names_dict = req.make_request_for_domainr('http://domai.nr/api/json/search?q=')
	for key, value in possible_names_dict.items():
		results.add_result(Result(key, value))
	json = simplejson.dumps(results, cls=JSONCustomEncoder)				
	resp = Response(json, status=200, mimetype='application/json')					
	return resp