pinboard 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/README.md +15 -7
- data/lib/pinboard/client.rb +7 -3
- data/pinboard.gemspec +2 -2
- data/spec/pinboard/client_spec.rb +1 -1
- metadata +4 -4
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -11,23 +11,31 @@ Examples
|
|
11
11
|
|
12
12
|
I'm currently exploring two API interfaces:
|
13
13
|
|
14
|
+
```ruby
|
14
15
|
pinboard = Pinboard::Client.new(:username => 'foo', :password => 'bar')
|
15
16
|
posts = pinboard.posts
|
16
|
-
|
17
|
+
```
|
17
18
|
or:
|
18
19
|
|
20
|
+
```ruby
|
19
21
|
posts = Pinboard::Post.all(:username => 'foo', :password => 'bar')
|
20
|
-
|
22
|
+
```
|
21
23
|
Both examples work.
|
22
24
|
|
23
|
-
|
24
|
-
--------------------------------------------------------------
|
25
|
+
Passing arguments: (works only for the Client API Interface)
|
25
26
|
|
26
|
-
|
27
|
+
```ruby
|
28
|
+
pinboard.posts(:tag => 'ruby') #all posts tagged 'ruby'
|
29
|
+
pinboard.posts(:tag => 'ruby,pinboard') #all posts tagged 'ruby' and 'pinboard'
|
27
30
|
pinboard.posts(:start => 20) #starting on the 20th post
|
28
31
|
pinboard.posts(:results => 20) #return only first 20 matching posts
|
29
|
-
pinboard.posts(:
|
30
|
-
pinboard.posts(:
|
32
|
+
pinboard.posts(:fromdt => 4.days.ago) #all posts in past 4 days
|
33
|
+
pinboard.posts(:todt => 4.days.ago) #all posts up to 4 days ago
|
34
|
+
```
|
35
|
+
|
36
|
+
Future Examples (I don't need them, so I haven't written them)
|
37
|
+
--------------------------------------------------------------
|
38
|
+
|
31
39
|
pinboard.posts(:meta => true) #include meta data in post models
|
32
40
|
|
33
41
|
Ruby Support & Continuous Integration
|
data/lib/pinboard/client.rb
CHANGED
@@ -10,10 +10,14 @@ module Pinboard
|
|
10
10
|
:password => options[:password] }
|
11
11
|
end
|
12
12
|
|
13
|
-
def posts
|
14
|
-
|
13
|
+
def posts(params={})
|
14
|
+
options = {}
|
15
|
+
options[:basic_auth] = @auth
|
16
|
+
options[:query] = params
|
15
17
|
posts = self.class.get('/posts/all', options)['posts']['post']
|
16
|
-
posts.
|
18
|
+
if !posts.nil?
|
19
|
+
posts.map { |p| Post.new(Util.symbolize_keys(p)) }
|
20
|
+
end
|
17
21
|
end
|
18
22
|
end
|
19
23
|
end
|
data/pinboard.gemspec
CHANGED
@@ -11,8 +11,8 @@ Gem::Specification.new do |s|
|
|
11
11
|
|
12
12
|
s.add_runtime_dependency 'httparty', '~> 0.7'
|
13
13
|
s.name = 'pinboard'
|
14
|
-
s.version = '0.0.
|
15
|
-
s.date = '2011-
|
14
|
+
s.version = '0.0.3'
|
15
|
+
s.date = '2011-12-14'
|
16
16
|
s.summary = "Ruby wrapper for the Pinboard API"
|
17
17
|
s.description = "Ruby wrapper for the Pinboard API"
|
18
18
|
s.authors = ["Ryan Waker"]
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pinboard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Waker
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-12-14 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: yard
|