A Pythonic interface for building IFTTT plugins routed over email.
Project description
# ifttt
helpers for connecting [IFTTT](http://ifttt.com) with any other service via `email`
## what?
[IFTTT](http://ifttt.com) provides an interface to an amazing number of services, but since they
lack their own API and have a close submission process, it's difficult to integrate it into
your applications.
By creating a set of transformations for routing IFTTT channels to email,
we can pass structured data to custom callback functions – `ifthis` – or listen to other services and send emails which can be processed by IFTTT - `thenthat`.
## dependencies
Our implementation is written and native python 2.7 and has no dependencies.
## examples
### If This ...
```python
from ifttt import ifthis
from ifttt import util
import os
pattern = pattern = {
"user_name": "{{UserName}}",
"published": "{{CreatedAt}}",
"short_url": "{{LinkToTweet}}",
"text": "{{Text}}"
}
@ifthis('twitter', pattern=pattern)
def twitter(msg):
util.stdout(msg)
os.system('say {text}'.format(**msg['body']))
return True
# when we run this script it will listen indefinitely for new messages
# on this routing key
if __name__=="__main__":
twitter()
```
### configuration
export these environmental variables:
```
export IFTTT_USERNAME='username@domain.com'
export IFTTT_PASSWORD='password'
export IFTTT_IMAP_SERVER='mail.domain.com'
export IFTTT_IMAP_PORT=993
export IFTTT_SMTP_SERVER='mail.domain.com'
export IFTTT_SMTP_PORT=587
```
helpers for connecting [IFTTT](http://ifttt.com) with any other service via `email`
## what?
[IFTTT](http://ifttt.com) provides an interface to an amazing number of services, but since they
lack their own API and have a close submission process, it's difficult to integrate it into
your applications.
By creating a set of transformations for routing IFTTT channels to email,
we can pass structured data to custom callback functions – `ifthis` – or listen to other services and send emails which can be processed by IFTTT - `thenthat`.
## dependencies
Our implementation is written and native python 2.7 and has no dependencies.
## examples
### If This ...
```python
from ifttt import ifthis
from ifttt import util
import os
pattern = pattern = {
"user_name": "{{UserName}}",
"published": "{{CreatedAt}}",
"short_url": "{{LinkToTweet}}",
"text": "{{Text}}"
}
@ifthis('twitter', pattern=pattern)
def twitter(msg):
util.stdout(msg)
os.system('say {text}'.format(**msg['body']))
return True
# when we run this script it will listen indefinitely for new messages
# on this routing key
if __name__=="__main__":
twitter()
```
### configuration
export these environmental variables:
```
export IFTTT_USERNAME='username@domain.com'
export IFTTT_PASSWORD='password'
export IFTTT_IMAP_SERVER='mail.domain.com'
export IFTTT_IMAP_PORT=993
export IFTTT_SMTP_SERVER='mail.domain.com'
export IFTTT_SMTP_PORT=587
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ifttt-0.0.1.tar.gz
(4.5 kB
view details)
Built Distribution
File details
Details for the file ifttt-0.0.1.tar.gz
.
File metadata
- Download URL: ifttt-0.0.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f6673a175afb8ba477dc8346bb8d03f04af3c5b7a10377e0e2fb8a379af7375 |
|
MD5 | 3d4b2c80c41ecce23ba567e1eacf6afa |
|
BLAKE2b-256 | 92706b904aa96ae39452f4139acd29034af508ec030d055b9d5ed695eed8c3af |
File details
Details for the file ifttt-0.0.1.macosx-10.10-intel.exe
.
File metadata
- Download URL: ifttt-0.0.1.macosx-10.10-intel.exe
- Upload date:
- Size: 68.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f030ba3e1eb5ed30b85f211b2d027a8f0df9b249c46ba01870a6f1925537813c |
|
MD5 | 5466c52191cf87300ba6c8f48129eef1 |
|
BLAKE2b-256 | 77f89df69d16bcbee96381212008488cbc8c3651c7b1d5ca838e93f1612608fe |