IPocketReader interface

This commit is contained in:
2013-11-15 14:30:20 +01:00
parent a643e5c556
commit 44376c0852
3 changed files with 37 additions and 1 deletions
+35
View File
@@ -0,0 +1,35 @@
using PocketSharp.Models;
using System;
using System.Threading.Tasks;
namespace PocketSharp
{
public interface IPocketReader
{
/// <summary>
/// Reads article content from the given URI.
/// This method does not use the official Article View API, which is private.
/// The PocketReader is based on a custom PCL port of NReadability and SgmlReader.
/// </summary>
/// <param name="uri">An URI.</param>
/// <param name="bodyOnly">if set to <c>true</c> [only body is returned].</param>
/// <param name="noHeadline">if set to <c>true</c> [no headline (h1) is included].</param>
/// <returns>A Pocket article with extracted content and title.</returns>
/// <exception cref="PocketRequestException"></exception>
Task<PocketArticle> Read(Uri uri, bool bodyOnly = true, bool noHeadline = false);
/// <summary>
/// Reads article content from the given PocketItem.
/// This method does not use the official Article View API, which is private.
/// The PocketReader is based on a custom PCL port of NReadability and SgmlReader.
/// </summary>
/// <param name="item">The pocket item.</param>
/// <param name="bodyOnly">if set to <c>true</c> [only body is returned].</param>
/// <param name="noHeadline">if set to <c>true</c> [no headline (h1) is included].</param>
/// <returns>
/// A Pocket article with extracted content and title.
/// </returns>
/// <exception cref="PocketRequestException"></exception>
Task<PocketArticle> Read(PocketItem item, bool bodyOnly = true, bool noHeadline = false);
}
}
+1 -1
View File
@@ -10,7 +10,7 @@ namespace PocketSharp
/// <summary>
/// PocketReader
/// </summary>
public class PocketReader
public class PocketReader : IPocketReader
{
/// <summary>
/// Used UserAgent for HTTP request
@@ -39,6 +39,7 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="IPocketReader.cs" />
<Compile Include="PocketReader.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>