Giter Site home page Giter Site logo

pokealarm / pokealarm Goto Github PK

View Code? Open in Web Editor NEW
309.0 34.0 324.0 21.22 MB

PokeAlarm is a highly configurable application designed to give you complete control over your PokémonGO notifications.

License: GNU Affero General Public License v3.0

Python 99.81% Dockerfile 0.19%
hacktoberfest

pokealarm's Introduction

PokeAlarm Discord Python 3.7 license

PokeAlarm is a highly configurable application that filters and relays alerts about Pokemon Go to your favorite online service, allowing you to be the first to know of any rare monsters, raids, quests or other informations like invasions, lured stops, gym color changes or raid egg spawns.

What exactly is PokeAlarm?

PokeAlarm is an easy to use yet highly configurable webserver designed to receive webhook data (via POST requests) from a scanner. PokeAlarm then filters data, and relays it into one of your favorite online services such as Discord, Telegram, Twitter, and more. With PokeAlarm, you'll instantly know about every rare monster or legendary raid detected by your scanners. It's highly configurable, allowing the user to define custom messages and filter alerts based on numerous criteria.

Looking for Help?

Wiki

Head on over to the PokeAlarm Wiki to find detailed instructions on setting up and configuring PokeAlarm. You can find the table of contents on the right!

Discord

Before visiting your discord channel, check both the Wiki and the FAQ. If you still can't find what you are looking for, try our Discord channel - but make sure you read the #rules channel or risk getting banned!

Github

Have an idea for a new feature? Think you found a bug? Head over to our Issues Tab and open a new 'Issue' ticket. Make sure to follow the template completly, or else your issue will be closed without comment.

Want to contribute?

Besides financial support, you can also do your part to help PA grow. Feel free to submit PR's to our Pull Requests Tab. You can also update the Wiki by editing RST files in 'docs' folder and creating a new PR. If you find a mistake but don't have the skill to fix it, feel free to open an 'Issue'.

pokealarm's People

Contributors

audidriver13 avatar billyjbryant avatar blaulan avatar brettgus avatar buncertainc avatar cel1ca avatar crhbetz avatar evilmoses avatar fosjoddie avatar gkuiper avatar jabluszko avatar jeezandrice avatar jimbim89 avatar jnovack avatar kvangent avatar legitdongo avatar lzibeti avatar manolomanila avatar martini1 avatar mpw1337 avatar nhumber avatar pontiky avatar raphael1700 avatar ravishivt avatar reuschelcgn avatar seikur0 avatar sloppydrive avatar sprintnudel avatar sttug avatar twoopi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pokealarm's Issues

[Enhancement] Discord

Is there any chance of having this post in Discord acting like the bots I see all the time or maybe facebook groups?

Telegram issues

As mentioned in the reddit thread, this needs to be added to alarms.json to get Telegram to work:

    {
        "active": "True",
        "type":"telegram",
        "chat_id":"your bot chat ID",
        "bot_token":"your bot API"
    },

For fellow newbies reading this: I used this tutorial to start my Telegram bot and get the token and chat_id: http://www.domoticz.com/wiki/Telegram_Bot

Traceback error when running 'runwebhook.py'

Traceback (most recent call last):
  File "C:\Users\Asad\Desktop\Pokemon go dev\PokemonGo-Map\PokeAlarm\runwebhook.py", line 54, in <module>
    alarm_thread = Alarm_Manager(data_queue)
  File "C:\Users\Asad\Desktop\Pokemon go dev\PokemonGo-Map\PokeAlarm\alarms\alarm_manager.py", line 28, in __init__
    settings = json.load(file)
  File "C:\Python27\lib\json\__init__.py", line 291, in load
    **kw)
  File "C:\Python27\lib\json\__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "C:\Python27\lib\json\decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Python27\lib\json\decoder.py", line 380, in raw_decode
    obj, end = self.scan_once(s, idx)
ValueError: Expecting , delimiter: line 6 column 4 (char 93)

Webhook window closes intermittently

Hello,

I'm having an issue in which my webhook python window will randomly close after some time. Sometimes it will close after 5 minutes of running, other times it will close after 8 hours of running. I'm using the latest time fix posted by kvangent. Because of this issue, I have to constantly check to see if my webhook server is running and restart it- I'm missing out on some notifications.

Any help would be appreciated.

Crash sometimes when Notification Triggered

2016-08-07 05:08:56,487 [ alarm_manager] [ INFO] Pikachu notication was triggered!
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/home/warxhead/PokeAlarm/alarms/alarm_manager.py", line 63, in run
self.trigger_pkmn(data['message'])
File "/home/warxhead/PokeAlarm/alarms/alarm_manager.py", line 108, in trigger_pkmn
'addr': get_address(lat, lng),
File "/home/warxhead/PokeAlarm/alarms/utils.py", line 93, in get_address
return loc.housenumber + " " + loc.street
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

