-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclient.rb
More file actions
43 lines (32 loc) · 846 Bytes
/
client.rb
File metadata and controls
43 lines (32 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
require 'json'
require 'rest-client'
module NP
class Client
def initialize(game_id:, auth:)
@game_id = game_id
@auth = auth
end
def get
response = RestClient.post(url, body, headers)
Response.new(response.body)
end
private
def url
"https://np.ironhelmet.com/trequest/order"
end
def headers
{
content_length: 75,
content_type: "application/x-www-form-urlencoded; charset=UTF-8",
referer: "https://np.ironhelmet.com/game/#{@game_id}",
origin: "https://np.ironhelmet.com",
user_agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6)",
x_requested_with: "XMLHttpRequest",
cookie: @auth
}
end
def body
"type=order&order=full_universe_report&version=&game_number=#{@game_id}"
end
end
end