Compare commits
4 Commits
4219b1d5d8
...
cda9f86b92
Author | SHA1 | Date | |
---|---|---|---|
|
cda9f86b92 | ||
|
36bda1e89f | ||
|
3baaf86132 | ||
|
01822e79bb |
1672
Cargo.lock
generated
1672
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,7 @@ edition = "2021"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
chrono = "0.4.26"
|
chrono = "0.4.26"
|
||||||
reqwest = { version ="0.11.18", features = ["json"]}
|
reqwest = { version ="0.11.18", features = ["json"]}
|
||||||
tokio = { version = "1" }
|
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
|
||||||
serde = { version = "1.0.104", features = ["derive"] }
|
serde = { version = "1.0.104", features = ["derive"] }
|
||||||
serde_json = "1.0.48"
|
serde_json = "1.0.48"
|
||||||
lemmy_api_common = "0.18.1"
|
lemmy_api_common = "0.19.3"
|
||||||
|
@ -55,19 +55,19 @@ async fn post_to_lemmy(
|
|||||||
)
|
)
|
||||||
.as_ref(),
|
.as_ref(),
|
||||||
)?;
|
)?;
|
||||||
println!("{}", title);
|
println!("Using title: {}", title);
|
||||||
|
|
||||||
let params = CreatePost {
|
let params = CreatePost {
|
||||||
community_id,
|
community_id,
|
||||||
name: title,
|
name: title,
|
||||||
url: Some(url),
|
url: Some(url),
|
||||||
body: Some("Post your results and discuss your guesses. Have fun! \nNote: there might be spoilers in the thread.".to_owned()),
|
body: Some("Post your results and discuss your guesses. Have fun! \nNote: there _will_ be spoilers in the thread, so try it first.".to_owned()),
|
||||||
auth,
|
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
let response = client
|
let response = client
|
||||||
.post(helper::api_url("post"))
|
.post(helper::api_url("post"))
|
||||||
|
.header("Authorization", "Bearer ".to_owned() + &auth)
|
||||||
.json(¶ms)
|
.json(¶ms)
|
||||||
.send()
|
.send()
|
||||||
.await?;
|
.await?;
|
||||||
@ -94,6 +94,7 @@ async fn get_latest_post(
|
|||||||
client: &Client,
|
client: &Client,
|
||||||
user: &Sensitive<String>,
|
user: &Sensitive<String>,
|
||||||
) -> Result<Option<Post>, Box<dyn std::error::Error>> {
|
) -> Result<Option<Post>, Box<dyn std::error::Error>> {
|
||||||
|
println!("Checking if already posted...");
|
||||||
let params = GetPersonDetails {
|
let params = GetPersonDetails {
|
||||||
username: Some(user.to_string()),
|
username: Some(user.to_string()),
|
||||||
sort: Some(SortType::New),
|
sort: Some(SortType::New),
|
||||||
|
Loading…
Reference in New Issue
Block a user