egg-mode-rs/egg-mode

Add an example for accessing a list timeline

Opened this issue · 0 comments

I think the documentation for accessing list timelines could be expanded on.

I think that

let list_timeline = egg_mode::list::statuses(SOME_LIST_ID, false, &token).with_page_size(10);

is the list version of this from the home timeline example:

let timeline = egg_mode::tweet::home_timeline(&token).with_page_size(10);

but it wasn't obvious from the documentation (and I'm still not completely sure). I was expecting the function name to be something like list_timeline.

Having an example like this one, but for list timelines would be helpful:

let timeline = egg_mode::tweet::home_timeline(&token).with_page_size(10);

let (timeline, feed) = timeline.start().await.unwrap();
for tweet in &*feed {
    println!("<@{}> {}", tweet.user.as_ref().unwrap().screen_name, tweet.text);
}

Assuming I'm right about how it works, something like:

const SOME_LIST_ID: egg_mode::list::ListID = egg_mode::list::ListID::ID(1234567890);

let timeline = egg_mode::list::statuses(SOME_LIST_ID, false, &token).with_page_size(10);

let (timeline, feed) = timeline.start().await.unwrap();
for tweet in &*feed {
    println!("<@{}> {}", tweet.user.as_ref().unwrap().screen_name, tweet.text);
}

Also these function overviews all mention Timelines:

home_timeline | Make a Timeline struct for navigating the collection of tweets posted by the authenticated user and the users mentions_timeline | Make a Timeline struct for navigating the collection of tweets that mention the authenticated user's screen retweets_of_me | Make a Timeline struct for navigating the collection of tweets posted by the authenticated user that have been user_timeline | Make a Timeline struct for navigating the collection of tweets posted by the given user, optionally including or excluding replies or retweets.

While

statuses | Begin navigating the collection of tweets made by the users added to the given list.

doesn't mention making a Timeline, which made it harder to realize that was the function I needed