Sha256: 3c498561c87dfd4eef0809ed8de93698620087710aa73b6050f57081c7cd8c6f

Contents?: true

Size: 497 Bytes

Versions: 4

Compression:

Stored size: 497 Bytes

Contents

require 'open-uri'

module Stratify
  module GitHub
    class Collector < Stratify::Collector
      source "GitHub"

      configuration_fields :username => {:type => :string}

      def activities
        activities_from_api.map do |activity_in_api_format|
          Stratify::GitHub::Activity.from_api_hash(activity_in_api_format)
        end
      end

      private

      def activities_from_api
        JSON.parse open("https://github.com/#{username}.json").read
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
stratify-github-0.1.3 lib/stratify-github/collector.rb
stratify-github-0.1.2 lib/stratify-github/collector.rb
stratify-github-0.1.1 lib/stratify-github/collector.rb
stratify-github-0.1 lib/stratify-github/collector.rb