Skip to content

Commit

Permalink
Update yahoo lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
blatyo committed Jul 18, 2014
1 parent 527ff71 commit e0a3f88
Show file tree
Hide file tree
Showing 10 changed files with 18,538 additions and 23,519 deletions.
10 changes: 5 additions & 5 deletions lib/page_rankr/backlinks/yahoo.rb
Expand Up @@ -4,22 +4,22 @@ module PageRankr
class Backlinks
class Yahoo
include Backlink

def url
"http://search.yahoo.com/search"
end

def params
{:p => "inbody:#{tracked_url}"}
end

def xpath
"//span[@id='resultCount']/text()"
"//div[@id='pg']/span/text()"
end

def name
:backlinks_yahoo
end
end
end
end
end
10 changes: 5 additions & 5 deletions lib/page_rankr/indexes/yahoo.rb
Expand Up @@ -4,22 +4,22 @@ module PageRankr
class Indexes
class Yahoo
include Index

def url
"http://search.yahoo.com/search"
end

def params
{:p => "site:#{tracked_url}"}
end

def xpath
"//span[@id='resultCount']/text()"
"//div[@id='pg']/span/text()"
end

def name
:indexes_yahoo
end
end
end
end
end
356 changes: 178 additions & 178 deletions spec/fixtures/vcr_cassettes/alexa_ranks_edge_case_1.yml

Large diffs are not rendered by default.

6,899 changes: 1,597 additions & 5,302 deletions spec/fixtures/vcr_cassettes/failure_backlinks.yml

Large diffs are not rendered by default.

6,902 changes: 1,573 additions & 5,329 deletions spec/fixtures/vcr_cassettes/failure_indexes.yml

Large diffs are not rendered by default.

335 changes: 164 additions & 171 deletions spec/fixtures/vcr_cassettes/failure_ranks.yml

Large diffs are not rendered by default.

13,716 changes: 7,503 additions & 6,213 deletions spec/fixtures/vcr_cassettes/success_backlinks.yml

Large diffs are not rendered by default.

13,097 changes: 7,190 additions & 5,907 deletions spec/fixtures/vcr_cassettes/success_indexes.yml

Large diffs are not rendered by default.

690 changes: 302 additions & 388 deletions spec/fixtures/vcr_cassettes/success_ranks.yml

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions spec/page_rankr_spec.rb
Expand Up @@ -4,7 +4,7 @@
match do |actual|
expected === actual
end

failure_message_for_should do |actual|
"expected that #{actual} would be in #{expected}"
end
Expand All @@ -19,7 +19,7 @@
@symbol = :>=
@expected = expected
end

chain :> do |expected|
@symbol = :>
@expected = expected
Expand All @@ -43,7 +43,7 @@
describe PageRankr do
describe "#rank_trackers" do
subject{ PageRankr.rank_trackers }

it{ should include(:alexa_us) }
it{ should include(:alexa_global) }
it{ should include(:google) }
Expand All @@ -57,7 +57,7 @@
PageRankr.ranks("http://www.google.com")
end
end

it{ should have_key(:alexa_us) }
it{ should have_key(:alexa_global) }
it{ should have_key(:alexa_country) }
Expand All @@ -72,14 +72,14 @@
it{ subject[:moz_rank].should be_in(5..9) }
it{ subject[:page_authority].should be_in(90..99) }
end

describe "failure" do
subject do
VCR.use_cassette(:failure_ranks, :record => :new_episodes) do
PageRankr.ranks("http://please-dont-register-a-site-that-breaks-this-test.com")
end
end

it{ should have_key(:alexa_us) }
it{ should have_key(:alexa_global) }
it{ should have_key(:alexa_country) }
Expand All @@ -95,24 +95,24 @@
it{ subject[:page_authority].should == 1 }
end
end

describe "#backlink_trackers" do
subject{ PageRankr.backlink_trackers }

it{ should include(:alexa) }
it{ should include(:bing) }
it{ should include(:google) }
it{ should include(:yahoo) }
end

describe "#backlinks" do
describe "success" do
subject do
VCR.use_cassette(:success_backlinks, :record => :new_episodes) do
PageRankr.backlinks("http://www.google.com")
end
end

PageRankr.backlink_trackers.each do |tracker|
it{ should have_key(tracker) }

Expand All @@ -121,14 +121,14 @@
end
end
end

describe "failure" do
subject do
VCR.use_cassette(:failure_backlinks, :record => :new_episodes) do
PageRankr.backlinks("http://please-dont-register-a-site-that-breaks-this-test.com")
end
end

PageRankr.backlink_trackers.each do |tracker|
it{ should have_key(tracker) }

Expand All @@ -138,41 +138,41 @@
end
end
end

describe "#index_trackers" do
subject{ PageRankr.index_trackers }

it{ should include(:google) }
it{ should include(:bing) }
end

describe "#indexes" do
describe "success" do
subject do
VCR.use_cassette(:success_indexes, :record => :new_episodes) do
PageRankr.indexes("http://www.google.com")
end
end

PageRankr.index_trackers.each do |tracker|
it{ should have_key(tracker) }

it "#{tracker} should have a value greater than zero" do
subject[tracker].should be_number > 0
end
end
end

describe "failure" do
subject do
VCR.use_cassette(:failure_indexes, :record => :new_episodes) do
PageRankr.indexes("http://please-dont-register-a-site-that-breaks-this-test.com")
end
end

PageRankr.index_trackers.each do |tracker|
it{ should have_key(tracker) }

it "#{tracker} should have a nil value" do
subject[tracker].should be_nil
end
Expand All @@ -187,4 +187,4 @@
end
end
end
end
end

0 comments on commit e0a3f88

Please sign in to comment.