Skip to content
This repository has been archived by the owner on Feb 16, 2018. It is now read-only.

jameslawler/react-native-readability

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-readability

React Native compatible readability

Build Status

A layer on top of the Mozilla Readability module using react-native compatible modules. This module attempts to first clean the HTML of broken elements and tags before extracting the clean HTML.

Installation

npm install react-native-readability --save

Usage example

import readability from 'react-native-readability';

const url = 'http://www.bbc.com/news/business-42942921';

return fetch(url)
  .then((response) => response.text())
  .then((responseData) => readability.cleanHtml(responseData, url))
  .then((cleanHtml) => {
    console.log(cleanHtml.content);
    console.log(cleanHtml.title);
  });

Clean HTML model

{
  byline: '',   // Author (if found)
  content: '',  // Clean HTML
  excerpt: '',  // Short description of HTML
  length: 0,    // Byte length of clean HTML
  title: '',    // Title of web page
}

Development setup

Clone this project from GitHub

npm install
npm test

Bugs / feature requests

If you find any bugs or have a feature request, please create an issue in GitHub.

Contributing

  1. Fork it (https://github.com/jameslawler/react-native-readability)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

License

Distributed under the MIT license. See LICENSE for more information.

About

React Native compatible readability algorithm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published