Giter VIP home page Giter VIP logo

automin's Introduction

automin

A personal node project to enable webhooks between different services. Conforms the webhooks to the outbound apis. In this early stage only working with Rescuetime and Amazing Marvin.

Installation

Clone this repo then run npm run build followed by npm start. (Note: You will need to rebuild the project and update your webhook calls in Amazing Marvin).

Usage

Run from the directory of the app using npm start. It will either take a command line argument, an environment variable $PORT or will default to port 80.

Local Mode

If you'd like to specify a port please specify it as an argument npm start #portnum. If you use this method your url will be http://localhost:portnum where portnum is the port you chose. Be aware that using this method will only allow amazing marvin's timers to call rescuetime from the same device you run the server on. You need to host the code remotely in order to run it from a mobile device. Heroku, Google Cloud, Azure, etc are all viable options here.

NOTE: running in local mode may cause issues with safari and the marvin desktop app.

Heroku

The package has been updated to work seamlessly with heroku. Currently it now supports quick deployment to heroku as well as support for enabling a secure mode. Follow the instructions here to deploy to git.

Enabling Secure Mode for Heroku

Please use the command $>heroku config:set SECURE=true to enable secure mode. This will require use of an api key for all future requests. Run npm run cycle-key to generate a new api key and upload the hashed one your heroku app. You will find the api-key generated into the keyfile in the package directory. To enable it for Amazing Marvin, make sure you add the header Automin-API-Key: %keygoeshere% to your header requests for webhooks.

Setting Up Amazing Marvin to call Rescuetime

You will need to enable the API strategy. Once you have the server running you will need webhooks for each of the possible timer settings. The following settings can be used as a template. The phrase https://yourUrlHere is where you would paste either localhost if utilizing it locally or the url of the hosted server. You will then need to get your API key from rescuetime here.

Call Event Call Type URL Header 1 Header 2
Add Timer POST https://yourURLHere/rescue_time_start Content-Type: application/json X-Api-Key: yourAPIKey
Pause Timer POST https://yourURLHere/rescue_time_end Content-Type: application/json X-Api-Key: yourAPIKey
Resume Timer POST https://yourURLHere/rescue_time_start Content-Type: application/json X-Api-Key: yourAPIKey
Delete Timer POST https://yourURLHere/rescue_time_end Content-Type: application/json X-Api-Key: yourAPIKey
Timer Done POST https://yourURLHere/rescue_time_end Content-Type: application/json X-Api-Key: yourAPIKey

Current Limitations

The local version has a lot of issues with the desktop version of Amazing Marvin, and the web version in Safari. For now these are considered unsupported platforms when runnng the server locally. Firefox is recommended.

The other major limitation is an api limitation from Rescuetime. Specifically, the api only works on multiples of 5. If you get a timer smaller then five we strongly reccomend leaving it on until your session ends, if only to prevent issues w/ synchronization later.

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.