-
Notifications
You must be signed in to change notification settings - Fork 4
/
example.rb
executable file
·38 lines (29 loc) · 892 Bytes
/
example.rb
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
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'inwx-domrobot'
require 'pp'
# Get your credentials from a safe place when using in production
user = ''
pass = ''
domrobot = INWX::Domrobot.new
result = domrobot.set_language('en').
# use the OTE endpoint
use_ote.
# or use the LIVE endpoint instead
# use_live.
# use the JSON-RPC API
use_json.
# or use the XML-RPC API instead
# use_xml.
# output everything you're sending and receiving in JSON pretty print
show_debug(true).
# optional parameter: shared_secret for 2 factor auth (Base32 secret key)
login(username: user, password: pass)
object = 'domain'
method = 'check'
params = { domain: 'mydomain.com' }
if result['code'] == 1000
result = domrobot.call(object, method, params)
domrobot.logout
end
pp result