facebook twitter hatena line email

Php/pubsubhubbub

提供: 初心者エンジニアの簡易メモ
移動: 案内検索

PubSubHubBubとは

検索エンジンへの記事高速インデックス登録ライブラリ

ダウンロード

git clone https://github.com/joshfraser/pubsubhubbub-php

サンプル

require_once __DIR__ . '/pubsubhubbub-php/library/publisher.php';
$p = new Publisher("http://pubsubhubbub.appspot.com/");
$url = "http://wiki.nonip.info/index.php/Php/pubsubhubbub";
if ($p->publish_update($url)) {
   echo '成功';
} else {
   echo '失敗';
   print_r($p->last_response());
}

実行後検証

0秒でgooglebotがやってくる(UserAgent:FeedFetcher-Google)

66.249.79.121 - - [20/Feb/2016:14:38:08 +0900] "GET /article/1432 HTTP/1.1" 200 10597 "-" "FeedFetcher-Google; (+http://www.google.com/feedfetcher.html)" "-"

ペナルティリスク

加減を考えて送信しないと(1秒1件とかは)手動ペナルティを食らう可能性があります。

参考

https://syncer.jp/how-to-use-pubsubhubbub