Class: Delicious
Overview
Documentation:
http://delicious.com/help/api
Class Method Summary collapse
- .posts_all(options = {}) ⇒ Object
- .posts_since(time_string) ⇒ Object
- .posts_update ⇒ Object
- .valid_auth? ⇒ Boolean
Class Method Details
.posts_all(options = {}) ⇒ Object
21 22 23 24 |
# File 'lib/delicious-cli/api.rb', line 21 def self.posts_all(={}) result = get('/posts/all', :query=>) [result["posts"]["post"]].flatten # ensure it's an array end |
.posts_since(time_string) ⇒ Object
26 27 28 29 30 |
# File 'lib/delicious-cli/api.rb', line 26 def self.posts_since(time_string) $log.debug "Retrieving links newer than #{time_string}" results = posts_all(:fromdt=>time_string) results.select { |r| r["time"] != time_string } end |
.posts_update ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/delicious-cli/api.rb', line 12 def self.posts_update result = get('/posts/update') if result["update"] result["update"]["time"] else nil end end |
.valid_auth? ⇒ Boolean
32 33 34 |
# File 'lib/delicious-cli/api.rb', line 32 def self.valid_auth? not posts_update.nil? end |