Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leodutra/ifttt-webhook
Simple async library for triggering IFTTT events using webhooks.
https://github.com/leodutra/ifttt-webhook
api api-client ifttt ifttt-maker ifttt-makerwebhooks ifttt-webhooks zapier
Last synced: 1 day ago
JSON representation
Simple async library for triggering IFTTT events using webhooks.
- Host: GitHub
- URL: https://github.com/leodutra/ifttt-webhook
- Owner: leodutra
- License: mit
- Created: 2020-11-09T22:48:55.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-06-23T19:37:52.000Z (over 1 year ago)
- Last Synced: 2024-10-13T12:29:50.891Z (about 1 month ago)
- Topics: api, api-client, ifttt, ifttt-maker, ifttt-makerwebhooks, ifttt-webhooks, zapier
- Language: Rust
- Homepage: https://ifttt.com/maker_webhooks
- Size: 8.79 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# IFTTT Webhook
[![crate.io](https://img.shields.io/crates/v/ifttt-webhook)](https://crates.io/crates/ifttt-webhook)
A simple Rust async library for triggering IFTTT events using webhooks.
## Installation
Installation can be performed using [`cargo add`](https://github.com/killercup/cargo-edit):
```sh
cargo add ifttt-webhook
```## Usage
```rust
use ifttt_webhook::IftttWebhook;
use std::collections::HashMap;// IFTTT Webhook key, available under "Documentation"
// at https://ifttt.com/maker_webhooks/.
let ifttt_key = 'your_ifttt_webhook_key';let webhook = IftttWebhook {
key: ifttt_key,
event: "event_name",
};// this will trigger a GET to https://maker.ifttt.com/trigger/{event}/with/key/{key}
webhook.trigger(None).await;
```The `.trigger` method can be used to pass values as shown in the example below:
```rust
use ifttt_webhook::IftttWebhook;// IFTTT Webhook key, available under "Documentation"
// at https://ifttt.com/maker_webhooks/.
let ifttt_key = 'your_ifttt_webhook_key';let mut values = HashMap::new();
values.insert("value1", "value_1_test_value");
values.insert("value2", "value_2_test_value");
values.insert("value3", "value_3_test_value");let webhook = IftttWebhook {
key: ifttt_key,
event: "event_name",
};// this will trigger a POST to https://maker.ifttt.com/trigger/{event}/with/key/{key}
webhook.trigger(Some(&values)).await;
```## Bugs and feedback
If you discover a bug please report it [here](https://github.com/leodutra/ifttt-webhook/issues/new).
Express gratitude [here](https://patreon.com/leodutra).Mail me at [email protected], or on twitter [@leodutra](http://twitter.com/leodutra).
## License
MIT @ [Leo Dutra](https://github.com/leodutra)