domain_finder 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/domain_finder.rb +14 -3
- metadata +3 -3
- data/lib/domain_finder/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64b5dfaa01f92deae4a91b8c162896cf65612657
|
4
|
+
data.tar.gz: 2d6d3f47bd0b966a9a6d703f3a34138950d7a889
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2543674d8fae1575f3f39743e4931f3f62cb1a2ad8052a1d766a8cebdcb311ef7a216fb67e148f3332449623db9905dd37c64e16984dd8033a7710ee3698cdf2
|
7
|
+
data.tar.gz: de37ffe0ca8367fe44d39e6dd874167a7bd98a0a21b8c7ba355146be1e95aca8a40074d085ea0c0fe54beb9740ce535aec6cff0690663bc9508d39d65a150ec6
|
data/lib/domain_finder.rb
CHANGED
@@ -1,12 +1,18 @@
|
|
1
|
-
require "domain_finder/version"
|
2
1
|
require 'json'
|
3
2
|
require 'net/http'
|
4
3
|
|
4
|
+
# Namespace for domain_finder gem
|
5
5
|
module DomainFinder
|
6
6
|
|
7
|
+
# The URL of the domain registrar
|
7
8
|
URL = 'https://domai.nr/api/json/search'
|
8
9
|
|
9
10
|
class << self
|
11
|
+
|
12
|
+
# Searches for the availability of one or more domains by using a domain registrar API.
|
13
|
+
#
|
14
|
+
# @param domains [Array<String>] One or more domain names
|
15
|
+
# @return [Array<String>] Domain availability results
|
10
16
|
def search(domains)
|
11
17
|
|
12
18
|
results = []
|
@@ -40,8 +46,13 @@ module DomainFinder
|
|
40
46
|
|
41
47
|
private
|
42
48
|
|
43
|
-
|
44
|
-
|
49
|
+
# Parses JSON response from API call and converts it to an array of human-readable strings.
|
50
|
+
#
|
51
|
+
# @private
|
52
|
+
# @param json_string [String] A json-parsable string
|
53
|
+
# @return [Array<String>] An array of human-readable strings
|
54
|
+
def parse_results(json_string)
|
55
|
+
json = JSON.parse(json_string)
|
45
56
|
json['results'].map do |result|
|
46
57
|
case result['availability']
|
47
58
|
when 'available'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: domain_finder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jade McGough
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: vcr
|
@@ -75,7 +75,6 @@ extra_rdoc_files: []
|
|
75
75
|
files:
|
76
76
|
- bin/domain
|
77
77
|
- lib/domain_finder.rb
|
78
|
-
- lib/domain_finder/version.rb
|
79
78
|
homepage: https://github.com/zetsubo/domain_finder
|
80
79
|
licenses:
|
81
80
|
- MIT
|
@@ -101,3 +100,4 @@ signing_key:
|
|
101
100
|
specification_version: 4
|
102
101
|
summary: Domain availability checker
|
103
102
|
test_files: []
|
103
|
+
has_rdoc:
|