npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

google-news-rss

v0.4.1

Published

A node (with browser support) module that searches Google News RSS Feed and returns a usable JSON response

Downloads

121

Readme

google-news-rss Travis branch Coveralls branch npm badge

🗞 A node module (with browser support) that searches Google News RSS Feed and returns a usable JSON response

This is an unofficial, super easy to use node module / API client that allows a user to fetch a Google News RSS feed based on search terms and returns an easy to use JSON response. google-news-rss also supports in-browser requests.

RSS Example

{
   title: "Are there really antioxidants in that juice? How to protect against food fraud.",
   description: "Regrettably, they are examples of food fraud that are perpetrated on unsuspecting Americans. The global food industry loses $10 billion to $15 billion per year through food substitutions, dilutions and fake labels, according to the Grocery ...",
   pubDate: "Wed, 08 Jun 2017 07:01:30 GMT",
   thumbnailUrl: "//t1.gstatic.com/images?q=tbn:ANd9GcS7OWziKD2Lc3zReERlqVcffAcgIuzzq723AR4zF807dKuqhzMY6EUEpQyzwGzHXpE05gGtFHNC",
   publisher: "Washington Post",
   link: "http://news.google.com/news/url?sa=t&fd=R&ct2=us&usg=AFQjCNEeo82SxlrQZP5SzjugGtJHFt36_g&clid=c3a7d30bb8a4878e06b80cf16b898331&ei=rCJqWYjEINKMzgKc_YDgCQ&url=https://www.washingtonpost.com/lifestyle/wellness/are-there-really-antioxidants-in-that-juice-how-to-protect-against-food-fraud/2017/06/07/fec98462-4554-11e7-bcde-624ad94170ab_story.html"
}

Install

$ npm install --save google-news-rss

Usage

const GoogleNewsRss = require('google-news-rss');

const googleNews = new GoogleNewsRss();

googleNews
   .search('unicorns')
   .then(resp => console.log(resp));

//
// [
//   {
//      title: 'Why don\'t unicorns exist? You asked Google – here\'s the answer ...',
//      link: 'http://news.google.com/news/url?sa=t&fd=R&ct2=us&usg=AFQjCNGNR4Qg8LGbjszT1yt2s2lMXvvufQ&clid=c3a7d30bb8a4878e06b80cf16b898331&cid=52779522121279&ei=VQU7WYjiFoLEhQHIs4HQCQ&url=https://www.theguardian.com/commentisfree/2017/jun/07/why-dont-unicorns-exist-google',
//      pubDate: 'Wed, 07 Jun 2017 07:01:30 GMT',
//      description: 'Imagine for a second that you’re God. You’ve created the universe in six days (seven under EU working time directives). You’ve created millions of creatures of unimaginable grace, oddness and beauty',
//      publisher: 'The Guardian',
//      imgSrc: '//t2.gstatic.com/images?q=tbn:ANd9GcRa2NGl3_alXByd3kpnDDImMJFGeskk4Mf_AWZc-ohe_O8iEtmBs7hMxieldT_--jQWuDr4gQc'
//    }
//  ... 9 more articles
// ]

API

GoogleNewsRss()

Type: class Usage: new GoogleNewsRss()

Instance Methods

.search(terms[, num, language, extraParams])

Returns: Promise that resolves n formatted articles

terms

Type: string

Search terms to search for within Google news. IE: ethereum,btc

num

Type: int Default: 10

Number of results to be returned [1...30].

language

Type: string Default: en

Language of the results within Google News. IE: pt-BR

Returns: Promise that resolves 10 formatted articles

extraParams

Type: object

Any additional query params that are appended to RSS url to refine the results. Please note, there aren't any officially documented parameters so your mileage may vary. Feel free to experiment with some of the params listed on this blog post provided by i-tweak.

Article Properties

| Properties | Description | Example | |--------------|------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | title | Title of the article | Why don't unicorns exist? You asked Google – here's the answer ... - The Guardian | | link | Google news link to article | Article Link | | pubDate | Published date | Wed, 07 Jun 2017 07:01:30 GMT | | description | Short description of article | Why don't unicorns exist? You asked Google - here's the answer ... | | thumbnailUrl | Thumbnail Url. Omitted when not available. | //t2.gstatic.com/images?q=tbn:ANd9GcRa2NGl3_alXByd3kpnDDImMJFGeskk4Mf_AWZc-ohe_O8iEtmBs7hMxieldT_--jQWuDr4gQc | | publisher | Publisher of article | The Guardian | |

License

MIT © Brandon Him