Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google ping is deprecated #444

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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