I get the same crash in windows too

Instructions typo

Just a heads up, your instructions say:

Run pip to install requirments pip install -r requriements.txt

Should be:

Run pip to install requirements pip install -r requirements.txt

Thanks for the great tool!

Not getting notifications of all pokemon

Hi,

I've seen this happen quite a few times. I have some of the more rarer pokemons set to true however even though it shows up on my pokemon go map server, the PokeAlarm does not send any notifications. For example, I saw a Blastoise within the map that expires in 5 minutes however it never sent a notification to slack.

Another example is with Eevee. I think I only get a notification half of the time when she spawns. I constantly check my pokemon go map server and notice she'd appear but sometimes i wouldn't get the notification.

Problem running python runwebhook.py

Hey guys, just attempted to set this up for my Telegram bot, running into an issue when I try to

python runwebhook.py
root@server-1:/home/admin/PokeAlarm# python runwebhook.py -H IPHERE -P PORTHERE
Traceback (most recent call last):
  File "runwebhook.py", line 2, in <module>
    from gevent import monkey; monkey.patch_all()
  File "/usr/local/lib/python2.7/dist-packages/gevent/__init__.py", line 49, in <module>
    from gevent.hub import get_hub, iwait, wait, PYPY
  File "/usr/local/lib/python2.7/dist-packages/gevent/hub.py", line 11, in <module>
    from greenlet import greenlet, getcurrent, GreenletExit
ImportError: /usr/local/lib/python2.7/dist-packages/greenlet.so: undefined symbol: _PyTrash_thread_deposit_object

Any idea what could be causing this? Running pip install -r requirements.txt seems to confirm all requirements are met.

Type Error: unsupported operand types

Hello there,

After running PokeAlarm for a bit it stops with this error.

2016-08-07 11:14:49,699 [ alarm_manager] [ INFO] Horsea notication was triggered!
Exception in thread Thread-1:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/Users/pinchemac/Downloads/PokemonGo-Map-develop-5/PokeAlarm/alarms/alarm_manager.py", line 63, in run
self.trigger_pkmn(data['message'])
File "/Users/pinchemac/Downloads/PokemonGo-Map-develop-5/PokeAlarm/alarms/alarm_manager.py", line 108, in trigger_pkmn
'addr': get_address(lat, lng),
File "/Users/pinchemac/Downloads/PokemonGo-Map-develop-5/PokeAlarm/alarms/utils.py", line 93, in get_address
return loc.housenumber + " " + loc.street
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

No module named gevent

hi,

Having this error :

root@pokemaps:/var/www/PokeAlarm# python runwebhook.py
Traceback (most recent call last):
  File "runwebhook.py", line 6, in <module>
    from gevent import monkey
ImportError: No module named gevent

Did pip install -r requirements.txt, everything is fine.
What's wrong ?

Thanks.

Need to change URL for icons

2016-08-07 17:26:57,462 [ alarm_manager] [ INFO] Bulbasaur notication was triggered!
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/root/PokeAlarm/alarms/alarm_manager.py", line 63, in run
self.trigger_pkmn(data['message'])
File "/root/PokeAlarm/alarms/alarm_manager.py", line 119, in trigger_pkmn
alarm.pokemon_alert(pkinfo)
File "/root/PokeAlarm/alarms/slack_alarm.py", line 35, in pokemon_alert
icon_url='https://raw.githubusercontent.com/AHAAAAAAA/PokemonGo-Map/master/static/icons/{id:d}.png'.format(**pkinfo)
ValueError: Unknown format code 'd' for object of type 'str'

I'm not familiar with git. Otherwise, I'd do a PR to try and fix it.

https://github.com/PokemonGoMap/PokemonGo-Map/tree/develop/static/icons

should be the new URL, right?

Push Bullet Issue?

Get this error after getting a notification

