Coder Social home page Coder Social logo

ghf20 / commuting_weather Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 2.0 12 KB

SMS notifications from python as to the optimal time to Commute from destination to source using WeatherAPI and Twilio SMS API. Designed to run from Raspberry Pi

License: MIT License

Python 100.00%

commuting_weather's Introduction

Commandline application for Sending Weather Forecasts via SMS with the Twilio API

Installation & Instructions (Linux Only):

  1. Ensure you have a Twilio Account. If you are a student, Github has a $50 credit for student twilio accounts https://education.github.com/pack

  2. register for the free weather API on RapidAPI hub https://rapidapi.com/weatherapi/api/weatherapi-com/

  3. install dependiencies:

    pip install -r requirements.txt
  4. Fill in API key and Twilio API.

  5. run main.py with:

    python3 main.py

    or

    chmod +x main.py && ./main.py
  6. register main.py to schedule execution

    Before execute the command below, be sure to change directory to the path 'main.py' is located

    Modify the time and date fields described as * * * * *

    echo "* * * * * ${USER}" $(which python3) $(pwd)\/main.py | tee -a /etc/crontab
    
    systemctl restart cron.service

    The time and date fields:

    To run main.py at 09:00 AM everyday

    echo "0 9 * * * ${USER}" $(which python3) $(pwd)\/main.py | tee -a /etc/crontab

    To run main.py at 02:15 PM on the first of every month:

    echo "15 14 1 * * ${USER}" $(which python3) $(pwd)\/main.py | tee -a /etc/crontab

    To check if job is scheduled for user (replace username):

    sudo crontab -u [username] -l

    or if root/dont have root privileges:

    less /etc/crontab

    Further detail refer https://man7.org/linux/man-pages/man5/crontab.5.html

commuting_weather's People

Contributors

ghf20 avatar tyamzak avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

ilkinr tyamzak

commuting_weather's Issues

Only trigger when not connected to Local network

Would like to add the feature for script to trigger if and only if the user is not connected to their local network.

  • Can detect any device
  • Is it resource heavy? Would like it to run on a pi server

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.