Browse Source

screenshots are now of globe.theairtraffic.com

fixes Jxck-S/plane-notify#115
pull/119/head
Mark Bumiller 2 years ago
parent
commit
a0a8df04db
  1. 2
      PseudoCode.md
  2. 4
      README.md
  3. 2
      __main__.py
  4. 2
      configs/mainconf.ini.example
  5. 2
      defSS.py

2
PseudoCode.md

@ -4,5 +4,5 @@
- A landing event is previously below 10k feet and (previously getting data, no longer getting data and previously not on the ground) or (now on the ground and previously not on the ground).
- Given the coordinates of the aircraft the nearest airport is found in an airport database from <https://ourairports.com/data> the distance is calculated using the Haversine formula. The state, region and country are also found in this database with the airport.
- At the time of takeoff a takeoff time is set, which is referenced in the landing event to calculate approximate total flight time.
- A Static map image is created based off location name. (Google Static Maps API) or a screenshot of <https://global.adsbexchange.com/> is created using Selenium/ChromeDriver. The selected plane is locked on in the screenshot.
- A Static map image is created based off location name. (Google Static Maps API) or a screenshot of <https://globe.theairtraffic.com/> is created using Selenium/ChromeDriver. The selected plane is locked on in the screenshot.
- If the landing event or takeoff event is true, It will output to any of the following built-in output methods. (Twitter, Pushbullet, and Discord can all be setup and enabled in each plane's config file). Outputs the location name, map, image, and flight time on landing. (Tweepy and "Pushbullet.py" and Discord_webhooks)

4
README.md

@ -3,7 +3,7 @@
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c4e1d839eec3468cadfe351d64dc1ac4)](https://app.codacy.com/manual/Jxck-S/plane-notify?utm_source=github.com&utm_medium=referral&utm_content=Jxck-S/plane-notify&utm_campaign=Badge_Grade_Settings)
[![GPLv3 License](https://img.shields.io/badge/License-GPL%20v3-yellow.svg)](https://opensource.org/licenses/)
Notify if configured planes have taken off or landed using Python with <a href="https://opensky-network.org/">OpenSky</a>(free) or <a href="https://www.adsbexchange.com/">ADSBExchange</a> Data(paid but much better), outputs location of takeoff location of landing and takeoff by reverse lookup of coordinates.
Notify if configured planes have taken off or landed using Python with <a href="https://opensky-network.org/">OpenSky</a>(free) or <a href="https://www.adsbexchange.com/">ADSBExchange</a> Data(paid, declining data, and run by clowns), outputs location of takeoff location of landing and takeoff by reverse lookup of coordinates.
### Discord Output Example
@ -43,7 +43,7 @@ pipenv install
### Install Selenium / ChromeDriver or setup Google Static Maps
Selenium/ChromeDriver is used to take a screenshot of the plane on globe.adsbexchange.com. Or use Google Static Maps, which can cost money if overused(No tutorial use <https://developers.google.com/maps/documentation/maps-static/get-api-key> to get to a key).
Selenium/ChromeDriver is used to take a screenshot of the plane on globe.theairtraffic.com. Or use Google Static Maps, which can cost money if overused(No tutorial use <https://developers.google.com/maps/documentation/maps-static/get-api-key> to get to a key).
#### Chrome
- This is assuming linux/debian

2
__main__.py

@ -274,5 +274,5 @@ except Exception as e:
logging.error(e)
logging.error(str(traceback.format_exc()))
from defDiscord import sendDis
sendDis(str("Error Exiting: " + str(e) + f"Failed on ({obj.config_path}) https://globe.adsbexchange.com/?icao={key} "), main_config, main_config.get('DISCORD', 'ROLE_ID'), "crash_latest.log")
sendDis(str("Error Exiting: " + str(e) + f"Failed on ({obj.config_path}) https://globe.theairtraffic.com/?icao={key} "), main_config, main_config.get('DISCORD', 'ROLE_ID'), "crash_latest.log")
raise e

2
configs/mainconf.ini.example

@ -59,6 +59,6 @@ CONSUMER_KEY = ck
CONSUMER_SECRET = cs
[MAP]
#Map to create from Google Static Maps or screenshot global tar1090 from globe.adsbexchange.com
#Map to create from Google Static Maps or screenshot global tar1090 from globe.theairtraffic.com
#Enter GOOGLESTATICMAP or ADSBX
OPTION = ADSBX

2
defSS.py

@ -29,7 +29,7 @@ def get_adsbx_screenshot(file_path, url_params, enable_labels=False, enable_trac
if platform.system() == "Linux" and os.geteuid()==0:
chrome_options.add_argument('--no-sandbox') # required when running as root user. otherwise you would get no sandbox errors.
browser = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options)
url = f"https://globe.adsbexchange.com/?{url_params}"
url = f"https://globe.theairtraffic.com/?{url_params}"
print(f"Getting Screenshot of {url}")
browser.set_page_load_timeout(80)
browser.get(url)

Loading…
Cancel
Save