Giter VIP home page Giter VIP logo

poke-alerts's Introduction

Custom location based script for Pokemon Alerts

This script reads feeds of pokemon from Twitter and/or Discord regularly and then filters those by your iPhone's location and sends Messenger notifications of the ones close to your location.

Instalation

$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt

Prerequisites

This script makes some assumptions:

  • You have access to Twitter, Discord, Facebook and iCloud
  • You have Twitter feeds of tweets that include a Pokemon name in its text and a location (latitude, longitude) in its URL
    • Any other tweet will be discarded
  • You have Discord channels of messages that include a Pokemon name in its text and a location (latitude, longitude) in its URL
    • Any other message will be discarded

You need to create a file that it's not tracked because of sensitive information (login credentials and tokens) located at src/credentials.py. The file should look like this:

FB_EMAIL = '[email protected]'
FB_PASSWORD = 'password'
FB_THREAD_ID = '1525064787606453'
FB_COOKIE_FILE = './cookies/fb'

APPLE_EMAIL = '[email protected]'
APPLE_PASSWORD = 'password'
APPLE_COOKIE_DIRECTORY = './cookies/apple'
IPHONE_NAME = "John's iPhone"

TWITTER_API_CONSUMER_KEY = 'key'
TWITTER_API_CONSUMER_SECRET = 'secret'
TWITTER_API_ACCESS_TOKEN_KEY = 'token-key'
TWITTER_API_ACCESS_TOKEN_SECRET = 'token-secret'
TWITTER_POKEMON_FEEDS = [
  'username',
]

DISCORD_API_TOKEN = 'token'
DISCORD_CHANNELS = [
  'channel_id',
]

POKEMON_LIST = [
  'Dragonite',
]
  • The script uses the FB info to login to Facebook and send messages from that account to that group thread.
  • The script uses the APPLE info to login to iCloud and get the location of that device.
  • The script uses the TWITTER info to togin to Twitter and fetch the tweets of those feeds.
  • The script uses the DISCORD info to fetch Discord messages from those channels with that token.
  • POKEMON_LIST should contain all pokemon names, but since it's too long I didn't put it here.

The script uses a cookies folder to save login info, so if you're using the same paths for cookies as my example, don't forget to create the folder (that is also ignored in git)

mkdir cookies

Run

$ PYTHONPATH=. python src/script.py

poke-alerts's People

Contributors

dragosoprica avatar

Stargazers

ricky avatar Marius-Constantin Melemciuc avatar

Watchers

James Cloos avatar  avatar

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.