Go to file
Francesco Esposito edff30e6c7 Edit username 2020-03-01 23:30:43 +01:00
.eslintrc.json npm and lint init 2019-02-19 14:01:46 +01:00
.gitignore add .gitignore 2019-02-19 13:46:12 +01:00
LICENSE Initial commit 2019-02-12 23:03:15 +01:00
README.md Edit username 2020-03-01 23:30:43 +01:00
api.js fix error handling 2019-03-04 20:07:46 +01:00
architecture.png edit README 2019-03-04 16:40:53 +01:00
auth.js simple auth 2019-02-20 17:49:12 +01:00
config.json change logger configuration 2019-02-22 11:36:48 +01:00
logger.js add logger 2019-02-21 14:54:06 +01:00
package-lock.json Merge pull request #2 from frsposito/dependabot/npm_and_yarn/js-yaml-3.13.1 2019-11-03 10:44:58 +01:00
package.json Edit username 2020-03-01 23:30:43 +01:00
screenshot.png fix readme 2019-07-23 22:08:08 +02:00
server.js fix error handling 2 2019-03-04 20:10:47 +01:00
templates.js Edit username 2020-03-01 23:30:43 +01:00
utils.js add PositionNotFound 2019-02-23 23:21:39 +01:00

README.md

trackmyd-bot

A telegram bot to track your devices.

This bot is written in Node.js

Architecture

trackmyd-bot uses the trackmyd-api project APIs to get device locations.

To configure the server, refer to the trackmyd-api repository.

In order to use trackmyd-bot, in addiction to the configuration of the trackmyd-api, its also necessary to configure GPSLogger, an open-source application that allows sending location through HTTP calls.

Usage

Before requesting the position to the bot you need to add a new device and configure it.

  1. Add a new device.

    Send the /add command to the bot. You will be prompted to add the device name.

  2. Configure GPSLogger on Android.

    Once confirmed the device name, the bot will return 3 messages:

    • URL (full-path including the device ID)
    • HEADER (HTTP header, used for authentication to APIs)
    • BODY (HTTP body with the parameters that will be automatically evaluated by GPSLogger).

    Take the values and insert them in the GPSLogger app under "Logging details > Log to custom URL" specifying HTTP Method = 'PATCH'.

    Then press "Start Logging" on GPSLogger.

  3. Request the position at the bot

    Send the /position command to the bot and select the device. If the device (with GPSLogger) has sent the information to the API, 2 messages will be returned (one with the location on the map, and one with additional information).

Installation

Step by step

  1. Install NodeJS and NPM.
  2. Clone this repository.
  3. Install dependencies with npm install.
  4. Create a new bot with BotFather on Telegram
  5. Enter the token generated by BotFather in (app.token) into config.json.
  6. Enter your Telegram ID in (app.authorizedUsers) into config.json.
  7. Configure Basic Authentication in (app.api.headers) into config.json.
  8. Start with npm start.

License

GPLv3


Made with ❤️ by Francesco Esposito (@franjsco)