IPocketReader interface
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user