Coder Social home page Coder Social logo

pinboard's Introduction

The Pinboard Ruby Gem

A Ruby wrapper for the Pinboard API.

Installation

gem install pinboard

Examples

I'm currently exploring two API interfaces:

pinboard = Pinboard::Client.new(:token => 'your_api_token')
posts = pinboard.posts

Your API token can be found on your settings/password page.

or:

posts = Pinboard::Post.all(:username => 'foo', :password => 'bar')

Both examples work.

Passing arguments: (works only for the Client API Interface)

pinboard.posts(:tag => 'ruby') #all posts tagged 'ruby'
pinboard.posts(:tag => 'ruby,pinboard') #all posts tagged 'ruby' and 'pinboard'
pinboard.posts(:start => 20) #starting on the 20th post
pinboard.posts(:results => 20) #return only first 20 matching posts
pinboard.posts(:fromdt => 4.days.ago) #all posts in past 4 days
pinboard.posts(:todt => 4.days.ago) #all posts up to 4 days ago

Adding new posts:

pinboard.add(:url => "http://example.com/", :description => 'Example post')

Future Examples (I don't need them, so I haven't written them)

pinboard.posts(:meta => true) #include meta data in post models

Ruby Support & Continuous Integration

I am using travis-ci.org for continuous integration and support of the following rubies in rvm:

  • 1.9.3
  • 2.0.0
  • 2.1
  • 2.2
  • jruby
  • ruby-head

Build Status

Code Climate

Links

How to Contribute

If you find what looks like a bug:

  • Check the GitHub issue tracker to see if anyone else has had the same issue.
  • If you don’t see anything, create an issue with information on how to reproduce it.

If you want to contribute an enhancement or a fix:

  • Fork the project on github.
  • Make your changes with specs.
  • Commit the changes without messing with the Rakefile, VERSION, or history.
  • Send me a pull request.

TODO

License

See MIT-LICENSE for details.

Copyright (c) 2011 Ryan Walker.
Copyright (c) 2013-2016 Jan-Erik Rediger.

pinboard's People

Contributors

646b avatar amisai avatar badboy avatar blackerby avatar cdeutsch avatar franktisellano avatar hng avatar jshawl avatar mguterl avatar nerab avatar ryw avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

pinboard's Issues

Extended description is undefined

I've noticed that I can't seem to get any extended descriptions on any bookmarks using the posts.all method. I've noticed that there's no space before :extended in the source code, although I doubt that is the problem.

Here is what I get, even though when I go to https://api.pinboard.in/v1/posts/all I can get the extended descriptions.

1.9.3-p362 :005 > pinboard.posts
 => [#<struct Pinboard::Post href="http://www.gizmodo.co.uk/2012/12/21-inch-imac-2012-thin-review-looks-only-get-you-so-far/", description="\"21-inch iMac 2012 (Thin) Review: Looks Only Get's You So Far", tag=[], time=2012-12-28 22:32:50 UTC>, #<struct Pinboard::Post href="http://www.theverge.com/2012/12/28/3807734/senate-votes-to-extend-fisa-amendments-warrantless-wiretap", description="Senate votes to let the NSA keep spying on you without a warrant until 2017", tag=["theverge", "privacy"], time=2012-12-28 22:31:46 UTC>] 
1.9.3-p362 :006 > pinboard.posts.each do |post|
1.9.3-p362 :007 >     puts post.extended
1.9.3-p362 :008?>   end
NoMethodError: undefined method `extended' for #<Pinboard::Post:0x007ffeec35ee48>
        from (irb):7:in `block in irb_binding'
        from (irb):6:in `each'
        from (irb):6
        from /Users/alexforey/.rvm/rubies/ruby-1.9.3-p362/bin/irb:16:in `<main>'

Return posts in a date range

I'm wondering if it's possible to return posts for a given date range. Perhaps something like

pinboard.posts(:fromdt => start_date, :todt => end_date)

I looked through the source but could not find where those parameters were being implemented. Thanks for any insight you can provide.

Update gem on rubygems.org

Hi, the latest update on rubygems.org is May 2, 2013. Would you update this gem on rubygems.org?

Thanks.

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.