Skip to main content

A Pythonic interface for building IFTTT plugins routed over email.

Project description

# ifttt (If That Then This)
`ifttt` is a simple package for connecting [IFTTT](http://ifttt.com)
channels with your service via and email inbox.

## what?

[IFTTT](http://ifttt.com) provides an interface to an amazing number of services, but since they
lack their own API and have a closed 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 email-listener functions – `ifthat`
which can be routed to an arbitrary `thenthis` function that a user defines.

## installation / dependencies

```
pip install ifttt
```

Our implementation is written and native python 2.7 and has no dependencies.

## examples

### If That Then Say Tweet ...

```python
from ifttt import ifthat

@ifthat('twitter', pattern = "{{UserName}}|||||{{LinkToTweet}}|||||{{Text}}|||||")
def twitter(msg):
import os
os.system('tweet from {text}'.format(**msg['body']))

for msg in twitter():
print msg
```

### If This Then Say YO

```python
from ifttt import ifthat

@ifthat('yo', pattern="{{ReceivedAt}}|||||{{From}}|||||")
def then_yo(msg):
import os
os.system('say yo from {from} &'.format(**msg['body']))
return msg

for msg in yo():
print msg
```

## Configuration

export these environmental variables:

```bash
export IFTTT_USERNAME='username@domain.com'
export IFTTT_PASSWORD='password'
export IFTTT_IMAP_SERVER='mail.domain.com'
export IFTTT_IMAP_PORT=993
```

## TODO
- [ ] Delete Messages

Project details


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.1.1.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

ifttt-0.1.1.macosx-10.10-intel.exe (70.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page