complete new requests for trending

This commit is contained in:
2018-07-02 16:25:09 +02:00
parent 00b44e917e
commit 7edc82d726
3 changed files with 45 additions and 7 deletions
+13 -4
View File
@@ -11,13 +11,18 @@ namespace PocketSharp
public partial class PocketClient
{
/// <summary>
/// Statistics from the user account.
/// Get trending articles on Pocket.
/// Requires an active GUID from GetGuid() and will therefore make two HTTP requests.
/// </summary>
/// <param name="count">Article count.</param>
/// <param name="languageCode">Two-letter language code for language-specific results.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
/// <exception cref="PocketException"></exception>
public async Task<IEnumerable<PocketItem>> GetTrendingArticles(string guid, string languageCode = "en", int count = 20, CancellationToken cancellationToken = default(CancellationToken))
public async Task<IEnumerable<PocketItem>> GetTrendingArticles(int count = 20, string languageCode = "en", CancellationToken cancellationToken = default(CancellationToken))
{
string guid = await GetGuid(cancellationToken);
return (await Request<Retrieve>("getGlobalRecs", cancellationToken, new Dictionary<string, string>()
{
{ "guid", guid },
@@ -29,13 +34,17 @@ namespace PocketSharp
/// <summary>
/// Statistics from the user account.
/// Get trending topics on Pocket.
/// Requires an active GUID from GetGuid() and will therefore make two HTTP requests.
/// </summary>
/// <param name="languageCode">Two-letter language code for language-specific results.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
/// <exception cref="PocketException"></exception>
public async Task<IEnumerable<PocketTopic>> GetTrendingTopics(string guid, string languageCode = "en", CancellationToken cancellationToken = default(CancellationToken))
public async Task<IEnumerable<PocketTopic>> GetTrendingTopics(string languageCode = "en", CancellationToken cancellationToken = default(CancellationToken))
{
string guid = await GetGuid(cancellationToken);
return (await Request<TopicsResponse>("getTrendingTopics", cancellationToken, new Dictionary<string, string>()
{
{ "guid", guid },
+22 -2
View File
@@ -465,9 +465,29 @@ namespace PocketSharp
Task<PocketLimits> GetUsageLimits(CancellationToken cancellationToken = default(CancellationToken));
#endregion
Task<IEnumerable<PocketItem>> GetTrendingArticles(string guid, string languageCode = "en", int count = 20, CancellationToken cancellationToken = default(CancellationToken));
#region trending methods
/// <summary>
/// Get trending articles on Pocket.
/// Requires an active GUID from GetGuid() and will therefore make two HTTP requests.
/// </summary>
/// <param name="count">Article count.</param>
/// <param name="languageCode">Two-letter language code for language-specific results.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
/// <exception cref="PocketException"></exception>
Task<IEnumerable<PocketItem>> GetTrendingArticles(int count = 20, string languageCode = "en", CancellationToken cancellationToken = default(CancellationToken));
Task<IEnumerable<PocketTopic>> GetTrendingTopics(string guid, string languageCode = "en", CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Get trending topics on Pocket.
/// Requires an active GUID from GetGuid() and will therefore make two HTTP requests.
/// </summary>
/// <param name="languageCode">Two-letter language code for language-specific results.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
/// <exception cref="PocketException"></exception>
Task<IEnumerable<PocketTopic>> GetTrendingTopics(string languageCode = "en", CancellationToken cancellationToken = default(CancellationToken));
#endregion
/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+10 -1
View File
@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -299,6 +299,15 @@ namespace PocketSharp.Models
[JsonProperty("time_favorited")]
public DateTime? FavoriteTime { get; set; }
/// <summary>
/// Gets or sets the published time.
/// </summary>
/// <value>
/// The time when the article was published.
/// </value>
[JsonProperty("date_published")]
public DateTime? PublishedTime { get; set; }
/// <summary>
/// Gets or sets the tags as comma-separated strings.
/// </summary>