forked from cbogithub/pogo-snipe-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rarespawns.py
34 lines (29 loc) · 887 Bytes
/
rarespawns.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import re
import requests
from socketIO_client import SocketIO, BaseNamespace
r = requests.get('http://188.165.224.208:49002/api/v1/auth')
auth = r.json()
def rarespawns_noti(data):
p = re.compile(ur'[-]?\d+[.]\d+')
lat = re.findall(p, data['lat'])
print lat, lat[0], len(lat)
if len(lat) < 1:
return
lon = re.findall(p, data['lon'])
if len(lon) < 1:
return
print data
socket = SocketIO(
host='188.165.224.208',
port='49001',
params={'token': auth['token']},
headers={
'Referer': 'http://www.rarespawns.be/',
'Host': '188.165.224.208:49001',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36',
'Origin': 'http://www.rarespawns.be',
}
)
poke_namespace = socket.define(BaseNamespace, '/pokes')
poke_namespace.on('verified', rarespawns_noti)
socket.wait()