Giter Club home page Giter Club logo

tagesschau-data-fetching's Introduction

Tagesschau-data-fetching

Useful snippets

# gets json length from input file
jq length database.json
# gets number of files in currrent dir
find . -type f | wc -l
# gets size of current dir
du -hs
# gets last modified of file
stat database.json

Depends on

  • python3
  • urllib3
  • json
  • os
  • datetime
  • glob
  • BeautifulSoup
  • re

for analytics

  • numpy
  • pandas
  • matplotlib
  • seaborn
  • networkx

Setup (Linux)

mkdir ~/apps
cd ~/apps
git clone https://github.com/emilianscheel/tagesschau-data-fetching
# Create system service
sudo nano /etc/systemd/system/tagesschau-data-fetching.service
  1. Replace <user> with your username
  2. Paste the configuration into the file ends with .service
[Unit]
Description=Tagesschau data fetching
User=<user>
After=multi-user.target
Wants=tagesschau-data-fetching.timer

[Service]
Type=oneshot
WorkingDirectory=/home/<user>/apps/Tagesschau-data-fetching/
ExecStart=/usr/bin/python3 main.py

[Install]
WantedBy=multi-user.target
# Create system timer
sudo nano /etc/systemd/system/tagesschau-data-fetching.timer
  1. Replace <user> with your username
  2. Paste the configuration into the file ends with .timer
[Unit]
Description=Fetches Tagesschau.de for data and saves it
Requires=tagesschau-data-fetching.service

[Timer]
Unit=tagesschau-data-fetching.service
OnCalendar=*:0/11

[Install]
WantedBy=timers.target
# starts and enables service, view status
sudo systemctl enable tagesschau-data-fetching.service
sudo systemctl start tagesschau-data-fetching.service
sudo systemctl status tagesschau-data-fetching.service

# starts and enables timer, view status
sudo systemctl enable tagesschau-data-fetching.timer
sudo systemctl start tagesschau-data-fetching.timer
sudo systemctl status tagesschau-data-fetching.timer

That configuration starts our system service every eleven minutes. The system service triggers the main.py script which is the fetching the tagesschau api.

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.