GithubHelp home page GithubHelp logo

velib-exporter's Introduction

velib-exporter

Want to export your stats from https://www.velib-metropole.fr/ ?

from this ugly interface:

to:

Features

  • Your total Velib trips number
  • Your total distance in Velib (in km)
  • Your total distance in electrical Velib (in km)
  • Your total distance in mechanical Velib (in km)
  • Your highest trip distance (your personal record! yay!) (in km)
  • Your average Velib trip duration (in minutes)
  • Total CO2 saved according to Velib (in grams)
$> curl -s 127.0.0.1:5050/metrics | grep -B2 -E ^velib_
# HELP velib_co2_total_saved Total CO2 saved by using Velib in grams
# TYPE velib_co2_total_saved gauge
velib_co2_total_saved 7328.200000000001
# HELP velib_distance_electrical Distance total in electrical Velib in meters
# TYPE velib_distance_electrical gauge
velib_distance_electrical 33737
# HELP velib_distance_mechanical Distance total in mechanical Velib in meters
# TYPE velib_distance_mechanical gauge
velib_distance_mechanical 32283
# HELP velib_distance_total Distance total in Velib in meters
# TYPE velib_distance_total gauge
velib_distance_total 66020
# HELP velib_trip_average_duration Velib trip average duration in minutes
# TYPE velib_trip_average_duration gauge
velib_trip_average_duration 12
# HELP velib_trip_highest_distance Velib trip highest distance in meters
# TYPE velib_trip_highest_distance gauge
velib_trip_highest_distance 6554
# HELP velib_trip_number Number of Velib trips
# TYPE velib_trip_number gauge
velib_trip_number 25

ℹī¸ Stats are refreshed every every half hour.

Installation

$ git clone https://github.com/qselle/velib-exporter
$ cd velib-exporter
$ go build

Usage

$ ./velib-exporter -help
Usage of velib-exporter:
  -address string
        Exporter listening address (default "127.0.0.1")
  -debug
        Debug mode
  -port string
        Exporter listening port (default "5050")
  -token string
        Velib API token

To get the -token value, go on: https://www.velib-metropole.fr/private/account#/, login and inspect the network requests, then check the getAllInfoUsers request and get the BEARER cookie value.

Grafana

Get the dahsboard: https://grafana.com/grafana/dashboards/15787


Feel free to contribute.

velib-exporter's People

Contributors

quentinselle avatar

Stargazers

Hugues Morisset avatar Nastasia Demont avatar  avatar Solvik avatar Stanislas 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.