mirror of
https://framagit.org/veretcle/scootaloo.git
synced 2025-07-21 09:31:19 +02:00
Update various shits and give tokio compat 0.2
This commit is contained in:
@@ -11,6 +11,7 @@ use std::{
|
||||
|
||||
//tokio
|
||||
use tokio::runtime::Runtime;
|
||||
use tokio_compat_02::FutureExt;
|
||||
|
||||
// toml
|
||||
use serde::Deserialize;
|
||||
@@ -36,7 +37,7 @@ use elefren::{
|
||||
};
|
||||
|
||||
// reqwest
|
||||
use reqwest::Client;
|
||||
use reqwest::blocking::Client;
|
||||
|
||||
// htmlescape
|
||||
use htmlescape::decode_html;
|
||||
@@ -77,10 +78,11 @@ fn get_oauth2_token(config: &Config) -> Token {
|
||||
/// Get twitter user timeline
|
||||
fn get_user_timeline(config: &Config, token: Token, lid: Option<u64>) -> Result<Vec<Tweet>, Box<dyn Error>> {
|
||||
// fix the page size to 200 as it is the maximum Twitter authorizes
|
||||
let mut rt = Runtime::new()?;
|
||||
let rt = Runtime::new()?;
|
||||
let (_timeline, feed) = rt.block_on(user_timeline(UserID::from(String::from(&config.twitter.username)), true, false, &token)
|
||||
.with_page_size(200)
|
||||
.older(lid))?;
|
||||
.older(lid)
|
||||
.compat())?;
|
||||
|
||||
Ok(feed.to_vec())
|
||||
}
|
||||
|
Reference in New Issue
Block a user