Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

article

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

article

Analyze a stream of HTML and outsputs the article title, text, and image

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
158
increased by259.09%
Maintainers
1
Weekly downloads
 
Created
Source

#article

Analyze a stream of HTML and outputs the article title, text, and image

Usually you have some feed, there will give you the title and perhaps a short description of the article. However its rare that it contains the image and certainly never the full context. This module will scrape the raw article html of the page and find as minimum the title, text and the image.

Install

npm install article

Example

var source = 'http://en.wikipedia.org/wiki/Fish';

// The image url will be resolved from the `source` url
request(source).pipe(article(source, function (err, result) {
  if (err) throw err;

  // result = {
  //  title: String,
  //  text: String,
  //  image: String or null
  // };
}));

Demo

For a demo you can run the analyse server I use for reliability scoring:

git clone https://github.com/AndreasMadsen/article.git
cd article
npm install
node tools/analyse/
open http://localhost:9100

Reliability

This is the current result (Mon Jul 29 2013).

Note this data is the same data I've used to build the heuristic algorithm. So there is a risk that the algorithm is overfitted.

UnknownWrongBadGoodPerfect
Title0000258
Text000138120
Image029062167
Title

The title can either be wrong or perfect. Perfetct means that it is the actual article title without any newspaper name or similar redundant information.

Text

The text can be wrong, bad, good and perfect. Wrong means that none of the text is related to the article. Bad means that there are enogth noise to give seriouse troubble in a text analysis. Good is almost perfect expect for minor noise such as author information or social network button text.

Image

Image can be wrong, good and perfect. Wrong is an image there is unrealted to the article or if no image could be found. Good is either not the main article or a lower resolution image than the expected perfect image.

##License

The software is license under "MIT"

Copyright (c) 2013 Andreas Madsen

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.

Keywords

FAQs

Package last updated on 25 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc