|
@@ -1,3 +1,4 @@
|
|
|
|
+use core::panic;
|
|
use std::borrow::Borrow;
|
|
use std::borrow::Borrow;
|
|
|
|
|
|
use macroquad::prelude::{error, Texture2D};
|
|
use macroquad::prelude::{error, Texture2D};
|
|
@@ -12,10 +13,11 @@ pub fn get_client() -> Result<blocking::Client, Box<dyn std::error::Error>> {
|
|
}
|
|
}
|
|
|
|
|
|
pub fn request_posts(tag: &str) -> Result<api::GetPostsResponse, Box<dyn std::error::Error>> {
|
|
pub fn request_posts(tag: &str) -> Result<api::GetPostsResponse, Box<dyn std::error::Error>> {
|
|
- let request_addr = String::from("https://mastodon.technology/api/v1/timelines/tag/")
|
|
|
|
- + tag.trim_start_matches("#");
|
|
|
|
|
|
+ let request_addr =
|
|
|
|
+ String::from("https://mastodon.social/api/v1/timelines/tag/") + tag.trim_start_matches("#");
|
|
let resp = get_client()?.get(request_addr).send();
|
|
let resp = get_client()?.get(request_addr).send();
|
|
- // pritln!("{:#?}", resp);
|
|
|
|
|
|
+ // panic!("{:?}", resp.expect("ff"));
|
|
|
|
+
|
|
let result = resp
|
|
let result = resp
|
|
.expect("sending failed")
|
|
.expect("sending failed")
|
|
.json::<api::GetPostsResponse>()
|
|
.json::<api::GetPostsResponse>()
|