在好例子网,分享、交流、成长!
您当前所在位置:首页Others 开发实例一般编程问题 → NReadability:清理网页杂乱无章,提升阅读体验的工具

NReadability:清理网页杂乱无章,提升阅读体验的工具

一般编程问题

下载此实例
  • 开发语言:Others
  • 实例大小:3.50M
  • 下载次数:0
  • 浏览次数:12
  • 发布时间:2024-03-21
  • 实例类别:一般编程问题
  • 发 布 人:chenxiaolan
  • 文件格式:.zip
  • 所需积分:2
 

实例介绍

【实例简介】
NReadability是一个高效的工具,旨在清理网络文章中难以阅读的部分,通过去除HTML页面上的杂乱信息,让文章变得更加清晰、易于阅读。该工具包含了.NET类库以及一个简单的控制台应用程序,是Arc90的Readability书签工具的C#版本。

如何开始使用NReadability:
首先,您可以通过安装NuGet包快速开始使用NReadability。接下来,为了转码从网络下载的内容,可以使用以下代码示例:
var transcoder = new NReadabilityTranscoder();
string content;

using (var wc = new WebClient())
{
  content = wc.DownloadString("您的文章链接");
}

bool success;

string transcodedContent =
  transcoder.Transcode(content, out success);

或者更简单的方式:
var transcoder = new NReadabilityWebTranscoder();
bool success;

string transcodedContent =
  transcoder.Transcode("您的文章链接", out success);

