rdrview Firefox Reader View as a command line tool开源项目

我要开发同款
匿名用户2021年11月17日
41阅读
开发技术JavaScript
所属分类应用工具、终端/远程登录
授权协议Apache-2.0 License

作品详情

rdrview

Commandlinetooltoextractthemaincontentfromawebpage,asdonebythe"ReaderView"featureofmostmodernbrowsers.It'sintendedtobeusedwithterminalRSSreaders,tomakethearticlesmorereadableonwebbrowserssuchaslynx.ThecodeiscloselyadaptedfromtheFirefoxversionandtheoutputisexpectedtobemostlyequivalent.

Security

ThistoolisyoungandwritteninC,soit'sreasonabletowonderaboutthepotentialformemoryissues.Tobesafe,allHTMLparsinghappensinsideasandboxedsubprocess.SeccompisusedforthispurposeonLinux,PledgeonOpenBSD,andCapsicumonFreeBSD.

UsageLinux

Therearethreedirectdependencies:libxml2,libseccompandlibcurl.OnDebian/Ubuntu,youcaninstallthefirsttwobyrunning(asroot):

aptinstalllibxml2-devlibseccomp-dev

Thelibcurlpackagecomesindifferentflavours,dependingonthebackendthatprovidestheSSLsupport.Anyofthemwilldo.ToinstalltheGnuTLSversion:

aptinstalllibcurl4-gnutls-dev

Forrdrviewtobeuseful,youshouldalsogetacharactermodewebbrowsersuchaslynx:

aptinstalllynx

Thenameofthepackagesmightdifferinyourdistribution.OnFedora,forexample,youcaninstalleverythingwith:

dnfinstalllibcurl-devellibxml2-devellibseccomp-devellynx

Tobuildrdrview,justcdtoitsdirectoryandrun

make

Nowitshouldbereadytobeused.Youcantry:

./rdrview'https://github.com/eafer/rdrview'

Formoreinformation,seethemanpage:

man./rdrview.1

Ifyoufindrdrviewusefulandwanttoinstallit,becomerootagainandrun

makeinstall

Nowyoucanjustcallitwithrdrviewandgethelpwithmanrdrview,likeyouwouldforanyothertoolinyoursystem.

BSDs

TobuildrdrviewontheBSDs,youwillneedGNUmakeaswellasthelibraries.Havingaterminalbrowseravailableisrecommended.OnOpenBSD,becomerootandrun

pkg_addgmakecurllibxmllynx

OnFreeBSD,thatwouldbe

pkginstallgmakegcclibxml2curllynx

Nowyoucancdtothesourcedirectoryandrungmakeforthebuild,andoptionallygmakeinstallfortheinstallation.TheBSDsdon'tprovideanymailcapfilebydefault,sotorunrdrviewyouwillneedtospecifythewebbrowser:

./rdrview-Blynx'https://github.com/eafer/rdrview'macOS

Idon'townanyApplecomputerstotestthismyself,butI'vebeentoldthatrdrviewdoesbuildonmacOS.Asandboxisnotyetimplemented,butthetoolcanstillberunwiththe--disable-sandboxflag,aslongastheuserunderstandstherisk.

Credits

rdrviewwaswrittenbyErnestoA.Fernández,butit'smainlyatranspilationdonebyhandofMozilla'sReadability.js;whichwasitself,intheirownwords,"heavilybasedonArc90'sreadability.js".Thisistheoriginallicense:

Copyright(c)2010Arc90IncLicensedundertheApacheLicense,Version2.0(the"License");youmaynotusethisfileexceptincompliancewiththeLicense.YoumayobtainacopyoftheLicenseathttps://www.apache.org/licenses/LICENSE-2.0Unlessrequiredbyapplicablelaworagreedtoinwriting,softwaredistributedundertheLicenseisdistributedonan"ASIS"BASIS,WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.SeetheLicenseforthespecificlanguagegoverningpermissionsandlimitationsundertheLicense.
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论