Class: TF2R::API

Inherits:
Object
  • Object
show all
Defined in:
lib/tf2r/api.rb

Overview

This class handles interaction with TF2R’s “API”, which is really just an open endpoint located at tf2r.com/job.php, in use all over the site for dynamically updating pages.

Constant Summary collapse

HOST =
'http://tf2r.com'
ENDPOINT =
'/job.php'
MAX_ENTRY_RESPONSE_COUNT =

newentry on a checkraffle job can only return up to 2500 entries. This is a problem for any raffles with a maximum entries greater than 2500.

2500

Class Method Summary collapse

Class Method Details

.raffle_info(link_snippet) ⇒ Array

Queries the API for information about a raffle.



28
29
30
31
32
# File 'lib/tf2r/api.rb', line 28

def self.raffle_info(link_snippet)
  params = {checkraffle: true, rid: link_snippet[1..-1],
            lastentrys: 0, lastchat: 0}
  request(params)['message']
end