Giter VIP home page Giter VIP logo

factorialautoclock's Introduction

Factorial Auto Clock

A selenium bot for clocking in or out in factorialhr.com.

How does it work

The selenium will go to the login page of Factorial and login with the credentials of data.json. After that it will stop interacting with the interface and send requests to the Factorial API to clock in and out. There is no need to tell the system if it needs to clock in or out because it will ask Factorial if there is one work shift currently clocked in, if there is it will clock out and if there isn't one it will clock in.

Setup

The first requirement is to have node installed in your system, so it isn't installed go to their webpage and install it.

Right now the system only works with Firefox so to use it you need to install a version of it and add geckodriver to your system path.

  1. Download Firefox from their official site.

  2. Download the latest geckodriver version from its github.

  3. Add the geckodriver to the system PATH.

Now in order to the Selenium to use your account you have to introduce your credentials in the data.json file. Like for example:

{
  "user": {
    "email": "[email protected]",
    "password": "mysupersecurepassword"
  }
}

Once all of that is done you have to install the dependencies with npm install, now that everything is prepared you just need to launch it with node ..

CLI options

The program is pretty simple, but it has two arguments that can be passed to modify some things.

-p will run the program with a random stop from 3 to 7 minutes before clocking in or out. It is done that way because so you don't file your shift at the same time every day.

-h will run the program in headless mode so it doesn't open a browser window when it is going to file a shift.

Example

I run the program for all my shifts in an ubuntu system so I have it on a crontab. My shifts are from 09:00-14:30 and from 15:30 to 18:30 from Monday to Thursday and from 08:30-14:00 on Fridays so my crontab goes like:

0 9 * * 1,2,3,4 <path_to_node>/node <path_to_program>/index.mjs -h
30 14 * * 1,2,3,4  <path_to_node>/node <path_to_program>/index.mjs -h -p
15 30 * * 1,2,3,4 <path_to_node>/node <path_to_program>/index.mjs -h -p
18 30 * * 1,2,3,4 <path_to_node>/node <path_to_program>/index.mjs -h -p

30 8 * * 5 <path_to_node>/node <path_to_program>/index.mjs -h
30 14 * * 5  <path_to_node>/node <path_to_program>/index.mjs -h -p

factorialautoclock's People

Contributors

alexgplay avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

balves42

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.