mirror of
https://framagit.org/veretcle/oolatoocs.git
synced 2025-07-20 20:41:17 +02:00
feat: add #NoTweet to skip toot from being tweeted
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -972,7 +972,7 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oolatoocs"
|
name = "oolatoocs"
|
||||||
version = "1.3.1"
|
version = "1.4.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"env_logger",
|
"env_logger",
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "oolatoocs"
|
name = "oolatoocs"
|
||||||
version = "1.3.1"
|
version = "1.4.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
@@ -36,6 +36,12 @@ pub async fn run(config: &Config) {
|
|||||||
.unwrap_or_else(|e| panic!("Cannot get instance: {}", e));
|
.unwrap_or_else(|e| panic!("Cannot get instance: {}", e));
|
||||||
|
|
||||||
for toot in timeline {
|
for toot in timeline {
|
||||||
|
// detecting tag #NoTweet and skipping the toot
|
||||||
|
if toot.tags.iter().any(|f| &f.name == "notweet") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// form tweet_content and strip everything useless in it
|
||||||
let Ok(mut tweet_content) = strip_everything(&toot.content, &toot.tags) else {
|
let Ok(mut tweet_content) = strip_everything(&toot.content, &toot.tags) else {
|
||||||
continue; // skip in case we can’t strip something
|
continue; // skip in case we can’t strip something
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user