Skip to content

Commit

Permalink
Merge pull request zachwill#12 from domainr/master
Browse files Browse the repository at this point in the history
domai.nr -> domainr.com
  • Loading branch information
zachwill committed Oct 18, 2014
2 parents 341b0f7 + bca1243 commit ca6bfee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dom
[![Build Status](https://secure.travis-ci.org/myusuf3/dom.png?branch=master)](http://travis-ci.org/myusuf3/dom)

An easy-to-use command line utility for checking domain name
availability using [Domainr's JSON API](http://domai.nr/api/docs/json).
availability using [Domainr's JSON API](https://domainr.com/api/docs/json).

![](http://i.imgur.com/oijaG.png)

Expand Down
4 changes: 2 additions & 2 deletions domainr/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def environment(self):
def search(self, env):
"""Use domainr to get information about domain names."""
if env.info:
url = "https://domai.nr/api/json/info"
url = "https://domainr.com/api/json/info"
else:
url = "https://domai.nr/api/json/search"
url = "https://domainr.com/api/json/search"
query = " ".join(env.query)
json_data = requests.get(url, params={'q': query, 'client_id': 'python_zachwill'})
data = self.parse(json_data.content, env)
Expand Down
4 changes: 2 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from mock import MagicMock
from domainr import Domain

content = '{"query":"google","results":[{"domain":"google","host":"","subdomain":"google","path":"","availability":"tld","register_url":"http://domai.nr/google/register"},{"domain":"google.com","host":"","subdomain":"google.com","path":"","availability":"taken","register_url":"http://domai.nr/google.com/register"},{"domain":"google.net","host":"","subdomain":"google.net","path":"","availability":"taken","register_url":"http://domai.nr/google.net/register"},{"domain":"google.org","host":"","subdomain":"google.org","path":"","availability":"taken","register_url":"http://domai.nr/google.org/register"},{"domain":"google.co","host":"","subdomain":"google.co","path":"","availability":"taken","register_url":"http://domai.nr/google.co/register"},{"domain":"goo.gle","host":"","subdomain":"goo.gle","path":"","availability":"unavailable","register_url":"http://domai.nr/goo.gle/register"},{"domain":"goo.gl","host":"","subdomain":"goo.gl","path":"/e","availability":"unavailable","register_url":"http://domai.nr/goo.gl/register"},{"domain":"go.gle","host":"","subdomain":"go.gle","path":"","availability":"unavailable","register_url":"http://domai.nr/go.gle/register"},{"domain":"goog","host":"","subdomain":"goog","path":"/le","availability":"tld","register_url":"http://domai.nr/goog/register"},{"domain":"go.gl","host":"","subdomain":"go.gl","path":"/e","availability":"unavailable","register_url":"http://domai.nr/go.gl/register"},{"domain":"g.gle","host":"","subdomain":"g.gle","path":"","availability":"unavailable","register_url":"http://domai.nr/g.gle/register"},{"domain":"goo","host":"","subdomain":"goo","path":"/gle","availability":"tld","register_url":"http://domai.nr/goo/register"},{"domain":"g.gl","host":"","subdomain":"g.gl","path":"/e","availability":"unavailable","register_url":"http://domai.nr/g.gl/register"},{"domain":"gg","host":"","subdomain":"gg","path":"/le","availability":"tld","register_url":"http://domai.nr/gg/register"}]}'
content = '{"query":"google","results":[{"domain":"google","host":"","subdomain":"google","path":"","availability":"tld","register_url":"https://domainr.com/google/register"},{"domain":"google.com","host":"","subdomain":"google.com","path":"","availability":"taken","register_url":"https://domainr.com/google.com/register"},{"domain":"google.net","host":"","subdomain":"google.net","path":"","availability":"taken","register_url":"https://domainr.com/google.net/register"},{"domain":"google.org","host":"","subdomain":"google.org","path":"","availability":"taken","register_url":"https://domainr.com/google.org/register"},{"domain":"google.co","host":"","subdomain":"google.co","path":"","availability":"taken","register_url":"https://domainr.com/google.co/register"},{"domain":"goo.gle","host":"","subdomain":"goo.gle","path":"","availability":"unavailable","register_url":"https://domainr.com/goo.gle/register"},{"domain":"goo.gl","host":"","subdomain":"goo.gl","path":"/e","availability":"unavailable","register_url":"https://domainr.com/goo.gl/register"},{"domain":"go.gle","host":"","subdomain":"go.gle","path":"","availability":"unavailable","register_url":"https://domainr.com/go.gle/register"},{"domain":"goog","host":"","subdomain":"goog","path":"/le","availability":"tld","register_url":"https://domainr.com/goog/register"},{"domain":"go.gl","host":"","subdomain":"go.gl","path":"/e","availability":"unavailable","register_url":"https://domainr.com/go.gl/register"},{"domain":"g.gle","host":"","subdomain":"g.gle","path":"","availability":"unavailable","register_url":"https://domainr.com/g.gle/register"},{"domain":"goo","host":"","subdomain":"goo","path":"/gle","availability":"tld","register_url":"https://domainr.com/goo/register"},{"domain":"g.gl","host":"","subdomain":"g.gl","path":"/e","availability":"unavailable","register_url":"https://domainr.com/g.gl/register"},{"domain":"gg","host":"","subdomain":"gg","path":"/le","availability":"tld","register_url":"https://domainr.com/gg/register"}]}'
parse_false_response = u'\x1b[31m\u2717\x1b[0m google\n\x1b[31m\u2717\x1b[0m google.com\n\x1b[31m\u2717\x1b[0m google.net\n\x1b[31m\u2717\x1b[0m google.org\n\x1b[31m\u2717\x1b[0m google.co\n\x1b[31m\u2717\x1b[0m goo.gle\n\x1b[31m\u2717\x1b[0m goo.gl\n\x1b[31m\u2717\x1b[0m go.gle\n\x1b[31m\u2717\x1b[0m goog\n\x1b[31m\u2717\x1b[0m go.gl\n\x1b[31m\u2717\x1b[0m g.gle\n\x1b[31m\u2717\x1b[0m goo\n\x1b[31m\u2717\x1b[0m g.gl\n\x1b[31m\u2717\x1b[0m gg'
info_data = {'domain': 'google', 'whois_url': 'http://domai.nr/google/whois', 'subregistration_permitted': False, 'register_url': 'http://domai.nr/google/register', 'tld': {'domain': 'google', 'wikipedia_url': 'http://domai.nr/google/wikipedia', 'iana_url': 'http://domai.nr/google/iana'}, 'registrars': [], 'subdomains': [], 'host': '', 'path': '', 'www_url': 'http://domai.nr/google/www', 'query': 'google', 'subdomain': 'google', 'domain_idna': 'google', 'availability': 'tld'}
info_data = {'domain': 'google', 'whois_url': 'https://domainr.com/google/whois', 'subregistration_permitted': False, 'register_url': 'https://domainr.com/google/register', 'tld': {'domain': 'google', 'wikipedia_url': 'https://domainr.com/google/wikipedia', 'iana_url': 'https://domainr.com/google/iana'}, 'registrars': [], 'subdomains': [], 'host': '', 'path': '', 'www_url': 'https://domainr.com/google/www', 'query': 'google', 'subdomain': 'google', 'domain_idna': 'google', 'availability': 'tld'}

class TestDomain(unittest.TestCase):

Expand Down

0 comments on commit ca6bfee

Please sign in to comment.