Class: Delicious

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/delicious-cli/api.rb

Overview

Documentation:

http://delicious.com/help/api

Class Method Summary collapse

Class Method Details

.posts_all(options = {}) ⇒ Object



21
22
23
24
# File 'lib/delicious-cli/api.rb', line 21

def self.posts_all(options={})
  result = get('/posts/all', :query=>options)
  [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_updateObject



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

Returns:

  • (Boolean)


32
33
34
# File 'lib/delicious-cli/api.rb', line 32

def self.valid_auth?
  not posts_update.nil?
end