GithubHelp home page GithubHelp logo

ov-chipkaart-tx's Introduction

OV Chipkaart Travel History

Docker image to download travel history of an anonymous OV Chipkaart using this website.

Rationale

As of now (September 2016), OV Chipkaart doesn't provide open API to download travel history, including top-up transactions.

This tool is a workaround around the missing API. It uses a headless Chrome browser and Selenium to scrape travel history from OV Chipkaart website and store it in a CSV file.

Usage

docker run \
  --rm
  --env OVCHIPKAART_CARD_NUMBER="[card_number]" \
  --env OVCHIPKAART_EXPIRATION_DATE="[card_expiration_date]" \
  --volume [download-dir]=/data \
  --privileged \
  mkrcah/ov-chipkaart-tx:latest \
  --month="[month]"

where

  • card_number and card_expiration_date are information that can be found on your anonymous OV chipkaart
  • month is a time period for which travel history will be downloaded, in YYYY-MM format. Currently, you can download transactions only half a year back from current date, not earlier.
  • download-dir a directory where the CSV file with transactions will be saved

There is an optional argument available:

  • --export-filename [filename] which specified name of the downloaded CSV file.

Card details can be also supplied via a file using the --env-file flag.

Note: --privileged is required in order for Chromium to start.

Example:

$ cat env.list
OVCHIPKAART_CARD_NUMBER=0000-1111-2222-3333
OVCHIPKAART_EXPIRATION_DATE=01-01-2020

$ docker run --env-file=env.list \
   --volume $(pwd)/export-data=/data \
   --privileged mkrcah/ov-chipkaart-tx \
   --month "2016-09"
Starting chrome...
Loading login page
...
Done!

$ ls ./export-data
ovchipkaart-2016-09.csv

Troubleshooting

Try to open the page and fill in provided data manually. If not, try installing selenium and running the script locally. If that doesn't help, or you find yourself lost, please open an issue.

License

MIT

ov-chipkaart-tx's People

Contributors

mkrcah avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kipjr

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.