How to get GitHub Stars Contributions

How to get GitHub Stars Contributions

An open-sourced NPM module to get the latest GitHub Stars contributions (RSS Feed)

Last year, GitHub launched the GitHub Stars program to thank GitHub’s most influential developers who have gone above and beyond in helping others in the community – not only by maintaining repositories but by helping educate, inspire and influence others.

github-star.gif

Be it blogs, podcasts, videos, community conferences or hackathons, GitHub Stars keep sharing their stories on the platform. You can keep an eye on what's cooking on GitHub Star's pot! 🌟 Wondering how? github-stars-feed is an open-sourced NPM module that can help you in getting their latest feed. Now, it's open to your creativity, how you showcase their contributions in your application!

Here's how?

NPM

  • npm init your project
  • npm install github-stars-feed
  • touch index.js

Now you're just a couple of key-strokes away from getting the GitHub Stars feed in your >_terminal. It's time to utilize the most popular pair (CTRL + C and CTRL + V) among developers! Paste the below code-snippet inside index.js and run node index.js.

const githubStars = require('github-stars-feed');

githubStars.getFeed((err, feed) => {
  if (err) {
    console.log('Something went wrong while fetching GitHub Stars Feed');
  } else {
    console.log(feed); // latest GitHub Stars contributions
  }
});

getFeed() will return a JSON response(sample given below) containing the latest GitHub Stars contributions.


[
  {
    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'
    }
  }
]

Additionally, you can provide options to filter the feed. Kindly refer this for complete documentation.

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
  }
});

Please refer the GitHub repository to explore more.

Let me know what do you build consuming github-stars-feed on Twitter.

Twitter Follow


I’m unbelievably humbled to have received an email saying “Congrats, you’re a GitHub Star!” back in March. From a (green) dot to a star, here’s how my journey uncoiled! 🚀

🍻 Cheers:) Follow @vinitshahdeo on GitHub

Did you find this article valuable?

Support Vinit Shahdeo by becoming a sponsor. Any amount is appreciated!