2016-07-31 21:32:38,085 [ alarm_manager] [ INFO] Gyarados notication was triggered!
2016-07-31 21:32:39,311 [connectionpool] [ INFO] Resetting dropped connection: api.pushbullet.com
2016-07-31 21:32:41,383 [connectionpool] [ DEBUG] "POST /v2/pushes HTTP/1.1" 200 None
Traceback (most recent call last):
File "runwebhook.py", line 45, in
app.run(debug=config['DEBUG'],host=config['HOST'], port=config['PORT'])
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 843, in run
run_simple(host, port, self, **options)
File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 694, in run_simple
inner()
File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 659, in inner
srv.serve_forever()
File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 499, in serve_forever
HTTPServer.serve_forever(self)
File "/usr/lib/python2.7/SocketServer.py", line 233, in serve_forever
self._handle_request_noblock()
File "/usr/lib/python2.7/SocketServer.py", line 292, in _handle_request_noblock
self.handle_error(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 290, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 318, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 331, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 654, in init
self.finish()
File "/usr/lib/python2.7/SocketServer.py", line 713, in finish
self.wfile.close()
File "/usr/lib/python2.7/socket.py", line 283, in close
self.flush()
File "/usr/lib/python2.7/socket.py", line 307, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
socket.error: [Errno 32] Broken pipe

Slack icons

Slack icons are really blurred is there a way we can clean them up?

[Enhancement] Add distance to pokemon from a specified location

It would be nice to have the notification tell you how far away the pokemon is. This would prevent the need to click the notification to open the map for certain pokemon that happen to be a bit too far away to go get in the moment but still show up in a scan. For example, this would help if I only care about pokemon that are essentially right next to me for now but I don't want to change my scanning radius because later I will be able to go and get pokemon that are further away.

A simple implementation of this could be done by asking the user for latlon coords and then adding something like this in the notify_pkmns method of notifications.py:

lon1 = -78.942769 #User defined longitude lat1 = 36.009407 #User defined latitude lon2 = pkmn['longitude'] lat2 = pkmn['latitude'] dlon = lon2 - lon1 dlat = lat2 - lat1 a = (math.sin(math.radians(dlat/2.)))**2 + math.cos(math.radians(lat1)) * math.cos(math.radians(lat2)) * (math.sin(math.radians(dlon/2.)))**2 c = 2 * math.atan2( math.radians(math.sqrt(a)), math.radians(math.sqrt(1-a)) ) d = 3959 * c #3959 is the radius of Earth in miles

You could then just add 'distance': d to the pkinfo part and pass that through with the notification text.

Nidoran's crash Slacker Alarm

`2016-08-01 20:29:22,933 [ alarm_manager] [ INFO] NidoranΓÖé notication was triggered! Exception in thread Thread-1: Traceback (most recent call last):

File "C:\Python27\lib\threading.py", line 801, in __bootstrap_inner self.run()

File "C:\Users\Keith\Desktop\PokeAlarm-master\alarms\alarm_manager.py", line 54, in run self.trigger_pkmn(data['message'])

File "C:\Users\Keith\Desktop\PokeAlarm-master\alarms\alarm_manager.py", line 85, in trigger_pkmn alarm.pokemon_alert(pkinfo)

File "C:\Users\Keith\Desktop\PokeAlarm-master\alarms\slack_alarm.py", line 34, in pokemon_alert text='<{}|{}> {}'.format(gmaps_link, notification_text, time_text), UnicodeEncodeError: 'ascii' codec can't encode character u'\u2642' in position 14: ordinal not in range(128)`

Error on Ubuntu 14.04

I have the map running fine on my server but the PokeAlarm script refuses to run because the websocket module is missing. I tried to install it, but get more errors. See below:

root@myserver:~/PokeAlarm# python runwebhook.py 
Traceback (most recent call last):
  File "runwebhook.py", line 16, in <module>
    from alarms.alarm_manager import Alarm_Manager
  File "/usr/local/lib/python2.7/dist-packages/gevent/builtins.py", line 93, in __import__
    result = _import(*args, **kwargs)
  File "/root/PokeAlarm/alarms/alarm_manager.py", line 14, in <module>
    from pushbullet_alarm import Pushbullet_Alarm
  File "/usr/local/lib/python2.7/dist-packages/gevent/builtins.py", line 93, in __import__
    result = _import(*args, **kwargs)
  File "/root/PokeAlarm/alarms/pushbullet_alarm.py", line 4, in <module>
    from pushbullet import PushBullet
  File "/usr/local/lib/python2.7/dist-packages/gevent/builtins.py", line 93, in __import__
    result = _import(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pushbullet/__init__.py", line 4, in <module>
    from .listener import Listener
  File "/usr/local/lib/python2.7/dist-packages/gevent/builtins.py", line 93, in __import__
    result = _import(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pushbullet/listener.py", line 9, in <module>
    import websocket
  File "/usr/local/lib/python2.7/dist-packages/gevent/builtins.py", line 93, in __import__
    result = _import(*args, **kwargs)
ImportError: No module named websocket
root@myserver:~/PokeAlarm# pip install websocket
Downloading/unpacking websocket
  Downloading websocket-0.2.1.tar.gz (195kB): 195kB downloaded
  Running setup.py (path:/tmp/pip_build_root/websocket/setup.py) egg_info for package websocket

Requirement already satisfied (use --upgrade to upgrade): gevent in /usr/local/lib/python2.7/dist-packages (from websocket)
Requirement already satisfied (use --upgrade to upgrade): greenlet in /usr/local/lib/python2.7/dist-packages (from websocket)
Installing collected packages: websocket
  Running setup.py install for websocket

Successfully installed websocket
Cleaning up...
root@fvdvpn:~/PokeAlarm# python runwebhook.py 
Traceback (most recent call last):
  File "runwebhook.py", line 16, in <module>
    from alarms.alarm_manager import Alarm_Manager
  File "/usr/local/lib/python2.7/dist-packages/gevent/builtins.py", line 93, in __import__
    result = _import(*args, **kwargs)
  File "/root/PokeAlarm/alarms/alarm_manager.py", line 14, in <module>
    from pushbullet_alarm import Pushbullet_Alarm
  File "/usr/local/lib/python2.7/dist-packages/gevent/builtins.py", line 93, in __import__
    result = _import(*args, **kwargs)
  File "/root/PokeAlarm/alarms/pushbullet_alarm.py", line 4, in <module>
    from pushbullet import PushBullet
  File "/usr/local/lib/python2.7/dist-packages/gevent/builtins.py", line 93, in __import__
    result = _import(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pushbullet/__init__.py", line 4, in <module>
    from .listener import Listener
  File "/usr/local/lib/python2.7/dist-packages/gevent/builtins.py", line 93, in __import__
    result = _import(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pushbullet/listener.py", line 17, in <module>
    class Listener(Thread, websocket.WebSocketApp):
AttributeError: 'module' object has no attribute 'WebSocketApp'

pip install -r requirements.txt terminates without errors. I am running python version 2.7.6 on Ubuntu 14.04. I suppose I could try setting up a separate python environment with 2.7.11 but I'm not feeling too great about the prospect. Thanks in advance.

"notify_text" doesn't appear to be working

So, finally managed to get PokeAlarm up and running and it's pretty much perfect. I saw in an update we can customize what the message says with the "notify_text" field, which I read about here

Once the server is running, the message I get from the bot is:

A wild Omanyte has appeared! 
http://maps.google.com/maps?q=lat,lon
 Available until 21:06:54 (9m 59s).

When, in the alarm.json I specified something like this:

                "active": "True",
                "type":"telegram",
                "chat_id":"-CHATID",
                "bot_token":"BOTTOKEN:BOTTOKEN-BOTTOKEN",
                "notify_text":"A wild <pkmn> has appeared until <12h_time>! <pkmn> is @ <addr> on <loc>. You are <dist> from the <pkmn> <gmaps>"
            }

Any idea why these changes aren't being applied for the client? I should be on the most recent version of PokeAlarm.

[Enhancement] Add Address to notification

For example, "Dragonite at 1600 Pennsylvania Ave, 20500 until 5:00pm (13m 30s)." This way we can gauge the location of the pokemon before tapping on the map link.

[Enhancement] Notify of location change

Is it possible to add a notification when the location of the PokemonGo-Map changes? Coordinates could be passed to link to new location as well.

Here is what shows up in my PokemonGo-Map console when location is updated (Coordinates modified to middle of nowhere):
2016-08-08 14:24:29,580 [ Thread-3921][ app][ INFO] Changing next location: 59.7458078,-34.1829137

But I don't know enough of how the webhook feature works to know if that data is even passed to this app in the first place.

Thanks for your time and thanks for the app. :)

Broken Pipe (Errno 32)

After running the alarm for a bit , and after receiving about 3 notification for pokemon, the following error message is displayed.

2016-07-29 23:09:12,703 [ alarm_manager] [ INFO] Horsea notication was triggered!
2016-07-29 23:09:12,731 [connectionpool] [ INFO] Resetting dropped connection: api.pushbullet.com
2016-07-29 23:09:13,864 [connectionpool] [ DEBUG] "POST /v2/pushes HTTP/1.1" 200 None
Traceback (most recent call last):
File "runwebhook.py", line 45, in
app.run(debug=config['DEBUG'],host=config['HOST'], port=config['PORT'])
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/flask/app.py", line 843, in run
run_simple(host, port, self, **options)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/werkzeug/serving.py", line 694, in run_simple
inner()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/werkzeug/serving.py", line 659, in inner
srv.serve_forever()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/werkzeug/serving.py", line 499, in serve_forever
HTTPServer.serve_forever(self)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 233, in serve_forever
self._handle_request_noblock()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 292, in _handle_request_noblock
self.handle_error(request, client_address)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 290, in _handle_request_noblock
self.process_request(request, client_address)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 318, in process_request
self.finish_request(request, client_address)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 331, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 654, in init
self.finish()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 713, in finish
self.wfile.close()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 283, in close
self.flush()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 307, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
socket.error: [Errno 32] Broken pipe

I don't have any idea what might cause this or where to even start to attempt to find a fix.

[Enhancement] Pushing to channels.

Hi,

Could it be possible to push to a channel, instead of my devices ?

I tried to add this to alarms/pushbullet_alarm.py :

def __init__
[...]
my_channel = self.client.channels[0]
push = my_channel.push_note("Hello World !", "Hello World")
[...]

def pokemon_alert
[...]
push = my_channel.push_link(notification_text, gmaps_link, body=time_text)
[...]

But it seems that, even if I receive the first push (Hello World) in the channel, nothing else is working anymore. Nothing is displayed in my console when running PokemonGo-Map, like
log.info(name + " notification was not triggered because time_left had passed.")

I can't find what I broke. Is anyone able to help ? :)

Thanks.

Telegram PokeAlert notifications for channels instead of groups?

Hey, not sure if this is the right place to post this as it's more of a request/"is this already a feature" question, rather than an issue. I'm curious if PokeAlert is compatible with channels instead of groups? That way people won't get notified in the group if other people start talking about the new Pokemon that spawned.

I found this bit of information when looking for a channels ID code, but it I don't think it applies to PokeAlert yet.

[Typo] Incorrect link on Twilio wiki page

Link to Twilio website in step 1 is www.twilio.com which is autolinked to https://github.com/kvangent/PokeAlarm/wiki/www.twilio.com by GitHub.

Should behttps://www.twilio.com

GH doesn't support PR's on wiki otherwise I would submit one.

Error running latest Update With PokemonGo-Map Dev Branch

Trying to re-setup my PokeAlarm (which was working brilliantly!). I downloaded PokemonGO-Map latest dev build and I cannot for the life of me get it to work. I've tried to change alarms, looking at possible changes I made from the first time, and nothing yet.

Here's what I'm getting.

C:\Users\Copmputer\Desktop\PokeTools\PokeAlarm-master>C:\Python27\python runwebhook.py
Traceback (most recent call last):
File "runwebhook.py", line 51, in
alarm_thread = Alarm_Manager(data_queue)
File "C:\Users\Computer\Desktop\PokeTools\PokeAlarm-master\alarms\alarm_manager.py", line 23, in init
settings = json.load(file)
File "C:\Python27\lib\json__init__.py", line 291, in load
**kw)
File "C:\Python27\lib\json__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "C:\Python27\lib\json\decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Python27\lib\json\decoder.py", line 380, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting , delimiter: line 7 column 4 (char 116)

How do you deal with negative expiry time?

I was browsing the code, and it looks like you check to see if a Pokemon has already expired when you get the notification. However I've noticed that some of the pokemon will have a negative expiry time. I believe this means that the pokemon will last longer than 15 mins. Are you accounting for this?

No module named gevent error, but Gevent IS installed.

I saw the "no module named gevent" issue that was closed. I'm having the same issue, BUT gevent is installed and I'm running off the latest pull. See below:

Last login: Mon Aug 1 21:11:53 on ttys010
MacBook-Pro:~ user$ cd /Users/user/Documents/PokeAlarm-master
MacBook-Pro:PokeAlarm-master user$ sudo -H pip install -r requirements.txt
Requirement already satisfied (use --upgrade to upgrade): Flask==0.11.1 in /Library/Python/2.7/site-packages (from -r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): configargparse==0.10.0 in /Library/Python/2.7/site-packages (from -r requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pushbullet.py==0.10.0 in /Library/Python/2.7/site-packages (from -r requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): slacker==0.9.24 in /Library/Python/2.7/site-packages (from -r requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): twilio==5.4.0 in /Library/Python/2.7/site-packages (from -r requirements.txt (line 5))
Requirement already satisfied (use --upgrade to upgrade): telepot==8.3 in /Library/Python/2.7/site-packages (from -r requirements.txt (line 6))
Requirement already satisfied (use --upgrade to upgrade): gevent==1.1.2 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 7))
Requirement already satisfied (use --upgrade to upgrade): itsdangerous>=0.21 in /Library/Python/2.7/site-packages (from Flask==0.11.1->-r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): click>=2.0 in /Library/Python/2.7/site-packages (from Flask==0.11.1->-r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): Werkzeug>=0.7 in /Library/Python/2.7/site-packages (from Flask==0.11.1->-r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): Jinja2>=2.4 in /Library/Python/2.7/site-packages (from Flask==0.11.1->-r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): requests>=1.0.0 in /Library/Python/2.7/site-packages (from pushbullet.py==0.10.0->-r requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): python-magic in /Library/Python/2.7/site-packages (from pushbullet.py==0.10.0->-r requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): websocket-client in /Library/Python/2.7/site-packages (from pushbullet.py==0.10.0->-r requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): httplib2>=0.7 in /Library/Python/2.7/site-packages (from twilio==5.4.0->-r requirements.txt (line 5))
Requirement already satisfied (use --upgrade to upgrade): six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from twilio==5.4.0->-r requirements.txt (line 5))
Requirement already satisfied (use --upgrade to upgrade): pytz in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from twilio==5.4.0->-r requirements.txt (line 5))
Requirement already satisfied (use --upgrade to upgrade): urllib3==1.9.1 in /Library/Python/2.7/site-packages (from telepot==8.3->-r requirements.txt (line 6))
Requirement already satisfied (use --upgrade to upgrade): greenlet>=0.4.9 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from gevent==1.1.2->-r requirements.txt (line 7))
Requirement already satisfied (use --upgrade to upgrade): MarkupSafe in /Library/Python/2.7/site-packages (from Jinja2>=2.4->Flask==0.11.1->-r requirements.txt (line 1))
MacBook-Pro:PokeAlarm-master user$ python runwebhook.py
Traceback (most recent call last):
File "runwebhook.py", line 2, in
from gevent import monkey; monkey.patch_all()
ImportError: No module named gevent
MacBook-Pro:PokeAlarm-master user$ sudo -H pip install gevent
Requirement already satisfied (use --upgrade to upgrade): gevent in /private/var/root/Library/Python/2.7/lib/python/site-packages
Requirement already satisfied (use --upgrade to upgrade): greenlet>=0.4.9 in /private/var/root/Library/Python/2.7/lib/python/site-packages (from gevent)
MacBook-Pro:PokeAlarm-master user$ sudo -H pip install greenlet
Requirement already satisfied (use --upgrade to upgrade): greenlet in /private/var/root/Library/Python/2.7/lib/python/site-packages
MacBook-Pro:PokeAlarm-master user$ python runwebhook.py
Traceback (most recent call last):
File "runwebhook.py", line 2, in
from gevent import monkey; monkey.patch_all()
ImportError: No module named gevent
MacBook-Pro:PokeAlarm-master user$