NReadability提供了一种简便的方法来清理和改善网络上的阅读体验,通过去除不必要的干扰元素,让重点内容更加突出。
【实例截图】
【核心代码】
文件清单
└── NReadability-808afcfd2086b627d7be4ed7572afd33a4825df3
    ├── Assets
    │   ├── Gfx
    │   │   ├── Favicon.png
    │   │   ├── Favicon.psd
    │   │   ├── Logo.png
    │   │   └── Logo.psd
    │   └── Src
    │       └── Readability.7z
    ├── Build.cmd
    ├── Lib
    │   ├── NUnit
    │   │   ├── framework
    │   │   │   ├── nunit.framework.dll
    │   │   │   ├── nunit.framework.xml
    │   │   │   ├── nunit.mocks.dll
    │   │   │   └── pnunit.framework.dll
    │   │   ├── lib
    │   │   │   ├── Failure.png
    │   │   │   ├── fit.dll
    │   │   │   ├── Ignored.png
    │   │   │   ├── Inconclusive.png
    │   │   │   ├── log4net.dll
    │   │   │   ├── nunit-console-runner.dll
    │   │   │   ├── nunit.core.dll
    │   │   │   ├── nunit.core.interfaces.dll
    │   │   │   ├── nunit.fixtures.dll
    │   │   │   ├── nunit-gui-runner.dll
    │   │   │   ├── nunit.uiexception.dll
    │   │   │   ├── nunit.uikit.dll
    │   │   │   ├── nunit.util.dll
    │   │   │   ├── Skipped.png
    │   │   │   └── Success.png
    │   │   ├── nunit.framework.dll
    │   │   ├── nunit.framework.xml
    │   │   ├── nunit.mocks.dll
    │   │   ├── pnunit.framework.dll
    │   │   └── tests
    │   │       ├── loadtest-assembly.dll
    │   │       ├── mock-assembly.dll
    │   │       ├── nonamespace-assembly.dll
    │   │       ├── nunit-console.tests.dll
    │   │       ├── nunit.core.tests.dll
    │   │       ├── nunit.fixtures.tests.dll
    │   │       ├── nunit.framework.dll
    │   │       ├── nunit.framework.tests.dll
    │   │       ├── nunit-gui.tests.dll
    │   │       ├── nunit.mocks.tests.dll
    │   │       ├── nunit.uiexception.tests.dll
    │   │       ├── nunit.uikit.tests.dll
    │   │       ├── nunit.util.tests.dll
    │   │       ├── test-assembly.dll
    │   │       ├── test-utilities.dll
    │   │       └── timing-tests.dll
    │   └── SgmlReader
    │       └── SgmlReaderDll.dll
    ├── LICENSE.txt
    ├── NReadability.build
    ├── NReadability.nuspec
    ├── PushToNuget.cmd
    ├── README.md
    ├── Src
    │   ├── NReadability
    │   │   ├── NReadability
    │   │   │   ├── AttributeTransformationInput.cs
    │   │   │   ├── AttributeTransformationResult.cs
    │   │   │   ├── ChildNodesTraverser.cs
    │   │   │   ├── Consts.cs
    │   │   │   ├── CookieAwareWebClient.cs
    │   │   │   ├── DomExtensions.cs
    │   │   │   ├── DomSerializationParams.cs
    │   │   │   ├── ElementsTraverser.cs
    │   │   │   ├── EncodedStringWriter.cs
    │   │   │   ├── EnumerableExtensions.cs
    │   │   │   ├── Enums.cs
    │   │   │   ├── HtmlUtils.cs
    │   │   │   ├── InternalErrorException.cs
    │   │   │   ├── IUrlFetcher.cs
    │   │   │   ├── NReadability.csproj
    │   │   │   ├── NReadabilityTranscoder.cs
    │   │   │   ├── NReadabilityWebTranscoder.cs
    │   │   │   ├── Properties
    │   │   │   │   ├── AssemblyInfo.cs
    │   │   │   │   └── AssemblyInfo.cs.template
    │   │   │   ├── Resources
    │   │   │   │   └── readability.css
    │   │   │   ├── SgmlDomBuilder.cs
    │   │   │   ├── SgmlDomSerializer.cs
    │   │   │   ├── TranscodingInput.cs
    │   │   │   ├── TranscodingResult.cs
    │   │   │   ├── UrlFetcher.cs
    │   │   │   ├── UtilityExtensions.cs
    │   │   │   ├── WebTranscodingInput.cs
    │   │   │   └── WebTranscodingResult.cs
    │   │   ├── NReadability.Console
    │   │   │   ├── NReadability.Console.csproj
    │   │   │   ├── Program.cs
    │   │   │   └── Properties
    │   │   │       ├── AssemblyInfo.cs
    │   │   │       └── AssemblyInfo.cs.template
    │   │   ├── NReadability.sln
    │   │   └── NReadability.Tests
    │   │       ├── DomExtensionsTests.cs
    │   │       ├── EnumerableExtensionsTests.cs
    │   │       ├── FileBasedUrlFetcherStub.cs
    │   │       ├── HtmlUtilsTests.cs
    │   │       ├── MyAssert.cs
    │   │       ├── NReadability.Tests.csproj
    │   │       ├── NReadabilityTranscoderTests.cs
    │   │       ├── NReadabilityTranscoderTests_Old.cs
    │   │       ├── NReadabilityWebTranscoderTests.cs
    │   │       ├── NReadabilityWebTranscoderTests_Old.cs
    │   │       ├── Properties
    │   │       │   ├── AssemblyInfo.cs
    │   │       │   └── AssemblyInfo.cs.template
    │   │       ├── SampleInput
    │   │       │   ├── SampleInput_01.html
    │   │       │   ├── SampleInput_02.html
    │   │       │   ├── SampleInput_03.html
    │   │       │   ├── SampleInput_04.html
    │   │       │   ├── SampleInput_05.html
    │   │       │   ├── SampleInput_06.html
    │   │       │   ├── SampleInput_07.html
    │   │       │   ├── SampleInput_08.html
    │   │       │   ├── SampleInput_09.html
    │   │       │   ├── SampleInput_10.html
    │   │       │   ├── SampleInput_11.html
    │   │       │   ├── SampleInput_12.html
    │   │       │   ├── SampleInput_13.html
    │   │       │   ├── SampleInput_14.html
    │   │       │   ├── SampleInput_15.html
    │   │       │   └── SampleInput_16.html
    │   │       ├── SampleWebInput
    │   │       │   ├── SampleInput_01_1.html
    │   │       │   ├── SampleInput_01_2.html
    │   │       │   ├── SampleInput_02_1.html
    │   │       │   ├── SampleInput_02_2.html
    │   │       │   ├── SampleInput_02_3.html
    │   │       │   ├── SampleInput_03_1.html
    │   │       │   ├── SampleInput_03_2.html
    │   │       │   ├── SampleInput_03_3.html
    │   │       │   ├── SampleInput_04_1.html
    │   │       │   ├── SampleInput_04_2.html
    │   │       │   ├── SampleInput_05_1.html
    │   │       │   ├── SampleInput_05_2.html
    │   │       │   ├── SampleInput_05_3.html
    │   │       │   ├── SampleInput_05_4.html
    │   │       │   ├── SampleInput_05_5.html
    │   │       │   ├── SampleInput_06_1.html
    │   │       │   ├── SampleInput_06_2.html
    │   │       │   ├── SampleInput_07_1.html
    │   │       │   ├── SampleInput_07_2.html
    │   │       │   ├── SampleInput_08_1.html
    │   │       │   ├── SampleInput_08_2.html
    │   │       │   ├── SampleInput_09_1.html
    │   │       │   ├── SampleInput_09_2.html
    │   │       │   ├── SampleInput_10_1.html
    │   │       │   ├── SampleInput_10_2.html
    │   │       │   ├── SampleInput_10_3.html
    │   │       │   ├── SampleInput_11_1.html
    │   │       │   ├── SampleInput_11_2.html
    │   │       │   └── SampleInput_11_3.html
    │   │       ├── SgmlDomBuilderTests.cs
    │   │       ├── SgmlDomSerializerTests.cs
    │   │       └── SimpleUrlFetcherStub.cs
    │   └── SgmlReader 1.8.7
    │       ├── CommandLine
    │       │   ├── App.ico
    │       │   ├── AssemblyInfo.cs
    │       │   ├── Html.dtd
    │       │   ├── htmllat1.ent
    │       │   ├── HTMLspecial.ent
    │       │   ├── HTMLsymbol.ent
    │       │   ├── loose.dtd
    │       │   ├── Main.cs
    │       │   ├── SgmlReader71.csproj
    │       │   ├── SgmlReader8.csproj
    │       │   ├── SgmlReader9.csproj
    │       │   ├── SgmlReader.csproj
    │       │   ├── Sloppy.dtd
    │       │   └── strict.dtd
    │       ├── Demo.aspx
    │       ├── download.gif
    │       ├── eula.htm
    │       ├── mindtouch.build.xml
    │       ├── Readme.css
    │       ├── Readme.htm
    │       ├── SgmlReader71.sln
    │       ├── SgmlReader8.sln
    │       ├── SgmlReader9.sln
    │       ├── sgmlreaderdll
    │       │   ├── AssemblyInfo.cs
    │       │   ├── SgmlParser.cs
    │       │   ├── SgmlReader.cs
    │       │   ├── SgmlReaderDll71.csproj
    │       │   ├── SgmlReaderDll8.csproj
    │       │   ├── SgmlReaderDll9.csproj
    │       │   ├── SgmlReaderDll.csproj
    │       │   └── sgmlreader.snk
    │       ├── SgmlReaderDll9.Tests
    │       │   ├── MyAssert.cs
    │       │   ├── Properties
    │       │   │   └── AssemblyInfo.cs
    │       │   ├── SgmlReaderDll9.Tests.csproj
    │       │   └── SgmlReaderTests.cs
    │       ├── SgmlReader.sln
    │       ├── sgmlreader.src
    │       └── TestSuite
    │           ├── App.ico
    │           ├── AssemblyInfo.cs
    │           ├── html.suite
    │           ├── ofx160.dtd
    │           ├── ofx.suite
    │           ├── Test.cs
    │           ├── TestSuite8.csproj
    │           ├── TestSuite9.csproj
    │           └── TestSuite.csproj
    └── Tools
        ├── ImmDocNet
        │   └── ImmDocNet.exe
        └── NUnit
            ├── agent.conf
            ├── agent.log.conf
            ├── clr.bat
            ├── launcher.log.conf
            ├── lib
            │   ├── Failure.png
            │   ├── fit.dll
            │   ├── Ignored.png
            │   ├── Inconclusive.png
            │   ├── log4net.dll
            │   ├── nunit-console-runner.dll
            │   ├── nunit.core.dll
            │   ├── nunit.core.interfaces.dll
            │   ├── nunit.fixtures.dll
            │   ├── nunit-gui-runner.dll
            │   ├── nunit.uiexception.dll
            │   ├── nunit.uikit.dll
            │   ├── nunit.util.dll
            │   ├── Skipped.png
            │   └── Success.png
            ├── nunit-agent.exe
            ├── nunit-agent.exe.config
            ├── nunit-console.exe
            ├── nunit-console.exe.config
            ├── nunit-console-x86.exe
            ├── nunit-console-x86.exe.config
            ├── nunit.exe
            ├── nunit.exe.config
            ├── NUnitFitTests.html
            ├── nunit.framework.dll
            ├── NUnitTests.config
            ├── NUnitTests.nunit
            ├── nunit-x86.exe
            ├── nunit-x86.exe.config
            ├── pnunit-agent.exe
            ├── pnunit-agent.exe.config
            ├── pnunit.framework.dll
            ├── pnunit-launcher.exe
            ├── pnunit-launcher.exe.config
            ├── pnunit.tests.dll
            ├── runFile.exe
            ├── runFile.exe.config
            ├── runpnunit.bat
            └── test.conf

31 directories, 234 files

标签:

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警