mirror of https://github.com/mastodon/flodgatt
Testing for Event parsing
This commit is contained in:
parent
d0f9d80674
commit
925fc40435
|
@ -35,3 +35,6 @@ pub enum CheckedEvent {
|
||||||
AnnouncementDelete { payload: String },
|
AnnouncementDelete { payload: String },
|
||||||
Conversation { payload: Conversation, queued_at: Option<i64> },
|
Conversation { payload: Conversation, queued_at: Option<i64> },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod test;
|
||||||
|
|
|
@ -6,45 +6,45 @@ use serde::{Deserialize, Serialize};
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||||
pub(super) struct Account {
|
pub(super) struct Account {
|
||||||
pub id: Id,
|
pub id: Id,
|
||||||
username: String,
|
pub(super) username: String,
|
||||||
pub acct: String,
|
pub acct: String,
|
||||||
url: String,
|
pub(super) url: String,
|
||||||
display_name: String,
|
pub(super) display_name: String,
|
||||||
note: String,
|
pub(super) note: String,
|
||||||
avatar: String,
|
pub(super) avatar: String,
|
||||||
avatar_static: String,
|
pub(super) avatar_static: String,
|
||||||
header: String,
|
pub(super) header: String,
|
||||||
header_static: String,
|
pub(super) header_static: String,
|
||||||
locked: bool,
|
pub(super) locked: bool,
|
||||||
emojis: Vec<Emoji>,
|
pub(super) emojis: Vec<Emoji>,
|
||||||
discoverable: Option<bool>, // Shouldn't be option?
|
pub(super) discoverable: Option<bool>, // Shouldn't be option?
|
||||||
created_at: String,
|
pub(super) created_at: String,
|
||||||
statuses_count: i64,
|
pub(super) statuses_count: i64,
|
||||||
followers_count: i64,
|
pub(super) followers_count: i64,
|
||||||
following_count: i64,
|
pub(super) following_count: i64,
|
||||||
moved: Option<String>,
|
pub(super) moved: Option<String>,
|
||||||
fields: Option<Vec<Field>>,
|
pub(super) fields: Option<Vec<Field>>,
|
||||||
bot: Option<bool>,
|
pub(super) bot: Option<bool>,
|
||||||
source: Option<Source>,
|
pub(super) source: Option<Source>,
|
||||||
group: Option<bool>, // undocumented
|
pub(super) group: Option<bool>, // undocumented
|
||||||
last_status_at: Option<String>, // undocumented
|
pub(super) last_status_at: Option<String>, // undocumented
|
||||||
}
|
}
|
||||||
|
|
||||||
#[serde(deny_unknown_fields)]
|
#[serde(deny_unknown_fields)]
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||||
struct Field {
|
pub(super) struct Field {
|
||||||
name: String,
|
pub(super) name: String,
|
||||||
value: String,
|
pub(super) value: String,
|
||||||
verified_at: Option<String>,
|
pub(super) verified_at: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[serde(deny_unknown_fields)]
|
#[serde(deny_unknown_fields)]
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||||
struct Source {
|
pub(super) struct Source {
|
||||||
note: String,
|
pub(super) note: String,
|
||||||
fields: Vec<Field>,
|
pub(super) fields: Vec<Field>,
|
||||||
privacy: Option<Visibility>,
|
pub(super) privacy: Option<Visibility>,
|
||||||
sensitive: bool,
|
pub(super) sensitive: bool,
|
||||||
language: String,
|
pub(super) language: String,
|
||||||
follow_requests_count: i64,
|
pub(super) follow_requests_count: i64,
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,37 +22,37 @@ use std::string::String;
|
||||||
#[serde(deny_unknown_fields)]
|
#[serde(deny_unknown_fields)]
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||||
pub struct Status {
|
pub struct Status {
|
||||||
id: Id,
|
pub(super) id: Id,
|
||||||
uri: String,
|
pub(super) uri: String,
|
||||||
created_at: String,
|
pub(super) created_at: String,
|
||||||
account: Account,
|
pub(super) account: Account,
|
||||||
content: String,
|
pub(super) content: String,
|
||||||
visibility: Visibility,
|
pub(super) visibility: Visibility,
|
||||||
sensitive: bool,
|
pub(super) sensitive: bool,
|
||||||
spoiler_text: String,
|
pub(super) spoiler_text: String,
|
||||||
media_attachments: Vec<Attachment>,
|
pub(super) media_attachments: Vec<Attachment>,
|
||||||
application: Option<Application>, // Should be non-optional?
|
pub(super) application: Option<Application>, // Should be non-optional?
|
||||||
mentions: Vec<Mention>,
|
pub(super) mentions: Vec<Mention>,
|
||||||
tags: Vec<Tag>,
|
pub(super) tags: Vec<Tag>,
|
||||||
emojis: Vec<Emoji>,
|
pub(super) emojis: Vec<Emoji>,
|
||||||
reblogs_count: i64,
|
pub(super) reblogs_count: i64,
|
||||||
favourites_count: i64,
|
pub(super) favourites_count: i64,
|
||||||
replies_count: i64,
|
pub(super) replies_count: i64,
|
||||||
url: Option<String>,
|
pub(super) url: Option<String>,
|
||||||
in_reply_to_id: Option<Id>,
|
pub(super) in_reply_to_id: Option<Id>,
|
||||||
in_reply_to_account_id: Option<Id>,
|
pub(super) in_reply_to_account_id: Option<Id>,
|
||||||
reblog: Option<Box<Status>>,
|
pub(super) reblog: Option<Box<Status>>,
|
||||||
poll: Option<Poll>,
|
pub(super) poll: Option<Poll>,
|
||||||
card: Option<Card>,
|
pub(super) card: Option<Card>,
|
||||||
pub(crate) language: Option<String>,
|
pub(crate) language: Option<String>,
|
||||||
|
|
||||||
text: Option<String>,
|
pub(super) text: Option<String>,
|
||||||
// ↓↓↓ Only for authorized users
|
// ↓↓↓ Only for authorized users
|
||||||
favourited: Option<bool>,
|
pub(super) favourited: Option<bool>,
|
||||||
reblogged: Option<bool>,
|
pub(super) reblogged: Option<bool>,
|
||||||
muted: Option<bool>,
|
pub(super) muted: Option<bool>,
|
||||||
bookmarked: Option<bool>,
|
pub(super) bookmarked: Option<bool>,
|
||||||
pinned: Option<bool>,
|
pub(super) pinned: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Payload for Status {
|
impl Payload for Status {
|
||||||
|
|
|
@ -2,10 +2,10 @@ use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[serde(deny_unknown_fields)]
|
#[serde(deny_unknown_fields)]
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||||
pub(super) struct Application {
|
pub(in super::super) struct Application {
|
||||||
name: String,
|
pub(super) name: String,
|
||||||
website: Option<String>,
|
pub(super) website: Option<String>,
|
||||||
vapid_key: Option<String>,
|
pub(super) vapid_key: Option<String>,
|
||||||
client_id: Option<String>,
|
pub(super) client_id: Option<String>,
|
||||||
client_secret: Option<String>,
|
pub(super) client_secret: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,21 +2,21 @@ use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[serde(deny_unknown_fields)]
|
#[serde(deny_unknown_fields)]
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||||
pub(super) struct Attachment {
|
pub(in super::super) struct Attachment {
|
||||||
id: String,
|
pub(super) id: String,
|
||||||
r#type: AttachmentType,
|
pub(super) r#type: AttachmentType,
|
||||||
url: String,
|
pub(super) url: String,
|
||||||
preview_url: String,
|
pub(super) preview_url: String,
|
||||||
remote_url: Option<String>,
|
pub(super) remote_url: Option<String>,
|
||||||
text_url: Option<String>,
|
pub(super) text_url: Option<String>,
|
||||||
meta: Option<serde_json::Value>,
|
pub(super) meta: Option<serde_json::Value>,
|
||||||
description: Option<String>,
|
pub(super) description: Option<String>,
|
||||||
blurhash: Option<String>,
|
pub(super) blurhash: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[serde(rename_all = "lowercase", deny_unknown_fields)]
|
#[serde(rename_all = "lowercase", deny_unknown_fields)]
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||||
enum AttachmentType {
|
pub(super) enum AttachmentType {
|
||||||
Unknown,
|
Unknown,
|
||||||
Image,
|
Image,
|
||||||
Gifv,
|
Gifv,
|
||||||
|
|
|
@ -2,25 +2,25 @@ use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[serde(deny_unknown_fields)]
|
#[serde(deny_unknown_fields)]
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||||
pub(super) struct Card {
|
pub(in super::super) struct Card {
|
||||||
url: String,
|
pub(super) url: String,
|
||||||
title: String,
|
pub(super) title: String,
|
||||||
description: String,
|
pub(super) description: String,
|
||||||
r#type: CardType,
|
pub(super) r#type: CardType,
|
||||||
author_name: Option<String>,
|
pub(super) author_name: Option<String>,
|
||||||
author_url: Option<String>,
|
pub(super) author_url: Option<String>,
|
||||||
provider_name: Option<String>,
|
pub(super) provider_name: Option<String>,
|
||||||
provider_url: Option<String>,
|
pub(super) provider_url: Option<String>,
|
||||||
html: Option<String>,
|
pub(super) html: Option<String>,
|
||||||
width: Option<i64>,
|
pub(super) width: Option<i64>,
|
||||||
height: Option<i64>,
|
pub(super) height: Option<i64>,
|
||||||
image: Option<String>,
|
pub(super) image: Option<String>,
|
||||||
embed_url: Option<String>,
|
pub(super) embed_url: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[serde(rename_all = "lowercase", deny_unknown_fields)]
|
#[serde(rename_all = "lowercase", deny_unknown_fields)]
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||||
enum CardType {
|
pub(super) enum CardType {
|
||||||
Link,
|
Link,
|
||||||
Photo,
|
Photo,
|
||||||
Video,
|
Video,
|
||||||
|
|
|
@ -3,22 +3,22 @@ use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[serde(deny_unknown_fields)]
|
#[serde(deny_unknown_fields)]
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||||
pub(super) struct Poll {
|
pub(in super::super) struct Poll {
|
||||||
id: String,
|
pub(super) id: String,
|
||||||
expires_at: String,
|
pub(super) expires_at: String,
|
||||||
expired: bool,
|
pub(super) expired: bool,
|
||||||
multiple: bool,
|
pub(super) multiple: bool,
|
||||||
votes_count: i64,
|
pub(super) votes_count: i64,
|
||||||
voters_count: Option<i64>,
|
pub(super) voters_count: Option<i64>,
|
||||||
voted: Option<bool>,
|
pub(super) voted: Option<bool>,
|
||||||
own_votes: Option<Vec<i64>>,
|
pub(super) own_votes: Option<Vec<i64>>,
|
||||||
options: Vec<PollOptions>,
|
pub(super) options: Vec<PollOptions>,
|
||||||
emojis: Vec<Emoji>,
|
pub(super) emojis: Vec<Emoji>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[serde(deny_unknown_fields)]
|
#[serde(deny_unknown_fields)]
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||||
struct PollOptions {
|
pub(super) struct PollOptions {
|
||||||
title: String,
|
pub(super) title: String,
|
||||||
votes_count: Option<i32>,
|
pub(super) votes_count: Option<i32>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,15 +3,15 @@ use serde::{Deserialize, Serialize};
|
||||||
#[serde(deny_unknown_fields)]
|
#[serde(deny_unknown_fields)]
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||||
pub(super) struct Tag {
|
pub(super) struct Tag {
|
||||||
name: String,
|
pub(super) name: String,
|
||||||
url: String,
|
pub(super) url: String,
|
||||||
history: Option<Vec<History>>,
|
pub(super) history: Option<Vec<History>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[serde(deny_unknown_fields)]
|
#[serde(deny_unknown_fields)]
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||||
struct History {
|
pub(super) struct History {
|
||||||
day: String,
|
pub(super) day: String,
|
||||||
uses: String,
|
pub(super) uses: String,
|
||||||
accounts: String,
|
pub(super) accounts: String,
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
use super::{super::*, *};
|
||||||
|
use checked_event::{
|
||||||
|
account::{Account, Field},
|
||||||
|
tag::Tag,
|
||||||
|
visibility::Visibility::*,
|
||||||
|
CheckedEvent::*,
|
||||||
|
*,
|
||||||
|
};
|
||||||
|
use std::fs;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn parse_redis_msg_to_event() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
let mut test_num = 1;
|
||||||
|
|
||||||
|
let output = vec![
|
||||||
|
include!(concat!(
|
||||||
|
env!("CARGO_MANIFEST_DIR"),
|
||||||
|
"/test_data/event_001.rs"
|
||||||
|
)),
|
||||||
|
include!(concat!(
|
||||||
|
env!("CARGO_MANIFEST_DIR"),
|
||||||
|
"/test_data/event_002.rs"
|
||||||
|
)),
|
||||||
|
];
|
||||||
|
|
||||||
|
while let (Ok(input), Some(output)) = (
|
||||||
|
fs::read_to_string(format!("test_data/msg.event_txt_{:03}.txt", test_num)),
|
||||||
|
output.get(test_num - 1),
|
||||||
|
) {
|
||||||
|
println!("parsing `{:03}.resp`", test_num);
|
||||||
|
test_num += 1;
|
||||||
|
|
||||||
|
let event = Event::try_from(input)?;
|
||||||
|
println!("{:#?}", event);
|
||||||
|
|
||||||
|
assert_eq!(&event, output);
|
||||||
|
}
|
||||||
|
assert!(test_num > 1);
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
|
@ -58,13 +58,10 @@ fn parse_redis_msg() -> Result<(), RedisParseErr> {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn parse_long_redis_msg() -> Result<(), Box<dyn std::error::Error>> {
|
fn parse_long_redis_msg() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let pwd = path::Path::new(file!()).parent().expect("TEST");
|
|
||||||
|
|
||||||
let mut test_num = 1;
|
let mut test_num = 1;
|
||||||
|
|
||||||
while let (Ok(input), Ok(output)) = (
|
while let (Ok(input), Ok(output)) = (
|
||||||
fs::read_to_string(format!("{}/test_input/{:03}.resp", pwd.display(), test_num)),
|
fs::read_to_string(format!("test_data/redis_input_{:03}.resp", test_num)),
|
||||||
fs::read_to_string(format!("{}/test_output/{:03}.txt", pwd.display(), test_num)),
|
fs::read_to_string(format!("test_data/msg.event_txt_{:03}.txt", test_num)),
|
||||||
) {
|
) {
|
||||||
println!("parsing `{:03}.resp`", test_num);
|
println!("parsing `{:03}.resp`", test_num);
|
||||||
test_num += 1;
|
test_num += 1;
|
||||||
|
@ -82,6 +79,7 @@ fn parse_long_redis_msg() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
|
||||||
assert_eq!(r_msg.timeline_txt, "timeline:public");
|
assert_eq!(r_msg.timeline_txt, "timeline:public");
|
||||||
}
|
}
|
||||||
|
assert!(test_num > 1);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,118 @@
|
||||||
|
Event::TypeSafe(
|
||||||
|
Update {
|
||||||
|
payload: Status {
|
||||||
|
id: Id(102775370117886890),
|
||||||
|
uri: "https://mastodon.host/users/federationbot/statuses/102775346916917099".to_string(),
|
||||||
|
created_at: "2019-09-11T18:42:19.000Z".to_string(),
|
||||||
|
account: Account {
|
||||||
|
id: Id(78),
|
||||||
|
username: "federationbot".to_string(),
|
||||||
|
acct: "federationbot@mastodon.host".to_string(),
|
||||||
|
url: "https://mastodon.host/@federationbot".to_string(),
|
||||||
|
display_name: "Federation Bot".to_string(),
|
||||||
|
note: "<p>Hello, I am mastodon.host official semi bot.</p><p>Follow me if you want to have some updates on the view \
|
||||||
|
of the fediverse from here ( I only post unlisted ). </p><p>I also randomly boost one of my followers toot \
|
||||||
|
every hour !</p><p>If you don\'t feel confortable with me following you, tell me: unfollow and I\'ll do it \
|
||||||
|
:)</p><p>If you want me to follow you, just tell me follow ! </p><p>If you want automatic follow for new \
|
||||||
|
users on your instance and you are an instance admin, contact me !</p>\
|
||||||
|
<p>Other commands are private :)</p>".to_string(),
|
||||||
|
avatar: "https://instance.codesections.com/system/accounts/avatars/000/000/078/original/d9e2be5398629cf8.jpeg\
|
||||||
|
?1568127863".to_string(),
|
||||||
|
avatar_static: "https://instance.codesections.com/system/accounts/avatars/000/000/078/original/d9e2be5398629cf8\
|
||||||
|
.jpeg?1568127863".to_string(),
|
||||||
|
header: "https://instance.codesections.com/headers/original/missing.png".to_string(),
|
||||||
|
header_static: "https://instance.codesections.com/headers/original/missing.png".to_string(),
|
||||||
|
locked:
|
||||||
|
false,
|
||||||
|
emojis: [].to_vec(),
|
||||||
|
discoverable: None,
|
||||||
|
created_at: "2019-09-10T15:04:25.559Z".to_string(),
|
||||||
|
statuses_count: 50554,
|
||||||
|
followers_count: 16636,
|
||||||
|
following_count: 179532,
|
||||||
|
moved: None,
|
||||||
|
fields: Some(
|
||||||
|
[ Field {
|
||||||
|
name: "More stats".to_string(),
|
||||||
|
value: "<a href=\"https://mastodon.host/stats.html\" rel=\"nofollow noopener\" target=\"_blank\">\
|
||||||
|
<span class=\"invisible\">https://</span><span class=\"\">mastodon.host/stats.html</span>\
|
||||||
|
<span class=\"invisible\"></span></a>".to_string(),
|
||||||
|
verified_at: None
|
||||||
|
},
|
||||||
|
Field {
|
||||||
|
name: "More infos".to_string(),
|
||||||
|
value: "<a href=\"https://mastodon.host/about/more\" rel=\"nofollow noopener\" target=\"_blank\">\
|
||||||
|
<span class=\"invisible\">https://</span><span class=\"\">mastodon.host/about/more</span>\
|
||||||
|
<span class=\"invisible\"></span></a>".to_string(),
|
||||||
|
verified_at: None
|
||||||
|
},
|
||||||
|
Field {
|
||||||
|
name: "Owner/Friend".to_string(),
|
||||||
|
value: "<span class=\"h-card\"><a href=\"https://mastodon.host/@gled\" class=\"u-url mention\" \
|
||||||
|
rel=\"nofollow noopener\" target=\"_blank\">@<span>gled</span></a></span>".to_string(),
|
||||||
|
verified_at: None
|
||||||
|
}
|
||||||
|
].to_vec()
|
||||||
|
),
|
||||||
|
bot: Some(false),
|
||||||
|
source: None,
|
||||||
|
group: None,
|
||||||
|
last_status_at: None
|
||||||
|
},
|
||||||
|
content: "<p>Trending tags:<br><a href=\"https://mastodon.host/tags/neverforget\" class=\"mention hashtag\" \
|
||||||
|
rel=\"nofollow noopener\" target=\"_blank\">#<span>neverforget</span></a><br>\
|
||||||
|
<a href=\"https://mastodon.host/tags/4styles\" class=\"mention hashtag\" rel=\"nofollow noopener\" \
|
||||||
|
target=\"_blank\">#<span>4styles</span></a><br><a href=\"https://mastodon.host/tags/newpipe\" \
|
||||||
|
class=\"mention hashtag\" rel=\"nofollow noopener\" target=\"_blank\">#<span>newpipe</span></a>\
|
||||||
|
<br><a href=\"https://mastodon.host/tags/uber\" class=\"mention hashtag\" rel=\"nofollow noopener\" \
|
||||||
|
target=\"_blank\">#<span>uber</span></a><br><a href=\"https://mastodon.host/tags/mercredifiction\" \
|
||||||
|
class=\"mention hashtag\" rel=\"nofollow noopener\" target=\"_blank\">#<span>mercredifiction</span>\
|
||||||
|
</a></p>".to_string(),
|
||||||
|
visibility: Unlisted,
|
||||||
|
sensitive: false,
|
||||||
|
spoiler_text: "".to_string(),
|
||||||
|
media_attachments: [].to_vec(),
|
||||||
|
application: None,
|
||||||
|
mentions: [].to_vec(),
|
||||||
|
tags: [
|
||||||
|
Tag {
|
||||||
|
name: "4styles".to_string(),
|
||||||
|
url: "https://instance.codesections.com/tags/4styles".to_string(),
|
||||||
|
history: None
|
||||||
|
},
|
||||||
|
Tag { name: "neverforget".to_string(),
|
||||||
|
url: "https://instance.codesections.com/tags/neverforget".to_string(),
|
||||||
|
history: None
|
||||||
|
},
|
||||||
|
Tag { name: "mercredifiction".to_string(),
|
||||||
|
url: "https://instance.codesections.com/tags/mercredifiction".to_string(),
|
||||||
|
history: None
|
||||||
|
},
|
||||||
|
Tag { name: "uber".to_string(),
|
||||||
|
url: "https://instance.codesections.com/tags/uber".to_string(),
|
||||||
|
history: None
|
||||||
|
},
|
||||||
|
Tag { name: "newpipe".to_string(),
|
||||||
|
url: "https://instance.codesections.com/tags/newpipe".to_string(),
|
||||||
|
history: None
|
||||||
|
}
|
||||||
|
].to_vec(),
|
||||||
|
emojis: [].to_vec(),
|
||||||
|
reblogs_count: 0,
|
||||||
|
favourites_count: 0,
|
||||||
|
replies_count: 0,
|
||||||
|
url: Some("https://mastodon.host/@federationbot/102775346916917099".to_string()),
|
||||||
|
in_reply_to_id: None,
|
||||||
|
in_reply_to_account_id: None,
|
||||||
|
reblog: None,
|
||||||
|
poll: None,
|
||||||
|
card: None,
|
||||||
|
language: Some("en".to_string()),
|
||||||
|
text: None,
|
||||||
|
favourited: Some(false),
|
||||||
|
reblogged: Some(false),
|
||||||
|
muted: Some(false),
|
||||||
|
bookmarked: None,
|
||||||
|
pinned: None
|
||||||
|
},
|
||||||
|
queued_at: Some(1568227693541) })
|
|
@ -0,0 +1,100 @@
|
||||||
|
Event::TypeSafe(
|
||||||
|
Update {
|
||||||
|
payload: Status {
|
||||||
|
id: Id(
|
||||||
|
104072549781970698,
|
||||||
|
),
|
||||||
|
uri: "https://newsbots.eu/users/aljazeera_english/statuses/104072549673971025".to_string(),
|
||||||
|
created_at: "2020-04-27T20:58:02.000Z".to_string(),
|
||||||
|
account: Account {
|
||||||
|
id: Id(
|
||||||
|
1852,
|
||||||
|
),
|
||||||
|
username: "aljazeera_english".to_string(),
|
||||||
|
acct: "aljazeera_english@newsbots.eu".to_string(),
|
||||||
|
url: "https://newsbots.eu/@aljazeera_english".to_string(),
|
||||||
|
display_name: "Al Jazeera English".to_string(),
|
||||||
|
note: "<p>Breaking news and ongoing coverage from around the world.</p><p>• unofficial •</p>".to_string(),
|
||||||
|
avatar: "https://instance.codesections.com/system/accounts/avatars/000/001/852/original/6377f39416193690.jpeg?1584742113".to_string(),
|
||||||
|
avatar_static: "https://instance.codesections.com/system/accounts/avatars/000/001/852/original/6377f39416193690.jpeg?1584742113".to_string(),
|
||||||
|
header: "https://instance.codesections.com/system/accounts/headers/000/001/852/original/f582c7deb0ec14ac.jpeg?1584742114".to_string(),
|
||||||
|
header_static: "https://instance.codesections.com/system/accounts/headers/000/001/852/original/f582c7deb0ec14ac.jpeg?1584742114".to_string(),
|
||||||
|
locked: false,
|
||||||
|
emojis: [].to_vec(),
|
||||||
|
discoverable: Some(
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
created_at: "2020-03-20T22:08:35.417Z".to_string(),
|
||||||
|
statuses_count: 26018,
|
||||||
|
followers_count: 915,
|
||||||
|
following_count: 1,
|
||||||
|
moved: None,
|
||||||
|
fields: Some(
|
||||||
|
[
|
||||||
|
Field {
|
||||||
|
name: "📍".to_string(),
|
||||||
|
value: "Doha, Qatar".to_string(),
|
||||||
|
verified_at: None,
|
||||||
|
},
|
||||||
|
Field {
|
||||||
|
name: "🔗".to_string(),
|
||||||
|
value: "<a href=\"https://www.aljazeera.com\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://www.</span><span class=\"\">aljazeera.com</span><span class=\"invisible\"></span></a>".to_string(),
|
||||||
|
verified_at: None,
|
||||||
|
},
|
||||||
|
].to_vec(),
|
||||||
|
),
|
||||||
|
bot: Some(
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
source: None,
|
||||||
|
group: Some(
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
last_status_at: Some(
|
||||||
|
"2020-04-27".to_string(),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
content: "<p>**Far-right governor defies Rome, lifts Venice lockdown early**</p><p>\"Veneto\'s governor, Luca Zaia, of the far-rght League party, says keeping restrictions in place risks \'social conflict\'.\"</p><p><a href=\"https://www.aljazeera.com/news/2020/04/governor-defies-rome-lifts-venice-lockdown-early-200427171844336.html\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://www.</span><span class=\"ellipsis\">aljazeera.com/news/2020/04/gov</span><span class=\"invisible\">ernor-defies-rome-lifts-venice-lockdown-early-200427171844336.html</span></a></p><p><a href=\"https://newsbots.eu/tags/news\" class=\"mention hashtag\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">#<span>news</span></a> <a href=\"https://newsbots.eu/tags/bot\" class=\"mention hashtag\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">#<span>bot</span></a></p>".to_string(),
|
||||||
|
visibility: Public,
|
||||||
|
sensitive: false,
|
||||||
|
spoiler_text: "".to_string(),
|
||||||
|
media_attachments: [].to_vec(),
|
||||||
|
application: None,
|
||||||
|
mentions: [].to_vec(),
|
||||||
|
tags: [
|
||||||
|
Tag {
|
||||||
|
name: "news".to_string(),
|
||||||
|
url: "https://instance.codesections.com/tags/news".to_string(),
|
||||||
|
history: None,
|
||||||
|
},
|
||||||
|
Tag {
|
||||||
|
name: "bot".to_string(),
|
||||||
|
url: "https://instance.codesections.com/tags/bot".to_string(),
|
||||||
|
history: None,
|
||||||
|
},
|
||||||
|
].to_vec(),
|
||||||
|
emojis: [].to_vec(),
|
||||||
|
reblogs_count: 0,
|
||||||
|
favourites_count: 0,
|
||||||
|
replies_count: 0,
|
||||||
|
url: Some(
|
||||||
|
"https://newsbots.eu/@aljazeera_english/104072549673971025".to_string(),
|
||||||
|
),
|
||||||
|
in_reply_to_id: None,
|
||||||
|
in_reply_to_account_id: None,
|
||||||
|
reblog: None,
|
||||||
|
poll: None,
|
||||||
|
card: None,
|
||||||
|
language: Some(
|
||||||
|
"en".to_string(),
|
||||||
|
),
|
||||||
|
text: None,
|
||||||
|
favourited: None,
|
||||||
|
reblogged: None,
|
||||||
|
muted: None,
|
||||||
|
bookmarked: None,
|
||||||
|
pinned: None,
|
||||||
|
},
|
||||||
|
queued_at: None,
|
||||||
|
},
|
||||||
|
)
|
Loading…
Reference in New Issue