Git Product home page Git Product logo

pinboard.net's Introduction

Pinboard.net

A fully featured C# wrapper for the pinboard.in API.

Installation

PM> Install-Package pinboard.net

Since this is written atop .Net Standard 1.4, it will run on the following platforms:

  • .NET Core 1.0
  • .NET Framework 4.6.1
  • Mono 4.6
  • Xamarin.iOS 10.0
  • Xamarin.Android 7.0
  • Universal Windows Platform 10

Usage

To start, retrieve the Pinboard API Token from the password page on the website.

The class that starts it all is PinboardAPI. It implements IDisposable and is best used within an using block like so:

using (var pb = new PinboardAPI(apiToken))
{
  // ...
}

This internally creates and reuses one instance of HttpClient per instance of PinboardAPI.

The pb object can now be used to make calls to the Pinboard API

Posts

Update

Returns the most recent time a bookmark was added, updated or deleted. Use this before calling All to see if the data has changed since the last fetch.

pb.Posts.GetLastUpdate()

Add a bookmark

var bookmark = new Bookmark
{
  Url = "http://linkur.co.in",
  Description = "Bookmarking for groups!",
  Extended = "",
  Tags = new List<string> { "bookmarking", "web", "tools" },
  dt = DateTime.Now,
  Shared = true,
  ToRead = false
};

pb.Posts.Add(bookmark);

Update a bookmark

// Get the bookmark first
var bookmark = pb.Posts.All().FirstOrDefault();

bookmark.Extended = "Nothing does group bookmarking better";
bookmark.Tags.Add("free");

pb.Posts.Update(bookmark)

Delete a bookmark

pb.Posts.Delete("http://linkur.co.in");

Get posts matching parameters

Returns one or more posts on a single day matching the arguments. If no date or url is given, date of most recent bookmark will be used.

It can be filtered by:

  • Tags
  • Date
  • URL
pb.Posts.Get();

Get recent bookmarks

Returns a list of the user's most recent posts, filtered by tag.

pb.Posts.Recent(tags: new List<string> { "programming", "dotnet" });

Get all bookmarks

Returns all bookmarks in the user's account.

It can be filtered by:

  • Tags
  • Offset
  • Number of results
  • From date
  • To date
pb.Posts.All()

Tags

Get all tags

This also returns the number of times each tag has been used

pb.Tags.Get()

Get suggested tags for a URL

pb.Posts.Suggest("https://linkur.co.in")

Delete a tag

pb.Tags.Delete("prugramming");

Rename a tag

pb.Tags.Rename("pithon", "python");

Users

Get secret

Returns the user's secret RSS key (for viewing private feeds)

pb.Users.Secret()

Get API Token

Returns the user's API token (for making API calls without a password)

pb.Users.ApiToken()

Notes

Get all notes

pb.Notes.List()

Get details of a single note

pb.Notes.Note("foobar")

pinboard.net's People

Contributors

jciechowski avatar lgirvin avatar shrayasr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pinboard.net's Issues

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.