GitXplorerGitXplorer
p

bday-app

public
35 stars
8 forks
5 issues

Commits

List of commits on branch master.
Verified
a1ad4a2e1ab3ad4a727392e7f2cdfce2945567a3

Bump pillow from 4.1.1 to 6.2.0

ddependabot[bot] committed 5 years ago
Verified
3294020cd09fb97fb84c73abbda55042e5c4b613

Bump werkzeug from 0.12.1 to 0.15.3

ddependabot[bot] committed 5 years ago
Unverified
a360a02316e021ac4c3164dcdc4122da5d5a722b

Merge pull request #1 from clamytoe/readme

bbbelderbos committed 7 years ago
Unverified
f2115281b8257bb59835880dbee3777736ec64b1

Added shields to the README.md file

cclamytoe committed 7 years ago
Unverified
72ec5b42905ece2eddfacfea778364b1d3b38915

Change sid and token to "TWILIO_ACCOUNT_SID" or "ACCOUNT_SID" and "TWILIO_AUTH_TOKEN" or "AUTH_TOKEN".

ppybites committed 7 years ago
Unverified
8e71e143d0314b78f68c71860400cfe13fa4b321

update readme

ppybites committed 8 years ago

README

The README file for this repository.

Birthday App (bday-app)

Never Forget A Friend's Birthday with Python, Flask and Twilio

GitHub issues GitHub forks GitHub stars Twitter

This app lets you:

  • import your Facebook birthday calendar,
  • send SMS notification messages of upcoming birthdays,
  • send text messages and simple ecards via SMS.

app-printscreen

Setup instructions

  1. Clone this repo:

     $ git clone https://github.com/pybites/bday-app
    
  2. Make a virtual env and install dependencies:

     $ cd bday-app
     $ python3 -m venv venv
     $ source venv/bin/activate
     $ pip install -r requirements.txt
    
  3. Create a Twilio account, get a phone number and API key (sid) and token.

  4. Copy the settings template in place:

     $ cp env-example.conf env.conf
    
  5. Update it with the correct settings:

    • flask - secret = set this to a random, hard to guess string (see Flask docs)
    • twilio_api - sid + token = obtained in step 3
    • phones - twilio = obtained in step 3
    • phones - admin = your (verified) mobile phone number, where you want to receive notification messages
    • login - user + password = define your login credentials for the Flask app
    • server - url = unchanged if running locally, update to base URL if deployed elsewhere (so far I only tested it on my localhost)

NOTE: make sure you use E.164 number formatting for phone numbers (e.g. +34666555444, +442071838750). See Twilio's support article: Formatting International Phone Numbers.

  1. Import your FB calendar into local SQLite database with birthdays

    • Export your birthday calendar from Facebook and save it as cal.ics in the app's toplevel directory.

      export FB cal

    • Run model.py to import the birthdays into the DB. Use it with -t if you want to strip out real names.

        $ python model.py
      

How to run it

This app has two parts:

  1. The notifier which checks once a day for birthdays. If there are one or more birthdays that day it sends out an SMS to your configured admin phone. You need to run this as a background job so use nohup:

     $ nohup ./notify.py &
    
  2. The front-end is a Flask app which you can invoke with:

     $ python app.py
    

Note that for both scripts you need to have your virtualenv enabled.