Skip to content
A Ruby client for the Pinboard.in API http://phlippers.net/pinboard_api
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
spec
.gitignore
.ruby-version
Gemfile
Guardfile
LICENSE
README.md
Rakefile
pinboard_api.gemspec

README.md

PinboardApi

Description

A Ruby API client for Pinboard.in, the bookmarking website for introverted people in a hurry.

This client aims to cover all of the Pinboard API v1.

Requirements

  • This library requires Ruby 1.9.2 or newer.
  • You must have a paid Pinboard account to use the API. It is a great service and you can signup here if you don't already have an account.

Installation

Add this line to your application's Gemfile:

gem "pinboard_api"

And then execute:

$ bundle

Or install it yourself as:

$ gem install pinboard_api

Usage

The PinboardApi namespace implements the 3 primary object types: Post, Tag, and User.

Post

  • posts/update - Check to see when a user last posted an item.
PinboardApi::Post.update
# => 2012-07-07 04:18:28 UTC
  • posts/add - add a new bookmark
  • posts/delete - delete an existing bookmark
  • posts/get - get bookmark for a single date, or fetch specific items by URL
PinboardApi::Post.find(tag: "test")
# => [#<PinboardApi::Post:0x007fdce4547388 @description="Test.com – Certification Program Management – Create Online Tests with This Authoring, Management, Training and E-Learning Software", @extended="", @hash="dbb720d788ffaeb0afb7572104072f4a", @href="http://test.com/", @tags="test junk", @time="2012-07-07T04:18:28Z">, ...]

PinboardApi::Post.find(hash: "dbb720d788ffaeb0afb7572104072f4a", meta: "yes")
# => [#<PinboardApi::Post:0x007fac2b9d6690 @description="Test.com – Certification Program Management – Create Online Tests with This Authoring, Management, Training and E-Learning Software", @extended="", @hash="dbb720d788ffaeb0afb7572104072f4a", @href="http://test.com/", @meta="73b192512e3e4829806f5eee0a6b456d", @tags="test junk", @time="2012-07-07T04:18:28Z">, ...]

PinboardApi::Post.find(dt: Date.parse("2012-07-07"))
# => [#<PinboardApi::Post:0x007fac2ba0fdf0 @description="Test.com – Certification Program Management – Create Online Tests with This Authoring, Management, Training and E-Learning Software", @extended="", @hash="dbb720d788ffaeb0afb7572104072f4a", @href="http://test.com/", @meta=nil, @tags="test junk", @time="2012-07-07T04:18:28Z">, ...]

Tag

PinboardApi::Tag.all
# => [#<PinboardApi::Tag:0x007fdce41f4f00 @name="leadership", @count=1>, #<PinboardApi::Tag:0x007fdce41f4e10 @name="date", @count=1>, ... ]

PinboardApi::Tag.find("leadership")
# => #<PinboardApi::Tag:0x007fdce4827eb8 @name="leadership", @count=1>
tag = PinboardApi::Tag.find("foo")
# => #<PinboardApi::Tag:0x007fdce45f56e0 @name="foo", @count=1>

tag.delete
# => #<PinboardApi::Tag:0x007fdce45f56e0 @name="foo", @count=1>

tag = PinboardApi::Tag.find("foo")
# => nil
tag = PinboardApi::Tag.find("foo")
# => #<PinboardApi::Tag:0x007fdce461bcc8 @name="foo", @count=1>

tag.rename("foo2")
# => #<PinboardApi::Tag:0x007fdce4c4bb48 @name="foo2", @count=1>

User

  • user/secret - get the secret RSS token (allows viewing user's private RSS feeds)
PinboardApi::User.secret
# => "c3b0f4073ea37c4b1df5"

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

pinboard_api

Something went wrong with that request. Please try again.