check feed watch cid
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
This commit is contained in:
parent
84efc31248
commit
14ca1bcdee
@ -1,9 +1,9 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ai"
|
name = "ai"
|
||||||
authors = ["syui"]
|
authors = ["syui"]
|
||||||
version = "0.0.1"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "latest@2024-08-04"
|
description = "latest@2024-08-18"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
seahorse = "*"
|
seahorse = "*"
|
||||||
|
@ -5,6 +5,8 @@ use crate::feed_get;
|
|||||||
|
|
||||||
use crate::data::data_toml;
|
use crate::data::data_toml;
|
||||||
use crate::data::Timeline;
|
use crate::data::Timeline;
|
||||||
|
use crate::data::log_file;
|
||||||
|
use crate::data::w_cid;
|
||||||
|
|
||||||
pub fn c_feed_watch(c: &Context) {
|
pub fn c_feed_watch(c: &Context) {
|
||||||
let mut feed = "at://did:plc:4hqjfn7m6n5hno3doamuhgef/app.bsky.feed.generator/cmd".to_string();
|
let mut feed = "at://did:plc:4hqjfn7m6n5hno3doamuhgef/app.bsky.feed.generator/cmd".to_string();
|
||||||
@ -29,14 +31,14 @@ pub fn c_feed_watch(c: &Context) {
|
|||||||
let length = &n.len();
|
let length = &n.len();
|
||||||
let su = 0..*length;
|
let su = 0..*length;
|
||||||
for i in su {
|
for i in su {
|
||||||
|
let cid = &n[i].post.cid;
|
||||||
|
let check_cid = w_cid(cid.to_string(), log_file(&"n1"), false);
|
||||||
let handle = &n[i].post.author.handle;
|
let handle = &n[i].post.author.handle;
|
||||||
let did = &n[i].post.author.did;
|
let did = &n[i].post.author.did;
|
||||||
let cid = &n[i].post.cid;
|
|
||||||
let uri = &n[i].post.uri;
|
let uri = &n[i].post.uri;
|
||||||
let _time = &n[i].post.indexedAt;
|
let _time = &n[i].post.indexedAt;
|
||||||
let cid_root = cid;
|
let cid_root = cid;
|
||||||
let uri_root = uri;
|
let uri_root = uri;
|
||||||
|
|
||||||
let mut text = "";
|
let mut text = "";
|
||||||
if !n[i].post.record.text.is_none() {
|
if !n[i].post.record.text.is_none() {
|
||||||
text = &n[i].post.record.text.as_ref().unwrap();
|
text = &n[i].post.record.text.as_ref().unwrap();
|
||||||
@ -56,17 +58,18 @@ pub fn c_feed_watch(c: &Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if prompt.is_empty() == false || com.is_empty() == false {
|
if check_cid == false && { prompt.is_empty() == false || com.is_empty() == false } {
|
||||||
println!("{}", handle);
|
println!("{}", handle);
|
||||||
|
|
||||||
if c.bool_flag("debug") == true {
|
if c.bool_flag("debug") == true {
|
||||||
println!(
|
println!(
|
||||||
"cid:{}\nuri:{}\ncid_root:{}\nuri_root:{}\nhost:{}\ndid:{}",
|
"cid:{}\nuri:{}\ncid_root:{}\nuri_root:{}\nhost:{}\ndid:{}\ncheck_cid:{}",
|
||||||
cid, uri, cid_root, uri_root, host, did
|
cid, uri, cid_root, uri_root, host, did, check_cid
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
println!("{}", prompt_sub);
|
println!("{}", prompt_sub);
|
||||||
println!("---");
|
println!("---");
|
||||||
|
w_cid(cid.to_string(), log_file(&"n1"), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user