GithubHelp home page GithubHelp logo

fitnessfabrik_visitor_diagram's Introduction

fitnessfabrik_usage_diagramm

My local gym Fitnessfabrik started offering a visitor count during the Corona period in 2020. The websites only shows the current visitor count but it doesn't offer a history function or diagrams. So I created this small project to scrape the data from the website and create useful diagrams out of it. The diagrams offer an easy way to find less busy time spots in the gym :)

Original website

Script

The Python 3 script uses the Beautiful Soup lib to scrape the visitor count from http://besucher.fitnessfabrik.de every minute. It writes the data to a simple .csv file and uses the pandas and Plotly lib to render a HTML diagram from the data.

I run the script on a Raspberry Pi 3 and has proven to be very reliable for the job.

This a rendered HTML diagram by the script

Trigger

  • A simple way to start the script is to just run python3 get_count.py
  • It's recommended to set the script up as a systemd service and trigger it via cron
    • 50 5 * * 1-5 systemctl start gym_visitor_count -> Start at 5:50 GMT during the week
    • 10 23 * * 1-5 systemctl stop gym_visitor_count -> Stop at 23:10 GMT during the week
    • 50 8 * * 6,0 systemctl start gym_visitor_count -> Start at 08:50 GMT on weekends
    • 10 21 * * 6,0 systemctl stop gym_visitor_count -> Stop at 21:10 GMT on weekends
  • One could also use systemd timers to schedule the service

View the diagrams

There multiple options to view the diagrams with the visitor statistics.

  • Local workstation
    • Go to the output folder specified in the script and open the <ISO_8601_date>.html file (for example 2020-06-30.html)
  • Remote device without GUI (for example a Raspberry Pi with CLI only)
    • A Raspberry Pi runs the script perfectly fine and offers a low power consumption
    • A good way to view the HTML files is to run a webserver (like Nginx) with directory listing enabled
    • The script copies the rendered HTML files to the /var/www/html/ directory which can be served via Nginx

Nginx hosting the HTML files with directory listing enabled

Disclaimer:

I am not associated with the company running the gym. This is just a small hobby project by a customer.

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.