Sha256: 015c11b9afe07dd134efedacfda993a9eafeefd21e46f89506ae6c0b0f675eaa

Contents?: true

Size: 446 Bytes

Versions: 41

Compression:

Stored size: 446 Bytes

Contents

require "rubygems"
require "bundler/setup"
require "api_client"

module Digg

  class Base < ApiClient::Base

    always do
      endpoint "http://services.digg.com"
      params   :type => 'json'
    end

  end

  class Collection < Base

    def self.diggs
      Digg.build get('/2.0/digg.getAll')['diggs']
    end

  end

  class Digg < Base
  end

end

Digg::Collection.diggs.each do |digg|
  puts "#{digg.user.name}: #{digg.item.title}"
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
api_client-0.5.24 examples/digg.rb
api_client-0.5.22 examples/digg.rb
api_client-0.5.21 examples/digg.rb
api_client-0.5.20 examples/digg.rb
api_client-0.5.19 examples/digg.rb
api_client-0.5.18 examples/digg.rb
api_client-0.5.17 examples/digg.rb
api_client-0.5.16 examples/digg.rb
api_client-0.5.15 examples/digg.rb
api_client-0.5.14 examples/digg.rb
api_client-0.5.13 examples/digg.rb
api_client-0.5.12 examples/digg.rb
api_client-0.5.11 examples/digg.rb
api_client-0.5.9 examples/digg.rb
api_client-0.5.7 examples/digg.rb
api_client-0.5.6 examples/digg.rb
api_client-0.5.5 examples/digg.rb
api_client-0.5.4 examples/digg.rb
api_client-0.5.3 examples/digg.rb
api_client-0.5.2 examples/digg.rb