Giter Club home page Giter Club logo

php-punch's Introduction

php-punch

A php based tool to aid in clocking in and out automatically.

GitHub Release Github All Releases Travis Ci Build

Features:

  1. Selenium webdriver based commands.
  2. Run as a cron job to clock in or out.
  3. Skips holidays.
  4. Customizable PTO/ Paid Time Off array to skip defined dates.
  5. Randomizes time period (within a range) that you clock in or out.
  6. Output can be saved as a back up of the punches, output is delimited by double quotes (") and field separated by commas (,) ie, csv format

Requires:

  1. Composer, for install instructions: https://getcomposer.org/download
  2. Chrome Browser: Version match required when installing ChromeDriver. Most recent version recommended
  3. ChromeDriver - get package here https://chromedriver.chromium.org/downloads get the version that corresponds to your chrome version.

    Note: follow these instructions when upgrading your browser

    1. unzip chromedriver_linux64.zip
    2. sudo mv -f chromedriver /usr/local/share/chromedriver
    3. sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
  4. Php
  5. Php-Webdriver via Composer composer install --no-dev

Usage:

  1. Install requred packages
  2. Copy config.example.php to config.php
  3. Set credentials and element ids in config file. (Requires walking through your clock in/out site and recording the proper css ids)
  4. Set a cron to run the program at your desired time for clocking in, crontab -e
# 8:55 am Monday - Friday, script default is a 5 minute range from this time
55 8 * * 1-5 php /path/to/punch.php 'in' >> /path/to/time_sheet.txt
  1. Set a cron to run the program at your desired time for clocking out, crontab -e
# 5:00 pm Monday - Friday, script default is a 5 minute range from this time
00 17 * * 1-5 php /path/to/punch.php 'out' >> /path/to/time_sheet.txt
  1. You can even create a desktop button to run the clock in sequence immediately (tested on ubuntu 18) with a .desktop file. Create a new file and add the following:
[Desktop Entry]
Comment=Clock In and log in time sheet
Icon=alarm-clock
Exec=sh -c "php /home/username/php-punch/punch.php 'in' 0 >> /home/username/Desktop/timesheet.txt"
Terminal=false
Type=Application
Name[en_US]=ClockIn
  1. To clock out create a new desktop file and add the following:
[Desktop Entry]
Comment=Clock Out and log in time sheet
Icon=alarm-clock
Exec=sh -c "php /home/username/php-punch/punch.php 'out' 0 >> /home/username/Desktop/timesheet.txt"
Terminal=false
Type=Application
Name[en_US]=ClockOut

php-punch's People

Contributors

modnar1226 avatar

Watchers

 avatar

php-punch's Issues

Windows Compatability

Chrome driver path and path to chrome browser needs to be dynamic and or have config settings.
Trying to detect the executable path did not work.

needed .exe on the executables

Click intercepted by a different element

The specific error:
element click intercepted: Element ... is not clickable at point (1853, 14). Other element would receive the click:


(Session info: headless chrome=105.0.5195.125)

This error occurs when the punch in/out button is clicked, and then immediately trying to log out.

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.