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.1.0 examples/digg.rb