Code Monkey home page Code Monkey logo

check_perm_processing_times's Introduction

Check PERM Processing Times

Description

check_perm_processing_times.py

This script monitors the PERM processing times on the U.S. Department of Labor website. It compares the latest update date with the information stored locally. If there is an update, it sends an email notification to specified recipients. Finally it updates the local storage with the new webpage content for the future reference.

Basic Usage

# Install Python Modules
pip3 install bs4 --user

# Go into the script folder
cd /path/to/check_perm_processing_times

# Configure email credentials
vi config.ini

# Run the script
./check_perm_processing_times.py

# Check the debug log
less check_perm_processing_times.log

Note: See "Configuring Email Credentials" below for more information.

Run with Scheduler

In Linux, you can use the cron service to schedule tasks to run at specified intervals. Here's how you can set up a cron job to run a script every day at 8:00 am using the command line:

  1. Open your crontab file for editing:
crontab -e

If this is the first time you're editing the crontab, you may be prompted to choose an editor.

  1. Add the following line to run your script every day at 8:00 am:
0 8 * * * cd /path/to/check_perm_processing_times/ && ./check_perm_processing_times.py

Replace /path/to/check_perm_processing_times/ with the actual path to your script.

Here's the breakdown of the time specification:

0 8 * * *: This represents the cron schedule in the format minute hour day month day_of_week. In this case, meaning minute 0 of hour 8, every day, every month, every day of the week.

Configuring Email Credentials

Here's an example of the config.ini file:

[EmailCredentials]
sender_email = [email protected]
sender_password = your_email_password
receiver_emails = [email protected], [email protected]

For enhanced flexibility and security, it's recommended to use a Google APP Password. Follow the steps outlined in this Google Support article to enable it for your account: https://support.google.com/accounts/answer/185833

When dealing with multiple email receivers, it's important to note the following:

  • Email addresses separated by , (comma followed by a space) will receive individual notifications, with each recipient being unaware of others.
  • Email addresses separated by , (comma without a space) will be notified in the same email, allowing recipients to see each other's email addresses.

Example:

In this case, user1 and user2 will receive an email sent to both of them, and they can see each other's email addresses. User3 will receive an email sent only to themselves.

check_perm_processing_times's People

Contributors

schrht 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.