A lightweight web service for receiving your Snapmatic pictures and sharing them in your Telegram group in real-time.
When the server is started and the Telegram credentials are configured, one endpoint is exposed for listening to Snapmatic pictures. They are expected to come as form-data
filetype.
Here is an example curl
for testing purposes:
$ curl -F "file=@/somedir/somepic.jpg" localhost:3000/picture -XPOST
Once a new picture is received and properly processed, it's sent as a JPG
file to your Telegram bot.
- Install dependencies
$ sudo npm install -g typescript@latest
$ npm install
- Fill the config.ts file with the following information:
TG_API_KEY
: Telegram bot API Key.TG_CHAT_ID
: Telegram chat ID.
You can also set the values by environment variables.
- Start the server:
$ npm start
Alternatively, you may want to run it using Docker:
$ docker build -t "snapmatic"
$ docker run --rm -it -p 3000:3000/tcp snapmatic:latest
- @manuasir (author)
- @jesusgn90 (contributor)