Giter VIP home page Giter VIP logo

multipocket's Introduction

MultiPocket

About

The "Multipocket" solution consists of PocketApi project. It is an API wrapper for the "GetPocket" ("Pocket") service. So, Multipocket is the simplest multi-platform (Win10/11/Win10Mobile) client (template) for "Pocket". :)

Screenshots

Shot 1 Shot 2

Overview and Instantiation

This API wrapper works via a PocketClient class. PocketClient objects need to be authenticated prior to making any method calls to retrieve, add or modify pocket items, which are represented by the Models.PocketItem class.

To instantiate a PocketClient object, you can either pass a platform consumer key provided b y Pocket, or provide an AccessToken object which has previously been returned to you from the ObtainAccessToken method on the PocketClient task. See the Authentication section below for more details.

Authentication

This API wrapper is written to emulate the authentication process documented at https://getpocket.com/developer/docs/authentication

Obtain a platform consumer key as per the getpocket api instructions and pass it to the PocketClient "construtor".

Adding items to Pocket

To add a new item to your Pocket, you can call the AddPocketItemAsync method, passing in a Uri for the item you wish to add, for example:

 PocketItem newPocketItem = await _pocketClient.AddPocketItemAsync
(
   new Uri("https://www.theage.com.au/culture/comedy/the-at-home-comedy-festival-20200318-p54bhu.html")
);

Modifying items in Pocket

To modify an existing item in Pocket, you can call the following methods to archive, re-add, mark favorite, un-favorite and delete an item:

bool result;
result = await _pocketClient.ArchivePocketItemAsync(pocketItem);
result = await _pocketClient.ReAddPocketItemAsync(pocketItem);
result = await _pocketClient.MarkFavoritePocketItemAsync(pocketItem);
result = await _pocketClient.UnFavoritePocketItemAsync(pocketItem);
result = await _pocketClient.DeletePocketItemAsync(pocketItem);

Retrieving items from Pocket

To retrieve a list of items in your pocket, there are two options. You can retrieve all the items in your Pocket, or all the modified items in your pocket since the last time you retrieved your items.

To retrieve all items in your Pocket, issue the following code:

List<PocketItem> pocketItems = await _pocketClient.GetPocketItemsAsync();

To retrieve the modified items in your Pocket since your last retrieval, call the same method, but include the DateTime of your last retrieval. All modified items will be retrieved since that date.
It is recommended you primarily use this function, rather than retrieving all the items in your Pocket with each call.

List<PocketItem> pocketItems = await _pocketClient.GetPocketItemsAsync(new DateTime(2020,1,1));

2 words more

The Pocket API available at https://getpocket.com/developer/.

When you go registation, obtain tho consumer keys : Desktop and Mobile.

For x64 target compiling, use Desktop key. For ARM target, use Mobile key. :)

Good luck!

-- [me][e] 2022

multipocket's People

Contributors

mediaexplorer74 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.