github-trending-rs

Crates.iogithub-trending-rs
lib.rsgithub-trending-rs
version0.0.5
created_at2025-06-07 22:29:58.930335+00
updated_at2025-09-20 08:53:03.243759+00
descriptionA simple Rust crate to fetch trending repositories from GitHub.
homepage
repositoryhttps://github.com/dearfl/github-trending-rs
max_upload_size
id1704474
size737,403
dearfl (dearfl)

documentation

README

GitHub Trending Repositories in Rust

crates.io docs.rs

A simple Rust crate to fetch trending repositories from GitHub.

Usage

Example: Get daily Rust trending repositories

use std::time::Duration;

use github_trending_rs::{Language, Since, TrendExt};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let client = reqwest::ClientBuilder::new()
        .connect_timeout(Duration::from_secs(5))
        .timeout(Duration::from_secs(10))
        .build()?;

    let repos = client
        .github_trending()
        .with_language(Language::Rust)
        .since(Since::Daily)
        .repositories()
        .await?
        .all();

    for repo in repos {
        println!("{:#?}", repo);
    }

    Ok(())
}

Limitations

  • This crate relies on GitHub's public API. Changes to GitHub's website or rate limiting policies may affect functionality.
  • The HTML parsing is based on the current structure of GitHub's trending page, which could change over time.

License

This project is licensed under the GLWTPL (Good Luck With That Public License). See the LICENSE file for more details.

Commit count: 108

cargo fmt