Telegram notification issue

i get this error like ten minutes after the startup of the program on OSX:

Exception in thread Thread-1: Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/Users/riccardo/MEGA/GithubProjects/PokeAlarm/alarms/alarm_manager.py", line 63, in run self.trigger_pkmn(data['message']) File "/Users/riccardo/MEGA/GithubProjects/PokeAlarm/alarms/alarm_manager.py", line 119, in trigger_pkmn alarm.pokemon_alert(pkinfo) File "/Users/riccardo/MEGA/GithubProjects/PokeAlarm/alarms/telegram_alarm.py", line 22, in pokemon_alert message = self.client.sendMessage(self.channel, '<b>' + header + '</b> \n' + body_text, parse_mode='HTML', disable_web_page_preview='False') File "/usr/local/lib/python2.7/site-packages/telepot/__init__.py", line 240, in sendMessage return self._api_request('sendMessage', _rectify(p)) File "/usr/local/lib/python2.7/site-packages/telepot/__init__.py", line 229, in _api_request return api.request((self._token, method, params, files), **kwargs) File "/usr/local/lib/python2.7/site-packages/telepot/api.py", line 130, in request r = fn(*args, **kwargs) #fn` must be thread-safe
File "/usr/local/lib/python2.7/site-packages/urllib3/request.py", line 141, in request_encode_body
return self.urlopen(method, url, *_extra_kw)
File "/usr/local/lib/python2.7/site-packages/urllib3/poolmanager.py", line 153, in urlopen
response = conn.urlopen(method, u.request_uri, *_kw)
File "/usr/local/lib/python2.7/site-packages/urllib3/connectionpool.py", line 575, in urlopen
_pool=self, _stacktrace=stacktrace)
File "/usr/local/lib/python2.7/site-packages/urllib3/util/retry.py", line 222, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/local/lib/python2.7/site-packages/urllib3/connectionpool.py", line 529, in urlopen
body=body, headers=headers)
File "/usr/local/lib/python2.7/site-packages/urllib3/connectionpool.py", line 357, in _make_request
httplib_response = conn.getresponse(buffering=True)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1136, in getresponse
response.begin()
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 453, in begin
version, status, reason = self._read_status()
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 409, in _read_status
line = self.fp.readline(_MAXLINE + 1)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 480, in readline
data = self._sock.recv(self._rbufsize)
File "/usr/local/lib/python2.7/site-packages/gevent/_sslgte279.py", line 455, in recv
return self.read(buflen)
File "/usr/local/lib/python2.7/site-packages/gevent/_sslgte279.py", line 310, in read
return self._sslobj.read(len or 1024)
ProtocolError: ('Connection aborted.', error(54, 'Connection reset by peer'))

