• This repository has been archived on 29/Dec/2022
  • Stars
    star
    348
  • Rank 121,840 (Top 3 %)
  • Language
    JavaScript
  • Created over 7 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Middleware for IFTTT.

TTTFI

npm

Middleware for IFTTT.

Usage

TTTFI picks up data from IFTTT webhook, pass data through scripts and send output of script back to IFTTT.

STEP1 Prepare scripts:

Let's write a simple hello world in shell (you can find that in samples folder).

#!/bin/sh

# Read body from stdin
read NAME

# Print response to IFTTT
cat << EOF
{"value1": "Hello, $NAME!"}
EOF

STEP2 Run docker image:

docker run -e API_KEY=<your-ifttt-key> \
           -e SECRET_TOKEN=<secret-token> \
           -v `pwd`/samples:/opt/bin \
           -p 3001:3001 \
           --name tttfi \
           kamikat/tttfi

NOTE: Pick up a random string as your SECRET_TOKEN.

STEP3 Setup trigger:

  1. Create a webhook trigger https://ifttt.com/create/if-maker_webhooks?sid=1
  2. Set Event Name to hello (name of the script)
  3. Choose any action service
  4. Click Add ingredient and select Value1 on any field of the service that supports it

Test your configuration by sending some data using curl

echo 'world' | curl -XPOST -d- https://your-domain.com/hello/secret/<secret-token>

STEP4 Setup action:

  1. Create trigger with any service https://ifttt.com/create (Telegram for example)
  2. Choose Webhooks service to create an action
  3. Set the url (for example https://your-domain.com/hello/secret/<secret-token>)
  4. Set Method to POST and Content Type to text/plain (the hello event requires simple text)
  5. Add any ingredient to body

Scripting with Python/Perl/Go...

Scripts written in python or other platform can failed to start because they're not installed in container.

Add required package after start the container:

docker exec tttfi apk --no-cache add <package-name>

Or run tttfi natively (see next section)

Native server

TTTFI can run natively on *nix with ES6 compatible Node.js.

npm install -g tttfi

Run TTTFI:

PATH=<path-to-scripts>:$PATH API_KEY=<your-ifttt-key> SECRET_TOKEN=<secret-token> tttfi

Be careful that it executes ANYTHING in your $PATH with correct secret token.

License

(The MIT License)

More Repositories

1

bilibili-get

Bilibili video downloader.
JavaScript
185
star
2

moshi-jsonapi

JSON API v1.0 Specification in Moshi.
Java
156
star
3

jekyll-theme-kagami

Simple and clean Jekyll theme compatible with GitHub Pages.
SCSS
150
star
4

toast-compat

Toast notification polyfill.
Java
56
star
5

52g

Index leaked password data with bloom filter.
C++
50
star
6

cpktools

cpk file tools and text extraction tools for translation works on ε‚γ‚γŒγ‚Šγƒγƒͺケーン
Python
49
star
7

onscripter

Mirror of onscripter by ogapee
C++
32
star
8

feedo

RSS reader for automation.
Python
18
star
9

flvcopycat

Joining flv files with same options (normally splitted by video sites) together losslessly
Python
18
star
10

bilibili-playurl

Get playurl from cid.
JavaScript
16
star
11

co-router

Benefit from generator on express router.
JavaScript
11
star
12

o3o_bot

Kaomoji on Telegram Bot API
Go
11
star
13

ping-chart

Ping statistics in ASCII chart.
Shell
10
star
14

openwrt-dirtydns

Simple DNS forwarder for OpenWRT.
Shell
8
star
15

ONScripter-SAO

Android Based UI Product take SAO(Animation) as prototype
C
6
star
16

XGIMI-Z6-Polar-Toybox

Customize XGIMI Z6 Polar (synsepalum_R) device.
Shell
5
star
17

abt

BitTorrent workflow with aria2.
Python
5
star
18

fontconfig

fontconfig configuration
5
star
19

vimrc

My $HOME/.vim with Git & Pathogen
Vim Script
5
star
20

mm.io

Simple demonstration of MVP with Dagger2/Android Data Binding Library and RxJava
Java
4
star
21

OreoTintRemover

Remove annoying color tint from lock-screen and notification background.
Java
4
star
22

DidiTech2016

Solution to DidiTech2016 problem using Random Forest.
Python
4
star
23

Courier-Typewritter-Fonts

Monospace font based on Courier 10 Pitch by thynson
4
star
24

dagger2-android-example

IoC on Android done right with Dagger2.
Java
4
star
25

squel-sugar

Several syntactic sugar extension to https://hiddentao.github.io/squel/ API
JavaScript
3
star
26

kisstudou

Project to download and auto convert web video from tudou,youku,bilibili
Python
3
star
27

onscripter-cn

onscripter for android forked from natdon-san
C
2
star
28

docker-wine-py

Python 2.7 for Windows in Docker.
1
star
29

iona

Lightweight library for creating interactive docs.
JavaScript
1
star
30

haskell-trains

Solutions to Haskell problems on Codewars.
Haskell
1
star
31

grunt-boilerplate

Boilerplate for grunt based frontend(f2e) workflow
JavaScript
1
star
32

onscripter_android

C
1
star
33

octrello

Integrate Trello with GitHub.
JavaScript
1
star
34

mxnet-onbuild

Automated MXNet build.
Shell
1
star