// suspended: optional bool,
// limited: optional bool,
created_at: String, // FIXME: sort out dates!
- last_status_at: String,
+ last_status_at: String, // FIXME: sort out dates!
statuses_count: u64,
followers_count: u64,
following_count: u64,
}
+#[derive(Serialize, Deserialize, Debug)]
+struct Status {
+ id: String,
+ uri: String,
+ created_at: String, // FIXME: sort out dates!
+ account: Account,
+ content: String,
+ visibility: String, // FIXME: enum
+ sensitive: bool,
+ spoiler_text: String,
+ // media_attachments: Vec<Media>,
+ // application: optional Application,
+ // mentions: Vec<Mention>,
+ // tags: Vec<Hashtag>,
+ // emojis: Vec<Emoji>,
+ reblogs_count: u64,
+ favourites_count: u64,
+ replies_count: u64,
+ url: String,
+ // in_reply_to_id: optional String,
+ // in_reply_to_account_id: optional String,
+ // reblog: optional Status (!),
+ // poll: optional Poll,
+ // card: optional PreviewCard,
+ // language: optional String,
+ // text: optional String,
+ // edited_at: optional String, // FIXME actually a date
+ // favourited: optional bool,
+ // reblogged: optional bool,
+ // muted: optional bool,
+ // bookmarked: optional bool,
+ // pinned: optional bool,
+ // filtered: optional bool,
+}
+
fn main() {
let body = reqwest::blocking::get(
"https://hachyderm.io/api/v1/accounts/111096602447828617")
.unwrap().text().unwrap();
let acc: Account = serde_json::from_str(&body).unwrap();
dbg!(acc);
+
+ let body = reqwest::blocking::get(
+ "https://hachyderm.io/api/v1/statuses/111602135142646031")
+ .unwrap().text().unwrap();
+ let st: Status = serde_json::from_str(&body).unwrap();
+ dbg!(st);
}