kjvarga / sitemap_generator

SitemapGenerator is a framework-agnostic XML Sitemap generator written in Ruby with automatic Rails integration. It supports Video, News, Image, Mobile, PageMap and Alternate Links sitemap extensions and includes Rake tasks for managing your sitemaps, as well as many other great features.
MIT License
2.44k stars 275 forks source link

【Worked】Ping failed for Bing: #<OpenURI::HTTPError: 410 Gone> #403

Closed mah666hhh closed 2 years ago

mah666hhh commented 2 years ago

Error when running rake sitemap: refresh`` Ping failed for Bing: # <OpenURI :: HTTPError: 410 Gone> Has occurred.

 $ bundle exec rake sitemap:refresh
In '/Users/xxx/workspace/ccc/vvv/':
+ sitemaps/sitemap.xml.gz                                 15 links /  561 Bytes
Sitemap stats: 15 links / 1 sitemaps / 0m01s

Pinging with URL 'https://s3-ap-northeast-1.amazonaws.com/sitemaps/sitemap.xml.gz':
  Successful ping of Google

Ping failed for Bing: #<OpenURI::HTTPError: 410 Gone> (URL http://www.bing.com/webmaster/ping.aspx?sitemap=https%3A%2F%2Fs3-ap-northeast-1.amazonaws.com%2Fsitemaps%2Fsitemap.xml.gz)

If you check the ping destination with the current Bing Webmaster Tools,

http://www.bing.com/webmasters/submiturl?siteUrl=

The URL is like this,

I suspect this is currently the correct ping destination URL for Bing.(in japan.)

bing ウェブマスターツール ping送信先 url

# In gem, not working.
"http://www.bing.com/webmaster/ping.aspx?sitemap=%s"

# In Bing Webmaster Tools, Work.
"http://www.bing.com/webmasters/submiturl?siteUrl=%s"


for that reason,

When creating an instance of SitemapGenerator :: Sitemap

I think I need to change the parameters of search_engines: bing: parameters.

{ search_engines: { bing: "http://www.bing.com/webmasters/submiturl?siteUrl=%s" } }
SitemapGenerator::Sitemap.create({ search_engines: { google: "http://www.google.com/webmasters/tools/ping?sitemap=%s", bing: "http://www.bing.com/webmasters/submiturl?siteUrl=%s" } }) do
  add 'page_url'
end

Running rake sitemap: refresh as above worked for me.

$ bundle exec rake sitemap:refresh
In '/Users/xxx/workspace/ccc/vvv/':
+ sitemaps/sitemap.xml.gz                                 15 links /  561 Bytes
Sitemap stats: 15 links / 1 sitemaps / 0m01s

Pinging with URL 'https://s3-ap-northeast-1.amazonaws.com/sitemaps/sitemap.xml.gz':
  Successful ping of Google
  Successful ping of Bing

I think the corrections are as follows.

https://github.com/kjvarga/sitemap_generator/blob/master/lib/sitemap_generator/link_set.rb#L129

スクリーンショット 2022-06-09 15 35 42

# not working.
:bing           => "http://www.bing.com/webmaster/ping.aspx?sitemap=%s"
# Work.
:bing           => "http://www.bing.com/webmasters/submiturl?siteUrl=%s"

Thank you.

viviana-aline commented 2 years ago

Seems like the Bing sitemap ping is deprecated https://blogs.bing.com/webmaster/may-2022/Spring-cleaning-Removed-Bing-anonymous-sitemap-submission

thanhtoan1196 commented 2 years ago

any updates?

danmarx commented 2 years ago

Bing looks to be pingable via IndexNow - https://www.indexnow.org/faq

https://www.bing.com/indexnow?url=url-changed&key=your-key

kjvarga commented 2 years ago

Hi all, Bing is no longer accepting direct pings, so it has been removed in v6.3.0.

Until we get support for IndexNow we won't be able to ping Bing.