コード例 #1
0
ファイル: task.py プロジェクト: linuxu2015/python
def listtask():
	msg = '你抢到了一个任务'
	url='http://m.qianka.com/api/h5/subtask/fetch'
	res=session.get(url)
	#print res.text
        data = json.loads(res.text)
	for i in range(0,6):
		status = data['data'][i]['status']
	#	status = 2
		if status == 2:
			msg = msg + data['data'][i]['title']
			weixin.login('*****@*****.**','Xlb890213')
			weixin.singlesend('oZE9Gv2DJURwE6WY8HZ0bENqhVW4',msg)
			print(msg)
			break
			#sys.exit()
	for j in range(0,3):
		task_title = data['data'][j]['title']
		task_id = data['data'][j]['id']
		task_qty = data['data'][j]['qty']
		print(task_title),
		print(task_id),
		print(task_qty)
	tid = data['data'][0]['id']
	taskid = str(tid)
        taskqty = data['data'][0]['qty']
	task = { 'task_id' : taskid }
	if taskqty > 0:
		qiang(task)
		print('#################################抢到了!!####################################')
	print(time.strftime(ISOTIMEFORMAT,time.localtime(time.time())))#while True:
コード例 #2
0
ファイル: wsgi.py プロジェクト: linuxu2015/weixin_api
def send():
    if request.method == 'POST':
        tos = request.form.get('phone')
        content = request.form.get('content')
        tos = phone_to_weixinid(tos)
        weixin.login(username,password)
        weixin.singlesend(tos,content)
        return jsonify({'resp':status})
    elif request.method == 'GET':
        return jsonify({'resp':errstatus})
    else:
        return jdonigy({'resp':'unknown method'})
コード例 #3
0
def send():
    if request.method == 'POST':
        tos = request.form.get('phone')
        content = request.form.get('content')
        tos = phone_to_weixinid(tos)
        weixin.login(username, password)
        weixin.singlesend(tos, content)
        return jsonify({'resp': status})
    elif request.method == 'GET':
        return jsonify({'resp': errstatus})
    else:
        return jdonigy({'resp': 'unknown method'})
コード例 #4
0
ファイル: gongjiaotomysql.py プロジェクト: linuxu2015/python
def sendweixin(msg):
	#msg = '%s car is comming' % data[0]
        weixin.login('*****@*****.**','Xlb890213')
        weixin.singlesend('oZE9Gv2DJURwE6WY8HZ0bENqhVW4',msg)