9 个版本
0.2.5 | 2022 年 9 月 5 日 |
---|---|
0.2.4 | 2022 年 9 月 5 日 |
0.2.0 | 2022 年 8 月 25 日 |
0.1.1 | 2022 年 8 月 11 日 |
0.0.0 | 2022 年 8 月 11 日 |
#19 在 #send-notifications
用于 prowl-queue
12KB
126 行
Prowl Rust API
一个围绕 Prowl API 的库。这是 PushBullet 或 PushOver 等产品的替代品,采用一次性付费而不是基于订阅的模型。其他优点包括能够设置通知优先级以及每小时 1,000 次API调用的慷慨默认值,并可选择允许列表以获取更多。
示例
从 https://www.prowlapp.com/ 获取您的 Prowl API 密钥后。您可以开始向您登录的设备发送通知,
从 examples/add.rs
let ice_cube_reciepe = "".to_owned()
+ "Empty the ice cubes that are left in the trays (if there are any left) into the bin."
+ "Take the trays over to the sink and fill them with cold water. (Hot water will freeze faster and more clear)."
+ "Place the water filled ice trays back in the freezer."
+ "Replace the ice bin if you had to remove it."
+ "Shut the door to the freezer."
+ "Be sure to leave for around 4-6 hours at least to make sure it is frozen."
+ "If you want to experiment, you can freeze things like fruit infused waters or juices."
+ "\n\n"
+ "from https://www.food.com/recipe/ice-cubes-420398";
let notification_description = format!("The automated system has detected low ice cube count. Please order or make more! The reciepe is as follows:\n\n{ice_cube_reciepe}");
let notification = prowl::Notification::new(
vec!["REPLACE-ME-WITH-YOUR-PROWL-API-KEY".to_string()],
Some(prowl::Priority::VeryLow),
Some("https://www.food.com/recipe/ice-cubes-420398".to_string()),
"My Rust Sample".to_string(),
"Low Ice Cubes".to_string(),
notification_description,
)
.expect("Invalid notification");
notification
.add()
.await
.expect("Failed to send notification");
依赖项
~3–15MB
~220K SLoC