Giter Site home page Giter Site logo

apt-email-notifications's Introduction

Apt-Email-Notifications

This is a tool that sends you an email when it has detected changes between your local state (stored in lastPrices.json) and data pulled from a URL.

I have used this to monitor the price/avaliability of apartments at a specific complex. This tool works best when it is set to run on a cron job, so that you can get regular updates.

USAGE: python3 pullMT.py

How to Run:

  • Add run the depency installation: pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client (or pip install -r requirements.txt)
  • Get your credentials (credentials.json) from the Google Cloud Console (this may involve making a new project with the Gmail API enabled)
  • Get added as a test user in the Google Cloud Console project
  • Set Control/Config Vars (below) to your desired settings + potentially room_types and fields

Control/Config Vars:

  • MOCK - If True, the script will prefill 'changes' with a mock response to make testing the email sending easier
  • SENDEMAIL - If True, the script will send an email if there are changes
  • VERBOSE - If True, the script will print out the changes it has detected + additional information

File Structure:

  • pullMT.py - Main script: pulls + parses data, compares it to the last pulled data, and sends an email if there are changes
  • sendGmail.py - Script to send an email using the Gmail API
  • lastPrices.json - File to store the last pulled data
  • credentials.json - File to store your Google Cloud credentials
  • token.json - File generated by the Google Cloud API when you run the script for the first time (and everytime you need to reauthenticate)

References

apt-email-notifications's People

Contributors

imnotartsy avatar nathan-lux 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.