Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- import requests
- import time
- import json
- id = 'user_id='
- token = "access_token=c66defb29fed8dca31548aa6447d24a7d58747b3280583ef59c3c5fb0b865875f0bffb8fe7a92c8d604d0"
- messagesget = "messages.get"
- messagessend = 'messages.send'
- requestget = "https://api.vk.com/method/" + messagesget + "?" +'out=0&count=1'+ "&" + token
- for i in range(100):
- r = requests.get(requestget)
- r_json = json.loads(r.text)
- idacc=(r_json['response'][1]['uid'])
- idacc= str(idacc)
- requestsend = "https://api.vk.com/method/" + messagessend + "?" +id+idacc+ "&"+'message=ok'+'&'+ token
- print(r_json)
- if 'Ping' in (r_json['response'][1]['body']):
- s = requests.get(requestsend)
- time.sleep(1)
- else:
- time.sleep(0.5)
- continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement