Getting Started
-Request a Consumer Key on Pocket.
-Include the PocketSharp namespace and it's associated models (you will need them later):
--
using PocketSharp;
-using PocketSharp.Models;
-
- Initialize PocketClient with:
--
PocketClient _client = new PocketClient("[YOUR_CONSUMER_KEY]", "[YOUR_ACCESS_CODE]");
-
- Do a simple request - e.g. a search for CSS:
-
_client.Search("css").ForEach(
- item => Console.WriteLine(item.ID + " | " + item.Title)
-);
-
- Which will output:
-330361896 | CSS Front-end Frameworks with comparison : By usabli.ca
-345541438 | Editr - HTML, CSS, JavaScript playground
-251743431 | CSS Architecture
-343693149 | CSS3 Transitions - Thank God We Have A Specification!
-...
-
+ Getting Started
+Request a Consumer Key on Pocket.
+Include the PocketSharp namespace and it's associated models (you will need them later):
++
using PocketSharp;
+ using PocketSharp.Models;
+
+ Initialize PocketClient with:
++
PocketClient _client = new PocketClient("[YOUR_CONSUMER_KEY]", "[YOUR_ACCESS_CODE]");
+
+ Do a simple request - e.g. a search for CSS:
+
_client.Search("css").ForEach(
+ item => Console.WriteLine(item.ID + " | " + item.Title)
+ );
+
+ Which will output:
+330361896 | CSS Front-end Frameworks with comparison : By usabli.ca
+ 345541438 | Editr - HTML, CSS, JavaScript playground
+ 251743431 | CSS Architecture
+ 343693149 | CSS3 Transitions - Thank God We Have A Specification!
+ ...
+
- Create an instance
-Constructor:
+Create an instance
+Constructor:
++
PocketClient(string consumerKey, string accessCode = null, Uri callbackUri = null)
+
+
+ consumerKey: The API key
+
+ accessCode: Provide an access code if the user is already authenticated
+
+ callbackUri: The callback URL is called by Pocket after authentication
+
Example:
++
PocketClient _client = new PocketClient(
+ consumerKey: "123498237423498723498723",
+ callbackUri: new Uri("http:⁄⁄ceecore.com"),
+ accessCode: "097809-oi987-izi8-jk98-oiuu89"
+ );
+
+ You can change the Access Code after initialization:
++
_client.AccessCode = "[YOU_ACCESS_CODE]";
+
+
+ Before authentication you will need to provide the callbackUri for authentication requests.
+
+ After authentication you will need to provide the accessCode.
+
Release History
+-
+
- 2013-07-07 v0.3.1 authentication fixes +
- 2013-07-02 v0.3.0 update authentication process +
- 2013-06-27 v0.2.0 add, modify item & modify tags +
- 2013-06-26 v0.1.0 authentication & retrieve functionality +
Used Packages
+-
+
- RestSharp +
- ServiceStack.Text +
Contributors
-
PocketClient(string consumerKey, string accessCode = null, Uri callbackUri = null)
+
+
- consumerKey: The API key
-
- accessCode: Provide an access code if the user is already authenticated
-
- callbackUri: The callback URL is called by Pocket after authentication
-
Example:
--
PocketClient _client = new PocketClient(
- consumerKey: "123498237423498723498723",
- callbackUri: new Uri("http:⁄⁄ceecore.com"),
- accessCode: "097809-oi987-izi8-jk98-oiuu89"
-);
-
- You can change the Access Code after initialization:
--
_client.AccessCode = "[YOU_ACCESS_CODE]";
-
-
- Before authentication you will need to provide the callbackUri for authentication requests.
-
- After authentication you will need to provide the accessCode.
-
Authentication
+Authentication
In order to communicate with a Pocket User, you will need a consumer key (which is generated by creating a new application on Pocket) and an Access Code.
The authentication is a 3-step process:
1) Generate authentication URI
@@ -139,7 +165,13 @@ Note thatGetAccessCode can only be called with an existing req
Without it you would always have to redo the authentication process. -
Retrieve
+ +Retrieve
Get list of all items:
List<PocketItem> items = _client.Retrieve();
@@ -175,7 +207,12 @@ var parameters = new RetrieveParameters()
List items = _client.Retrieve(parameters);
- Add
+ +Add
Adds a new item to your pocket list.
Accepts four parameters, with uri being required.
@@ -192,7 +229,12 @@ Accepts four parameters, with uri being required.
The title can be included for cases where an item does not have a title, which is typical for image or PDF URLs. If Pocket detects a title from the content of the page, this parameter will be ignored.
If you are adding Pocket support to a Twitter client, please send along a reference to the tweet status id (with the tweetID). This allows Pocket to show the original tweet alongside the article.
-Modify
+ +Modify
All Modify methods accept either the itemID (as int) or a PocketItem as parameter.
Archive the specified item:
bool isSuccess = _client.Archive(myPocketItem);
@@ -235,27 +277,7 @@ Accepts four parameters, with uri being required.
bool isSuccess = _client.RenameTag(myPocketItem, "oldTagName", "newTagName");
-
- Release History
-
- - 2013-07-07 v0.3.1 authentication fixes
- - 2013-07-02 v0.3.0 update authentication process
- - 2013-06-27 v0.2.0 add, modify item & modify tags
- - 2013-06-26 v0.1.0 authentication & retrieve functionality
-
- Used Packages
-
- - RestSharp
- - ServiceStack.Text
-
- Contributors
-
- |
-
|
-|---|
-| Tobias Klika @ceee |
-
-
+