GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - fiam/readable: C library for extracting interesting content from web pages

BranchesTags
Open more actions menu

Latest commit

 

History

10 Commits
10 Commits

Folders and files

NameName
Last commit message
Last commit date
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
khash.h
khash.h
 
 
main.c
main.c
 
 
py.c
py.c
 
 
rd_list.c
rd_list.c
 
 
rd_list.h
rd_list.h
 
 
readable.c
readable.c
 
 
readable.h
readable.h
 
 
run_test.sh
run_test.sh
 
 
setup.py
setup.py
 
 

Repository files navigation

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]

About

C library for extracting interesting content from web pages

Resources

Readme
AGPL-3.0 license
Activity

Stars

28 stars

Watchers

4 watching

Forks

6 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.