Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vinitshahdeo/github-stars-feed
Get the latest feed of GitHub Stars out there! π β β¨
https://github.com/vinitshahdeo/github-stars-feed
github-hall-of-fame github-stars github-stars-api github-stars-feed github-stars-feed-parser hacktoberfest hacktoberfest2021 json-feed rss-feed
Last synced: 2 months ago
JSON representation
Get the latest feed of GitHub Stars out there! π β β¨
- Host: GitHub
- URL: https://github.com/vinitshahdeo/github-stars-feed
- Owner: vinitshahdeo
- License: mit
- Created: 2021-05-11T18:20:54.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-04T11:24:18.000Z (over 3 years ago)
- Last Synced: 2024-11-08T12:49:21.952Z (3 months ago)
- Topics: github-hall-of-fame, github-stars, github-stars-api, github-stars-feed, github-stars-feed-parser, hacktoberfest, hacktoberfest2021, json-feed, rss-feed
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/github-stars-feed
- Size: 5.04 MB
- Stars: 33
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- project-awesome - vinitshahdeo/github-stars-feed - Get the latest feed of GitHub Stars out there! π β β¨ (JavaScript)
README
> The **[GitHub Stars program](https://stars.github.com/)** thanks GitHubβs most influential [developers](https://stars.github.com/profiles/) and gives them a platform to showcase their work, reach more people, and shape the future of GitHub. [Read](https://dev.to/vinitshahdeo/milepost-from-a-github-user-to-a-github-star-2o36) my journey **from a GitHub User to a GitHub Star**.
## Installation
[![NPM](https://nodei.co/npm/github-stars-feed.png?compact=true)](https://www.npmjs.com/package/github-stars-feed)
```bash
npm i github-stars-feed
```## Usage
![Typing SVG](https://readme-typing-svg.herokuapp.com?font=Montserrat&color=0B2734&vCenter=true&lines=What's+cooking+in+GitHub+Star's+pot%3F)
```js
const githubStars = require('github-stars-feed');
```### Get filtered feed
```js
var options = {
limit: 2,
sanitize: true,
username: 'vinitshahdeo'
};githubStars.getFeed(options, (err, feed) => {
if (err) {
console.log('Something went wrong while fetching GitHub Stars Feed');
} else {
console.log(feed); // filtered feed
}
});```
#### Sample Response
```js
[
{
title: 'Meet Vinit Shahdeo, a resident of Jharkhand, has been recognized as a GitHub Star',
summary: 'My journey got featured by the News Khajana.',
link: 'https://thenewskhazana.com/story/meet-vinit-shahdeo-a-resident-of-jharkhand-has-been-recognized-as-a-github-star-22451/',
updated: 'Sunday, November 3rd 2019',
author: {
name: 'vinitshahdeo',
uri: 'https://stars.github.com/vinitshahdeo'
}
},
{
title: 'Mentor - Google Summer Of Code',
summary: 'Postman is one of the mentoring organization for GSoC. This year, Postman has AsyncAPI Initiative as part of their team.\n\nI will be mentoring an idea for AsyncAPI i.e. AsyncDiff. It\'s basically a library to compare two AsyncAPI documents and generate diff for the review process.',
link: 'https://community.postman.com/t/idea-9-asyncdiff-general-information/21694',
updated: 'Sunday, November 3rd 2019',
author: {
name: 'vinitshahdeo',
uri: 'https://stars.github.com/vinitshahdeo'
}
}
]```
### Get complete feed
```js
githubStars.getFeed((err, feed) => {
if (err) {
console.log('Something went wrong while fetching GitHub Stars Feed');
} else {
console.log(feed); // complete feed
}
});
```#### Sample Response
```js
[
{
title: {
type: 'html',
value: 'Meet Vinit Shahdeo, a resident of Jharkhand, has been recognized as a GitHub Star'
},
id: 'cknat1te840382f1viftueegf',
link: {
href: 'https://thenewskhazana.com/story/meet-vinit-shahdeo-a-resident-of-jharkhand-has-been-recognized-as-a-github-star-22451/'
},
updated: '2021-04-02T00:00:00.000Z',
summary: {
type: 'html',
value: 'My journey got featured by the News Khajana.'
},
author: {
name: 'vinitshahdeo',
uri: 'https://stars.github.com/vinitshahdeo'
}
},
{
title: { type: 'html', value: 'Mentor - Google Summer Of Code' },
id: 'ckmm44oxu03192fxc94w0seir',
link: {
href: 'https://community.postman.com/t/idea-9-asyncdiff-general-information/21694'
},
updated: '2021-03-20T00:00:00.000Z',
summary: {
type: 'html',
value: 'Postman is one of the mentoring organization for GSoC. This year, Postman has AsyncAPI Initiative as part of their team.\n\nI will be mentoring an idea for AsyncAPI i.e. AsyncDiff. It\'s basically a library to compare two AsyncAPI documents and generate diff for the review process.'
},
author: {
name: 'vinitshahdeo',
uri: 'https://stars.github.com/vinitshahdeo'
}
}
];```
## Options
Additionally, `limit`, `sanitize` and `username` can be passed to filter the feed entries.
| Options | Type | Description |
|:----------|:---------|:---------------------------------------------------------------------------|
| `limit` | Number | _max entries to be returned_ |
| `sanitize` | Boolean | _return sanitized feed
(only `title`, `summary`, `link`, `updated` and `author`)_ |
| `username` | String | _return entries of GitHub Star for given `username` only_ |### Show first `n` feed entries
```js
githubStars.getFeed({ limit: 5 }, (err, feed) => {
if (err) {
console.log('Something went wrong while fetching GitHub Stars Feed');
} else {
console.log(feed); // first 5 feed entries
}
});
```### Get feed of any GitHub Star (by their GitHub username say `vinitshahdeo`)
```js
githubStars.getFeed({ username: 'vinitshahdeo' }, (err, feed) => {
if (err) {
console.log('Something went wrong while fetching GitHub Stars Feed');
} else {
console.log(feed); // feed of vinitshahdeo only
}
});
```### Get sanitized feed
```js
githubStars.getFeed({ sanitize: true }, (err, feed) => {
if (err) {
console.log('Something went wrong while fetching GitHub Stars Feed');
} else {
console.log(feed); // sanitized feed
}
});
```## Blog
Do check out the article "[How to get GitHub Stars Contributions](https://vinitshahdeo.dev/github-stars-feed)" on [Hashnode](https://hashnode.com/@vinitshahdeo)!
[![Hashnode blog - Vinit Shahdeo](https://img.shields.io/badge/Check%20out%20blog%20on%20Hashnode-2962FF?style=for-the-badge&logo=hashnode&logoColor=white)](https://vinitshahdeo.dev/github-stars-feed)
## RSS Feed
This NPM [module](https://www.npmjs.com/package/github-stars-feed) is basically taking the [RSS feed](https://en.wikipedia.org/wiki/RSS) for GitHub Stars contributions and converting it into a valid JSON object which can be further used to build `Node.js` / `React` applications.
A sample entry from GitHub Stars Contributions [feed](https://github.com/vinitshahdeo/github-stars-feed/blob/main/data/feed.xml) looks like below:
```xml
cknat1te840382f1viftueegf
2021-04-02T00:00:00.000Z
vinitshahdeo
https://stars.github.com/vinitshahdeo
```
## Example
Please checkout `examples/` directory to view [example](./example/demo.js).
> _Refer the sample response [here](./data/sample.js)_.
## Acknowledgement
I'm happy to be a part of the GitHub Stars Hall of Fame. **From a (green) dot to a star, hereβs how my journey uncoiled - [tiny.cc/GitHubStar](https://tiny.cc/GitHubStar)**. Check out my GitHub Star profile [here](https://stars.github.com/profiles/vinitshahdeo/). π Let me know what do you build consuming this API?
*PS: **Always grateful to GitHub!** π€*
[![Twitter Follow](https://img.shields.io/twitter/follow/Vinit_Shahdeo?style=social)](https://twitter.com/Vinit_Shahdeo)