The domain provided is invalid #19

Closed
rezaalavi opened this Issue Apr 3, 2012 · 2 comments

Projects

None yet

2 participants

@rezaalavi

A simple query for google comes back with a invalid domain error:
PageRankr.backlinks("www.google.com", :google, :bing)

PageRankr::DomainInvalid: The domain provided is invalid.
from /home/reza/.rvm/gems/ruby-1.9.2-p290/gems/PageRankr-3.1.2/lib/page_rankr/site.rb:15:in rescue in initialize'
from /home/reza/.rvm/gems/ruby-1.9.2-p290/gems/PageRankr-3.1.2/lib/page_rankr/site.rb:10:in
initialize'
from /home/reza/.rvm/gems/ruby-1.9.2-p290/gems/PageRankr-3.1.2/lib/page_rankr.rb:12:in new'
from /home/reza/.rvm/gems/ruby-1.9.2-p290/gems/PageRankr-3.1.2/lib/page_rankr.rb:12:in
backlinks'
from (irb):3
from /home/reza/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `

'

@blatyo
Owner

The issue is that you need to specify a protocol (i.e. http://www.google.com). However, the docs do not state that, so I'll leave this ticket open until I fix that. You can see the issue below:

>> u = URI.parse("www.google.com")
=> #<URI::Generic:0x000001009b9ca8 URL:www.google.com>
>> u.host
=> nil
>> u2 = URI.parse("http://www.google.com")
=> #<URI::HTTP:0x000001009a59d8 URL:http://www.google.com>
>> u2.host
=> "www.google.com"
@rezaalavi

Thanks that fixed the problem

@rezaalavi rezaalavi closed this Apr 6, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment