GithubHelp home page GithubHelp logo

athammer / node-blindparser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adamsea/node-blindparser

0.0 1.0 0.0 68 KB

blindparser is an all purpose RSS/ATOM feed parser that parses feeds into a common format so that you do not have to care if they are RSS or ATOM feeds

License: Other

JavaScript 100.00%

node-blindparser's Introduction

node-blindparser

build status

blindparser is a RSS/ATOM feed parser that returns the requested feed urls in a json object that is formatted so that you will not have to worry (much) about the format of the requested feed.

Motivation

RSS and ATOM feeds are both trying to deliver similar content, but are different enough with their structure to be aggravating. The purpose of blindparser is to allow for the important parts of the feeds (article titles, links, etc) to be returned in a standard format, but to also return the rest of the feed in a reasonable way.

Installing

npm install blindparser

Usage

Using blind parser is easy, just call:

var parser = require('blindparser');

// with no options
parser.parseURL('http://rss.cnn.com/rss/cnn_topstories.rss', function(err, out){
	console.log(out);
});

var options = {
	followRedirect: false,
	timeout: 1000
};
//rss feeds
parser.parseURL('http://rss.cnn.com/rss/cnn_topstories.rss', options, function(err, out){
	console.log(out);
});
//atom feeds
parser.parseURL('http://www.blogger.com/feeds/10861780/posts/default', options, function(err, out){
	console.log(out);
});

Options

The options hash is passed through to request for fetching a given url.

Output

The point of blindparser is to try and hide the format of the originally requested feed. Thus RSS and ATOM feeds are returned in a common format. Similar fields (pubDate vs update) will be mapped to the same field in the output.

The 'minimal' output format is:

{
	type:"rss" or "atom"
	metadata:{
		title: Title of the feed
		desc: description or subtitle
		url: url of the feed
		update: pubDate or update time of the feed
	},
	items:[
		{
			title: Title of article
			desc:	Description or content of article
			link: Link to article
			date: Time article was published
		}...
	]

Tests

Tests for blindparser can be run using the command:

npm test

Make sure that you machine has an internet connection before running the tests.

License

Copyright (c) 2016 53seven, LLC

Originally Created by Kiernan McGowan

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.