^CKeyboardInterrupt
Traceback (most recent call last):
File "runwebhook.py", line 60, in
server.serve_forever()
File "/usr/local/lib/python2.7/site-packages/gevent/baseserver.py", line 349, in serve_forever
self._stop_event.wait()
File "/usr/local/lib/python2.7/site-packages/gevent/event.py", line 207, in wait
return self._wait(timeout)
File "/usr/local/lib/python2.7/site-packages/gevent/event.py", line 117, in _wait
gotit = self._wait_core(timeout)
File "/usr/local/lib/python2.7/site-packages/gevent/event.py", line 95, in _wait_core
result = self.hub.switch()
File "/usr/local/lib/python2.7/site-packages/gevent/hub.py", line 609, in switch
return greenlet.switch(self)`

i don't know what may be the cause but googling up it seems related to a bad thread handling

can't run runwebhook.py

Gevent Installation :

pi@raspberrypi:~/PokeAlarm $ pip install gevent
Requirement already satisfied (use --upgrade to upgrade): gevent in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): greenlet>=0.4.9 in /usr/local/lib/python2.7/dist-packages (from gevent)
Cleaning up...

when running runwebhook.py :

Traceback (most recent call last):
File "runwebhook.py", line 15, in
from alarms.alarm_manager import Alarm_Manager
File "/usr/local/lib/python2.7/dist-packages/gevent/builtins.py", line 93, in import
result = _import(_args, *_kwargs)
File "/home/pi/PokeAlarm/alarms/alarm_manager.py", line 10, in
from pushbullet_alarm import Pushbullet_Alarm
File "/usr/local/lib/python2.7/dist-packages/gevent/builtins.py", line 93, in import
result = _import(_args, *_kwargs)
File "/home/pi/PokeAlarm/alarms/pushbullet_alarm.py", line 4, in
from pushbullet import PushBullet
File "/usr/local/lib/python2.7/dist-packages/gevent/builtins.py", line 93, in import
result = _import(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/pushbullet/init.py", line 4, in
from .listener import Listener
File "/usr/local/lib/python2.7/dist-packages/gevent/builtins.py", line 93, in import
result = _import(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/pushbullet/listener.py", line 17, in
class Listener(Thread, websocket.WebSocketApp):
AttributeError: 'module' object has no attribute 'WebSocketApp'

atm i can't run this script :(

No JSON object could be decoded

When going to start webhook.py I keep getting this error, which is strange because I've gotten it working before and just wiped the old copy I had and set up a new one. Any clue what could be causing this?
image

Fix for pokemons not being pushed and request

When I ran webhook it found a lot of pokemons but none were pushed to Pushbullet. Then I saw this: "2016-07-29 16:41:56,415 [ alarm_manager] [ INFO] Electabuzz notification was not triggered because time_left had passed."

In alarms\alarm_manager.py line 55 I changed
from this: elif dissapear_time < datetime.utcnow() :
to this: elif dissapear_time > datetime.utcnow() :
because dissapear time must be larger than datetime.

untitled

It works now and notifications work. I just have this problem of notifications being pushed 1h in advance. Can you program it so all pushed pokemons have dissapear_time under 15 min (so it won't show that 45 min dissapear time). I as a novice would do someting like this:
(dissapear_time - datetime.utcnow() ) < 15min

But then again I am a complete amateur and don't know how you pros code...

Multiple errors on Pokemon

Hi,

Running python runwebhook.py -L fr gives me those errors :

image
image
image

I can't find what's causing this.
Seems that using "-L fr" is the issue.

Thanks for helping

Lost notification of existing Pokémon: "time_left has passed"?

Earlier today I took a quick look at the map and noticed an Arcanine with still 8 minutes to depop very close to my location. Rushed to it and was able to catch it, but when I went back home I looked for PokeAlarm log and found this:

2016-08-08 16:36:30,115 [ alarm_manager] [ INFO] Zubat ignored: notify not enabled.
2016-08-08 16:36:55,722 [ alarm_manager] [ INFO] Arcanine ignore: time_left has passed.
2016-08-08 16:37:18,254 [ alarm_manager] [ INFO] Weedle ignored: notify not enabled.

The Arcanine was definitely there, it was showing in the map and I was able to catch it but for some reason the notification didn't fire up becaue "time_left" has passed. I assume this is a bug.

Still issues with ReadTimeOut

I just reinstalled the PokemonGo-Map on my own VPS instead of Heroku. Everything works fine except the webhook to PokeAlarm.

I think it's an issue with the time as I'm getting a ReadTimeOut issue. My alarm is running as I got a confirmation on Telegram.

Screenshot: http://imgur.com/FPUEF1N

Anybody got any ideas or had the same issue?

No Notifications (Slack)

Thank you for putting together this amazing tool. I followed all the configuration steps and successfully launch the webhook python script. The "PokeAlarm" BOT successfully joins my slack channel and the "Webhook server running on http://127.0.0.1:4000" message returns. However, I never get any notifications of any pokemon spawn. I have tested with all my most common Ekans, Cubones etc in my area and I see them spawning all over on my PoGo Map API but still no notifications.

image

Telegram notification issue (after network failure?)

Telegram notification was working perfectly, and I was out hunting but then I noticed that my map stopped responding for about 4-5 minutes so I assume it was a home network issue (connection to internet loss or something). Some time later, I noticed some rare Pokémon had appeared but PokeAlarm never notified via Telegram. When I came back home, I found this on the console:

2016-08-07 14:41:57,697 [ alarm_manager] [ INFO] Zubat ignored: notify not set to "True".
2016-08-07 14:42:20,688 [ alarm_manager] [ INFO] Zubat ignored: notify not set to "True".
2016-08-07 14:42:29,698 [ alarm_manager] [ INFO] Onix notication was triggered!
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in bootstrap_inner
self.run()
File "/root/PokeAlarm/alarms/alarm_manager.py", line 54, in run
self.trigger_pkmn(data['message'])
File "/root/PokeAlarm/alarms/alarm_manager.py", line 85, in trigger_pkmn
alarm.pokemon_alert(pkinfo)
File "/root/PokeAlarm/alarms/telegram_alarm.py", line 26, in pokemon_alert
message = self.client.sendMessage(self.channel, '' + notification_text + ' \n' + gmaps_link + '\n' + time_text, parse_mode='HTML', disable_web_page_preview='Fals
e')
File "/usr/local/lib/python2.7/dist-packages/telepot/__init
.py", line 240, in sendMessage
return self._api_request('sendMessage', _rectify(p))
File "/usr/local/lib/python2.7/dist-packages/telepot/init.py", line 229, in _api_request
return api.request((self._token, method, params, files), *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/telepot/api.py", line 130, in request
r = fn(_args, *_kwargs) # fn must be thread-safe
File "/usr/lib/python2.7/dist-packages/urllib3/request.py", line 135, in request_encode_body
*_urlopen_kw)
File "/usr/lib/python2.7/dist-packages/urllib3/poolmanager.py", line 153, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 559, in urlopen
_pool=self, _stacktrace=stacktrace)
File "/usr/lib/python2.7/dist-packages/urllib3/util/retry.py", line 223, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 516, in urlopen
body=body, headers=headers)
File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 345, in _make_request
self, url, "Read timed out. (read timeout=%s)" % read_timeout)
ReadTimeoutError: HTTPSConnectionPool(host=u'api.telegram.org', port=443): Read timed out. (read timeout=30)

^CKeyboardInterrupt
Traceback (most recent call last):
File "runwebhook.py", line 57, in
server.serve_forever()
File "/usr/local/lib/python2.7/dist-packages/gevent/baseserver.py", line 349, in serve_forever
self._stop_event.wait()
File "/usr/local/lib/python2.7/dist-packages/gevent/event.py", line 207, in wait
return self._wait(timeout)
File "/usr/local/lib/python2.7/dist-packages/gevent/event.py", line 117, in _wait
gotit = self._wait_core(timeout)
File "/usr/local/lib/python2.7/dist-packages/gevent/event.py", line 95, in _wait_core
result = self.hub.switch()
File "/usr/local/lib/python2.7/dist-packages/gevent/hub.py", line 609, in switch
return greenlet.switch(self)
KeyboardInterrupt
root@raspberrypi:~/PokeAlarm# ^C

I believe this is related to the (potential) network outage but I am not sure.

Change utc time to local

hi to ask if it's possible to change the disappear time from utc to local time in the message "available until" ?? (im using slack)

Connection terminated

After running the alarm for a short while I get the following error message.

2016-07-29 21:48:09,318 [connectionpool] [ DEBUG] "POST /v2/pushes HTTP/1.1" 200 None
Traceback (most recent call last):
File "C:\Users\AidenEades\Documents\PokeAlarm\runwebhook.py", line 45, in
app.run(debug=config['DEBUG'],host=config['HOST'], port=config['PORT'])
File "C:\Python27\lib\site-packages\flask\app.py", line 843, in run
run_simple(host, port, self, **options)
File "C:\Python27\lib\site-packages\werkzeug\serving.py", line 694, in run_simple
inner()
File "C:\Python27\lib\site-packages\werkzeug\serving.py", line 659, in inner
srv.serve_forever()
File "C:\Python27\lib\site-packages\werkzeug\serving.py", line 499, in serve_forever
HTTPServer.serve_forever(self)
File "C:\Python27\lib\SocketServer.py", line 227, in serve_forever
self._handle_request_noblock()
File "C:\Python27\lib\SocketServer.py", line 286, in _handle_request_noblock
self.handle_error(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python27\lib\SocketServer.py", line 641, in init
self.finish()
File "C:\Python27\lib\SocketServer.py", line 694, in finish
self.wfile.flush()
File "C:\Python27\lib\socket.py", line 301, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
socket.error: [Errno 10053] An established connection was aborted by the software in your host machine

Any ideas? (My first guess is firewall but not entirely sure, don't want to drop my entire firewall just to test if this works y'know?|)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.