From 219e244fcfc9234a6898b44b72f77cdfe3a3ec50 Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Wed, 18 Oct 2023 13:06:15 +0600 Subject: [PATCH] indexnow request --- bot.php | 4 ++++ config.yml.example | 1 + 2 files changed, 5 insertions(+) diff --git a/bot.php b/bot.php index dfae2db..7d23083 100644 --- a/bot.php +++ b/bot.php @@ -156,6 +156,10 @@ foreach ($articles as $article) { file_put_contents('.lastrun', time()); } } + if (!empty($config['INDEXNOW'])) { + $client = new \GuzzleHttp\Client(); + $client->request('GET', 'https://www.bing.com/indexnow?url='.$link.'&key='.$config['INDEXNOW']); + } } else { echo $description."\n"; } diff --git a/config.yml.example b/config.yml.example index fb7a030..75de749 100644 --- a/config.yml.example +++ b/config.yml.example @@ -8,3 +8,4 @@ TELEGRAM_API_KEY: some-key-here TELEGRAM_BOT_NAME: bot name TELEGRAM_CHAT_ID: id BITLY_TOKEN: token +INDEXNOW: see https://www.bing.com/indexnow