Giter Club home page Giter Club logo

koodo-prepaid-api's Introduction

koodo-prepaid-api

A tiny Python program to scrape Koodo Mobile's prepaid billing dashboard and return data therein as a JSON blob (or CSV) over HTTP. Super rough, lightweight, and brittle. Currently only fetches data about usage - how many minutes and how many megabytes you have left on your mobile "Boosters."

Includes a D3.js graph that you can look at to view your usage over time, as well as a cronjob that can automatically fetch data from Koodo.

Runs well (and for free) on Heroku:

Deploy

##Local installation

git clone https://github.com/psobot/koodo-prepaid-api.git
cd koodo-prepaid-api
pip install -r requirements.txt

To run the server locally:

python koodo.py --server

To fetch a single data point from Koodo:

python koodo.py --fetch

##Configuration

Important variables - like the username and password you use to log into Koodo's prepaid billing dashboard - need to be stored somewhere. What better place than in environment variables?

  • KOODO_USERNAME stores the user name (i.e. email address) used to log into your Koodo prepaid account.

  • KOODO_PASSWORD stores the password you use to log into your Koodo prepaid account. (super secure)

  • DATABASE_URL stores the DB connection string used to connect to some sort of a database. If you don't provide this, a SQLite DB called koodo.db will be created in the current directory and used instead. (Note that SQLite won't work on Heroku.)

##Heroku Setup The one-click "Deploy to Heroku" button above should do almost everying required to set this app up on Heroku, but there are still a couple steps that need doing.

  • Log into the Heroku Scheduler Dashboard and add a single recurring task that calls python koodo.py --fetch every hour. (This task shouldn't take longer than 30 seconds to fetch a single data point from Koodo, which means that running the task hourly won't exceed your monthly free dyno allotment.)

##TODO

Tons of cool stuff could be done with this data. Scrape another page to find out things like:

  • How much am I actually spending on my Koodo prepaid account, on average?
  • Is Prepaid still cheaper than Postpaid, given my usage patterns?

koodo-prepaid-api's People

Contributors

psobot avatar

Stargazers

dbaser avatar  avatar

Watchers

 avatar 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.