#news #api-bindings #async #zdf #ard

tagesschau

A client library for interacting with the Tagesschau’s /api2/news endpoint

7 releases

0.2.6 Feb 4, 2024
0.2.5 Feb 4, 2024
0.1.5 Feb 3, 2024

#1563 in Web programming

Download history 8/week @ 2024-02-02 19/week @ 2024-02-16 34/week @ 2024-02-23 2/week @ 2024-03-01 72/week @ 2024-03-29

72 downloads per month

MIT license

29KB
639 lines

tagesschau-rs

Crates.io Documentation License: MIT

A client library for interacting with the Tagesschau's /api2/news endpoint.

Example

let start = TDate::from_calendar_date(2024, Month::January, 20)?;
let end = TDate::from_calendar_date(2024, Month::January, 31)?;

let mut builder = TRequestBuilder::new();

builder
    .ressort(Ressort::Wirtschaft)
    .timeframe(tagesschau::Timeframe::DateRange(
        DateRange::new(start, end)?,
    ));

let articles: Vec<TextArticle> = builder.get_text_articles().await?;

for article in articles {
    println!("{} - {}", article.title(), article.date().time());
}

Results in something like
Gesetzlicher Mindestlohn zeigt positive Wirkung - 14:52:03.304
E-Autos werden beliebter – nur nicht in Deutschland - 17:07:02.836
Fed lässt Leitzins erneut unverändert - 20:50:58.427
Fed enttäuscht Zinshoffnungen - 22:16:27.875
...

License

This project is licensed under the MIT License.

See LICENSE for more information.

TODO:

  • Support for multiple ressorts
  • Support for Datetime timeframes (limit to 12.00h to 13.00h e.g.)
  • Support for a limited amount of articles
  • Add support for blocking requests

Dependencies

~4–18MB
~257K SLoC