| Crates.io | pts-news |
| lib.rs | pts-news |
| version | 0.1.0 |
| created_at | 2024-12-18 08:49:13.34501+00 |
| updated_at | 2024-12-18 08:49:13.34501+00 |
| description | Tools to fetch and parse daily news from the PTS News website |
| homepage | https://github.com/x807x/pts-news |
| repository | https://github.com/x807x/pts-news |
| max_upload_size | |
| id | 1487319 |
| size | 64,778 |
PTS News is a Rust project that fetches and parses daily news from the PTS News website.
To use this in your project, run the following command:
cargo add pts-news
To build the project, run the following command:
cargo build
To run the example that fetches and prints the daily news, use the following command:
cargo run --example get-daily-news
This file contains the main module definitions and constants for the project.
pub const PTS_NEWS_URL: &str = "https://news.pts.org.tw";
pub mod daily_news;
This file contains an example of how to use the get_daily_news function to fetch and print the daily news.
use log::{info, LevelFilter};
#[tokio::main]
async fn main() {
env_logger::Builder::new()
.filter(None, LevelFilter::Info)
.init();
info!("Fetching daily news...");
let news = pts_news::daily_news::get_daily_news().await;
info!("{:#?}", news);
}
This project is licensed under the MIT License. See the LICENSE file for details.