This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Get
Tobias Klika edited this page Dec 15, 2013
·
2 revisions
Get list of all items:
List<PocketItem> items = await _client.Get();
// equivalent to: await _client.Get(RetrieveFilter.All)
Get a list with specific parameters (explanation in the Pocket Docs):
List<PocketItem> items = await _client.Get(
State? state = null,
bool? favorite = null,
string tag = null,
ContentType? contentType = null,
Sort? sort = null,
string search = null,
string domain = null,
DateTime? since = null,
int? count = null,
int? offset = null
);
It's best to use parameters as named parameters, to avoid typing null
values:
List<PocketItem> items = await _client.Get(count: 10, offset: 20, sort: Sort.oldest);
Get item by ID:
PocketItem item = await _client.Get("1298198");
Find items by a tag:
List<PocketItem> items = await _client.SearchByTag("tutorial");
Find items by a search string.
PocketSharp uses an internal search, which is significantly faster than the Search API by Pocket.
List<PocketItem> items = await _client.Search("css");
Find items by a search string by already available items:
List<PocketItem> items = await _client.Search(myPocketItemList, "css");
Get all tags:
List<PocketTag> items = await _client.GetTags();
Get a filtered list:
List<PocketItem> items = await _client.Get(RetrieveFilter.Favorite);
// returns favorites only
The RetrieveFilter Enum is specified as follows:
enum RetrieveFilter { All, Unread, Archive, Favorite, Article, Video, Image }