Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pboardman committed Jul 19, 2016
0 parents commit fe0c182
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Pokemon GO server status

Check the status of the Pokemon GO servers from your Menubar (MacOS only)

![Demo](demo.png)

## Installation

Just get the app from the release page, put it in your application folder and launch it!

Optionally you can launch it on startup start by going in your mac setting under ``` Users & Groups ``` and dragging the application in your ``` login items ```.

## Making .app from source

- Install requirements

``` pip install -r requirements.txt ```

- Build the .app

``` python setup.py py2app ```
Binary file added appicon.icns
Binary file not shown.
Binary file added demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/pokedown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/pokeinit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/pokeok.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/pokeunstable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions pokegostatus.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/python

from bs4 import BeautifulSoup
import rumps
import requests


class pokegostatus(rumps.App):

@rumps.clicked("Manual refresh")
def manual_refresh(self, _):
self.refresh(self)

@rumps.timer(10)
def refresh(self, _):
URL = "http://cmmcd.com/PokemonGo/"

try:
r = requests.get(URL)
soup = BeautifulSoup(r.text, 'html.parser')
status = soup.body.header.h2.font.text
except:
status = False

if status == 'Online!':
self.icon = "icons/pokeok.png"
self.title = None
elif status == 'Unstable!':
self.icon = "icons/pokeunstable.png"
self.title = None
elif status == 'Offline!':
self.icon = "icons/pokedown.png"
self.title = None
elif not status:
self.icon = None
self.title = "No Internet"


if __name__ == "__main__":
pokegostatus("pokegostatus", icon="icons/pokeinit.png").run()
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bs4
requests
rumps
py2app
19 changes: 19 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from setuptools import setup

APP = ['pokegostatus.py']
DATA_FILES = ['icons']
OPTIONS = {
'iconfile':'appicon.icns',
'argv_emulation': True,
'plist': {
'LSUIElement': True,
},
'packages': ['rumps', 'bs4', 'requests'],
}

setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)

0 comments on commit fe0c182

Please sign in to comment.