Coder Social home page Coder Social logo

4pm-cli's Introduction

4pm-cli

About

Use terminal to enter your 4pm reports http://www.4pm.si/.

Using Phantom headless web-browser (http://phantomjs.org/) to simulate user behaviour, from login to entering daily work reports.

This command line utility enables you to enter reports through terminal, or automate whole process (or part of it) using configuration file (or command line arguments).

Installation

Prerequisite: NPM (https://docs.npmjs.com/getting-started/installing-node)

npm install -g 4pm-cli

Usage

  • There are no sanity checks, so if you are stupid, the thing can blow-up your computer.
  • Or at least you can end up with strange reports in 4pm (you have been warned).

To run this utility, simply type (and follow steps to enter your report)

$ 4pm

[4PM-CLI] Enter 4pm url: <url>
[4PM-CLI] Enter username: <me>
[4PM-CLI] Enter password: <passing>


* Logged in as Me AllMighty

0) Project 1
1) Project 2
[4PM-CLI] Choose project: 0

0) Task 1
1) Task 2
[4PM-CLI] Choose task: 1

... (and so on) ...

or if you are a bit smarter (use arguments or env variables)

4pm --username <name> --password <pass>

or even better (use conf file)

4pm --conf <conf.json>

where conf.json is (if property is present, program will not ask you for it)

{
  "website": "",
  "username": "",
  "password": "",

  "project":"",
  "task":"",
  "start":"",
  "end":"",
  "duration":"",
  "description":"",
  "commit":"",
  "another":"n"
}

So to make your life easier (only for brave ones -- not recomnended!), you create a cron job

crontab -e

30 4 * * * 4pm --conf ~/4pm-conf.json

where conf file is (behold the %today% placeholder)

{
  "website": "<4pm login site>",
  "username": "<me>",
  "password": "<passing>",

  "project":"0",
  "task":"0",
  "start":"%today%",
  "end":"%today%",
  "duration":"7:30",
  "description":"Working very very hard...",
  "commit":"Y",
  "another":"n"
}

License

BEER-WARE

/*
----------------------------------------------------------------------------
"THE BEER-WARE LICENSE" (Revision 42):
<jurepolutnik> wrote this thing.  As long as you retain this notice you
 can do whatever you want with this stuff. If we meet some day, and you think
 this stuff is worth it, you can buy me a beer in return.   
 ----------------------------------------------------------------------------
 */

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.