From 1fa93a7c8c18210efa84b4a704664cc611eab0ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AD=E5=85=AD?= Date: Fri, 10 Jan 2025 13:34:44 +0000 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=8D=9A=E6=96=87=EF=BC=9A=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=89=A7=E8=A1=8C=20Algolia=20=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/code/auto-algolia_search.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 content/code/auto-algolia_search.md diff --git a/content/code/auto-algolia_search.md b/content/code/auto-algolia_search.md new file mode 100644 index 0000000..8371c4f --- /dev/null +++ b/content/code/auto-algolia_search.md @@ -0,0 +1,23 @@ +--- +title: 自动执行 Algolia 搜索 +date: 2025-01-10T21:29:19+08:00 +author: 喵小六 +categories: ['Study'] +tags: ['Algolia', 'cURL', 'crontab'] +--- + +> 第一个 Algolia APP 因为太久不用被删除了。 +> +> 所以就想着能不能每个月自动执行一下搜索。 + +续命.jpg + + + +然后就查到了可以通过 http 搜索 [Search API reference | Algolia docs](https://www.algolia.com/doc/rest-api/search/#tag/Search/operation/searchSingleIndex) + +也不知道能不能行,总之先放一个 crontab 在服务器上 + +```bash +curl -X POST --url https://i54mtiwiv7.algolia.net/1/indexes/blog_hexsix_me/query --header 'Accept: application/json' --header 'Content-Type: application/json' --header 'x-algolia-api-key: abcdef' --header 'x-algolia-application-id: 123456' -d '{"params": "query=Rime"}' +```