atproto を更新
parent
e12f9e36ee
commit
61e4a20773
40
atproto.md
40
atproto.md
@ -84,4 +84,44 @@ archlinux
|
||||
```sh
|
||||
$ cat ~/.config/ai/token.toml|dasel -r toml host
|
||||
'syu.is'
|
||||
```
|
||||
|
||||
## feed
|
||||
|
||||
- https://feed.syu.is/xrpc/app.bsky.feed.getFeedSkeleton?feed=at://did:plc:4hqjfn7m6n5hno3doamuhgef/app.bsky.feed.generator/cmd
|
||||
|
||||
> feed = at://did:plc:4hqjfn7m6n5hno3doamuhgef/app.bsky.feed.generator/cmd
|
||||
|
||||
```rust
|
||||
// https://docs.bsky.app/docs/api/app-bsky-feed-get-feed
|
||||
extern crate reqwest;
|
||||
use crate::data_refresh;
|
||||
use crate::url;
|
||||
|
||||
pub async fn get_request(feed: String) -> String {
|
||||
let token = data_refresh(&"access");
|
||||
let url = url(&"feed_get");
|
||||
let feed = feed.to_string();
|
||||
|
||||
let client = reqwest::Client::new();
|
||||
let res = client
|
||||
.get(url)
|
||||
.query(&[("feed", feed)])
|
||||
.header("Authorization", "Bearer ".to_owned() + &token)
|
||||
.send()
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let status_ref = res.error_for_status_ref();
|
||||
|
||||
match status_ref {
|
||||
Ok(_) => {
|
||||
return res.text().await.unwrap();
|
||||
}
|
||||
Err(_e) => {
|
||||
let e = "err".to_string();
|
||||
return e;
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
Loading…
Reference in New Issue
Block a user