Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sheharyarn/github-trending
A gem that fetches trending github repos
https://github.com/sheharyarn/github-trending
github ruby
Last synced: 3 months ago
JSON representation
A gem that fetches trending github repos
- Host: GitHub
- URL: https://github.com/sheharyarn/github-trending
- Owner: sheharyarn
- License: mit
- Created: 2014-09-12T11:07:54.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-25T18:13:45.000Z (almost 10 years ago)
- Last Synced: 2024-10-13T09:58:02.147Z (3 months ago)
- Topics: github, ruby
- Language: Ruby
- Homepage: https://github.com/trending
- Size: 300 KB
- Stars: 40
- Watchers: 3
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
github-trending
===============`github-trending` is a gem that fetches [Trending repositories on GitHub](https://github.com/trending). It's functionality was extracted from the command-line utility [`git-trend`](https://github.com/rochefort/git-trend), so almost all of the code is written by **[@rochefort](https://github.com/rochefort)**.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'github-trending', github: 'sheharyarn/github-trending'
```And then execute:
```bash
$ bundle
```Or install it yourself as:
```bash
$ gem install github-trending
```## Usage
Require it if you haven't:
```ruby
require 'github-trending'
```Get the day's trending repos:
```ruby
repos = Github::Trending.get
repos.each do |r|
puts "#{r.name} (#{r.star_count} stargazers)"
puts "--- #{r.description}\n\n"
end# =>
# sindresorhus/awesome-nodejs (712 stargazers)
# --- A curated list of delightful Node.js packages and resources.
#
# MrSwitch/hello.js (536 stargazers)
# --- A Javascript RESTFUL API library for connecting with OAuth2 services, such as Google+ API, Facebook Graph # and Windows Live Connect
#
# ColdSauce/CosmosBrowserAndroid (391 stargazers)
# --- Cosmos Browser allows a person to connect to the internet through the use of SMS. No data or wifi required.
#
# ...
```You can also fetch by a specific language:
```ruby
ruby_repos = Github::Trending.get :ruby
objc_repos = Github::Trending.get :objective_c
```To get a list of all languages:
```ruby
languages = Github::Trending.languages
```You can get top github repos of the `:week` and `:month` as well (default is `:day`):
```ruby
Github::Trending.get(:scala, :week)
# Top scala repos in the weekGithub::Trending.get(nil, :month)
# Top repos (all languages) in this monthGithub::Trending.get('objective-c++', 'day')
# Can pass strings as well
```## Contributing
1. Fork it ( https://github.com/sheharyarn/github-trending/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request