Skip to content

Commit

Permalink
Google ping is deprecated (#444)
Browse files Browse the repository at this point in the history
  • Loading branch information
n-rodriguez authored Nov 23, 2024
1 parent fe3b341 commit cba9931
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ SitemapGenerator.verbose = false

### Pinging Search Engines

Using `rake sitemap:refresh` will notify Google to let them know that a new sitemap
Using `rake sitemap:refresh` will notify configured search engines to let them know that a new sitemap
is available. To generate new sitemaps without notifying search engines, use `rake sitemap:refresh:no_ping`.

If you want to customize the hash of search engines you can access it at:
By default no search engines are configured. If you want to customize the hash of search engines you can access it at:

```ruby
SitemapGenerator::Sitemap.search_engines
Expand Down
4 changes: 1 addition & 3 deletions lib/sitemap_generator/link_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ def initialize(options={})
:include_root => true,
:include_index => false,
:filename => :sitemap,
:search_engines => {
:google => "http://www.google.com/webmasters/tools/ping?sitemap=%s"
},
:search_engines => {},
:create_index => :auto,
:compress => true,
:max_sitemap_links => SitemapGenerator::MAX_SITEMAP_LINKS
Expand Down
10 changes: 2 additions & 8 deletions spec/sitemap_generator/link_set_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@
describe 'search_engines' do
it 'should have search engines by default' do
expect(ls.search_engines).to be_a(Hash)
expect(ls.search_engines.size).to eq(1)
expect(ls.search_engines.size).to eq(0)
end

it 'should support being modified' do
ls.search_engines[:newengine] = 'abc'
expect(ls.search_engines.size).to eq(2)
expect(ls.search_engines.size).to eq(1)
end

it 'should support being set to nil' do
Expand All @@ -149,12 +149,6 @@
end

describe 'ping search engines' do
it 'should not fail' do
request = stub_request(:get, //)
expect { ls.ping_search_engines }.not_to raise_error
expect(request).to have_been_requested.at_least_once
end

it 'should raise if no host is set' do
expect { SitemapGenerator::LinkSet.new.ping_search_engines }.to raise_error(SitemapGenerator::SitemapError, 'No value set for host')
end
Expand Down

0 comments on commit cba9931

Please sign in to comment.