Class: Moniker

Inherits:
Object
  • Object
show all
Defined in:
lib/domain-finder/moniker.rb

Overview

Simple class for batch searching domain availability

Constant Summary collapse

INTERNATIONAL_TEXT =
"Select language  Chinese Afrikaans Albanian Arabic Aragonese Armenian Assamese Asturian Avestan Awadhi Azerbaijani Balinese Baluchi Basa Bashkir Basque Belarusian Bengali Bhojpuri Bosnian Bulgarian Burmese Carib Catalan Chechen Chinese Chuvash Coptic Corsican Croatian Czech Danish Divehi Dogri Dutch English Estonian Fijian Finnish French Frisian Gaelic Georgian German Gondi Greek Gujarati Hebrew Hindi Hungarian Icelandic Indic Indonesian Ingush Irish Italian Japanese Javanese Kashmiri Kazakh Khmer Kirghiz Korean Kurdish Lao Latvian Lithuanian Luxembourgish Macedonian Malay Malayalam Maltese Maori Moldavian Nepali Norwegian Oriya Ossetian Panjabi Persian Polish Portuguese Pushto Rajasthani Romanian Russian Samoan Sanskrit Sardinian Serbian Sindhi Sinhalese Slovak Slovenian Somali Spanish Swahili Swedish Syriac Tajik Tamil Telugu Thai Tibetan Turkish Ukrainian Urdu Uzbek Vietnamese Welsh Yiddish"

Class Method Summary collapse

Class Method Details

.find_available(*domains) ⇒ Object



6
7
8
9
# File 'lib/domain-finder/moniker.rb', line 6

def self.find_available *domains
  data = { :cmd => 'check', :scope => 'batch', :domnamelist => domains.join("\n") }
  parse_results SecurePost.post('https://www.moniker.com/pub/DomainCheckBatch', data)
end

.parse_results(html) ⇒ Object



11
12
13
14
15
# File 'lib/domain-finder/moniker.rb', line 11

def self.parse_results html
  ( Hpricot(html) / "td[@style='font-family: verdana; font-size: 8pt;']").map do 
    |td| td.inner_text.gsub('?','').sub(INTERNATIONAL_TEXT,'').strip
  end
end