Class: CurseClient::Feed

Inherits:
Object
  • Object
show all
Defined in:
lib/curse_client/feed.rb

Constant Summary collapse

DEFAULT_URL =
"http://clientupdate-v6.cursecdn.com/feed/addons/432/v10/"
COMPLETE_URL =
DEFAULT_URL + "complete.json.bz2"
HOURLY_URL =
DEFAULT_URL + "hourly.json.bz2"

Instance Method Summary collapse

Constructor Details

#initialize(url = DEFAULT_URL) ⇒ Feed

Returns a new instance of Feed.



12
13
14
# File 'lib/curse_client/feed.rb', line 12

def initialize(url = DEFAULT_URL)
  @url = url
end

Instance Method Details

#completeObject



28
29
30
# File 'lib/curse_client/feed.rb', line 28

def complete
  download_bz2(COMPLETE_URL)
end

#complete_timestampObject



24
25
26
# File 'lib/curse_client/feed.rb', line 24

def complete_timestamp
  get_timestamp(COMPLETE_URL)
end

#hourlyObject



20
21
22
# File 'lib/curse_client/feed.rb', line 20

def hourly
  download_bz2(HOURLY_URL + "?t=#{hourly_timestamp}")
end

#hourly_timestampObject



16
17
18
# File 'lib/curse_client/feed.rb', line 16

def hourly_timestamp
  get_timestamp(HOURLY_URL)
end