GithubHelp home page GithubHelp logo

sol23 / ing-diba-stock-scraper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mjaschen/ing-diba-stock-scraper

0.0 1.0 0.0 9 KB

A simple tool to scrape a stock watchlist on ing-diba.de

Makefile 8.08% JavaScript 91.92%

ing-diba-stock-scraper's Introduction

ING DiBa Stock Watchlist Scraper

A script which uses CasperJS and PhantomJS to scrape the contents of a ING DiBa stock watchlist into a CSV file.

Optionally, you can enable prom output in the config file and then it generates a metrics file for Prometheus.

Prerequisites

Installation

  • install PhantomJS
  • git clone https://github.com/mjaschen/ing-diba-stock-scraper.git
  • cd ing-diba-stock-scraper
  • make install
  • edit config.js (fill in login and password values)
  • verify/update file permissions of config.js (you may want to remove file permissions for everyone but yourself)

Starting a scrape

  • make

The current values of the watchlist will be saved as a CSV file in the data sub-directory.

The script is quite silent with default settings, but it's possible to make it more chatty:

  • make CASPERJS_OPTION_LOG_LEVEL="debug" CASPERJS_OPTION_VERBOSE="--verbose"

Example of CSV output

timestamp;id;isin;name;count;quote_watch;quote_current
1472978211;24299486;NL0000235190;Airbus Group;250 St.;57,479 EUR;53,011 EUR

Example of prom output

#HELP stock_price The stock price, either watched or current
#HELP stock_count The number of stocks in the watchlist
#TYPE stock_price gauge
#TYPE stock_count gauge
stock_price{type="current",id="23590133",isin="US88160R1014",name="Tesla",currency="EUR"} 260.82
stock_price{type="watch",id="23590133",isin="US88160R1014",name="Tesla",currency="EUR"} 197.586
stock_count{id="23590133",isin="US88160R1014",name="Tesla"} 1
stock_price{type="current",id="23561025",isin="DE0005089031",name="United Internet",currency="EUR"} 39.231
stock_price{type="watch",id="23561025",isin="DE0005089031",name="United Internet",currency="EUR"} 13.114
stock_count{id="23561025",isin="DE0005089031",name="United Internet"} 2

Example of Prometheus query to see the current value of all the stocks with a specific ISIN:

stock_count{isin="US88160R1014"} * on(id, name, isin) stock_price{type="current",isin="US88160R1014"}

ing-diba-stock-scraper's People

Contributors

mjaschen avatar tlex avatar

Watchers

 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.