From 0852f616ad3ed2abb8a170012257acaed253b4a6 Mon Sep 17 00:00:00 2001 From: syui Date: Sat, 17 Aug 2024 10:32:12 +0000 Subject: [PATCH] =?UTF-8?q?atproto=20=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- atproto.md | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/atproto.md b/atproto.md index 0fdf916..ebc6954 100644 --- a/atproto.md +++ b/atproto.md @@ -92,36 +92,9 @@ $ cat ~/.config/ai/token.toml|dasel -r toml host > feed = at://did:plc:4hqjfn7m6n5hno3doamuhgef/app.bsky.feed.generator/cmd -```rust +```sh // 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; - } - } -} +token=`cat ~/.config/ai/token.json|jq -r .accessJwt` +url=at://did:plc:4hqjfn7m6n5hno3doamuhgef/app.bsky.feed.generator/cmd +curl -sL "https://public.api.bsky.app/xrpc/app.bsky.feed.getFeed?feed=$url" -H "Authorization: Bearer $token" ``` \ No newline at end of file