smart_http.request - python examples

Here are the examples of the python api smart_http.request taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

0 View Complete Implementation : corp_utils.py
Copyright Apache License 2.0
Author : virus-warnning
def list_corp_from_api(name):
	resp = smart_http.request('company.g0v.ronny.tw', '/api/search', {'q': name})
	if resp != False and resp['found'] > 0:
		corp_list = []
		for e in resp['data']:
			fullname = get_attr(e, ['公司名稱', '商業名稱'])
			if fullname == name:
				corp_list.append({
					'uid':    e['統一編號'],
					'name':   name,
					'boss':   get_attr(e, ['代表人姓名', '負責人姓名']),
					'addr':   get_attr(e, ['公司所在地', '地址']),
					'regat':  e['登記機關'],
					'status': get_attr(e, ['公司狀況', '現況']),
					'lat':    0,
					'lng':    0
				})
		if len(corp_list) > 0:
			return corp_list
	return False