Git Product home page Git Product logo

readable's Introduction

C implementation of the Readability algorithm (plus some goodies)

Dependencies:

  • libxml2
  • libpcre or ICU for regular expressions support

Building:

  • make

Building with ICU rather than pcre:

  • ICU=1 make

By default, both the readable program and the Python extension will be built.

Building for OS X using Xcode

  • Create a new directory named readable
  • Copy readable.h and readable.c in the newly created directory
  • Copy the directory named unicode from the ICU headers into your project (you can get it from the iPhoneSimulator SDK, under /usr/include/unicode)
  • Add the readable parent directory, the unicode parent directory and /usr/include/libxml2 to Header Search Path under Build Settings
  • Add libicucore.dylib and libxml2.xylib to the Link Binary with libraries Build Phase
  • In your code, import readable.h

Building for iOS using Xcode

  • Create a new directory named readable
  • Copy readable.h and readable.c in the newly created directory
  • Add the readable parent directory and /usr/include/libxml2 to Header Search Path under Build Settings
  • Add libicucore.dylib and libxml2.xylib to the Link Binary with libraries Build Phase
  • In your code, import readable.h

API:

char * readable(const char *html, const char *url, const char *encoding, int options)

Parses HTML to extract the interesting contents.

  • html: HTML code to parse
  • url: URL where this HTML was fetched from
  • encoding: HTML encoding
  • options: See readable.h for the avaialble options

char * next_page_url(const char *html, const char *url, const char *encoding);

Returns the url for the next page in a multipage article (pretty much in alpha):

  • html: HTML code to parse
  • url: URL where this HTML was fetched from
  • encoding: HTML encoding

License

This code is licensed under the AGPLv3. If you'd like to use the code under a different license, drop me a line to [email protected]

readable's People

Contributors

fiam avatar

Stargazers

Leo Zhao avatar

Watchers

James Cloos avatar

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.