Created
August 8, 2012 05:04
-
-
Save rboyd/3292230 to your computer and use it in GitHub Desktop.
namecheap api via httparty
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yaml' | |
require 'httparty' | |
settings = YAML::load_file(File.dirname(File.expand_path(__FILE__)) + '/namecheap.yml') | |
username = settings['namecheap']['user'] | |
api_key = settings['namecheap']['api_key'] | |
request_string = "https://api.namecheap.com/xml.response" | |
command = 'namecheap.domains.dns.getEmailForwarding' | |
ip_addr = '' | |
domain = '' | |
options = { query: { ApiUser: username, | |
UserName: username, | |
ApiKey: api_key, | |
Command: command, | |
ClientIp: ip_addr, | |
DomainName: domain } } | |
res = HTTParty.get request_string, options |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment