Giter Club home page Giter Club logo

rdrview's Introduction

rdrview

Command line tool to extract the main content from a webpage, as done by the "Reader View" feature of most modern browsers. It's intended to be used with terminal RSS readers, to make the articles more readable on web browsers such as lynx. The code is closely adapted from the Firefox version and the output is expected to be mostly equivalent.

Security

This tool is young and written in C, so it's reasonable to wonder about the potential for memory issues. To be safe, all HTML parsing happens inside a sandboxed subprocess. Seccomp is used for this purpose.

Usage

There are three direct dependencies: libxml2, libseccomp and libcurl. On Debian/Ubuntu, you can install the first two by running (as root):

apt install libxml2-dev libseccomp-dev

The libcurl package comes in different flavours, depending on the backend that provides the SSL support. Any of them will do. To install the GnuTLS version:

apt install libcurl4-gnutls-dev

For rdrview to be useful, you should also get a character mode web browser such as lynx:

apt install lynx

The name of the packages might differ in your distribution. On Fedora, for example, you can install everything with:

dnf install libcurl-devel libxml2-devel libseccomp-devel lynx

To build rdrview, just cd to its directory and run

make

Now it should be ready to be used. You can try:

./rdrview 'https://github.com/eafer/rdrview'
./rdrview < local_file.html

For more information, see the man page:

man ./rdrview.1

If you find rdrview useful and want to install it, become root again and run

make install

Now you can just call it with rdrview and get help with man rdrview, like you would for any other tool in your system.

Credits

rdrview was written by Ernesto A. Fernández, but it's mainly a transpilation done by hand of Mozilla's Readability.js; which was itself, in their own words, "heavily based on Arc90's readability.js". This is the original license:

Copyright (c) 2010 Arc90 Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

rdrview's People

Contributors

eafer 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.