cloudflare-bot-directory 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +19 -0
- package/.gitattributes +1 -0
- package/.github/dependabot.yml +11 -0
- package/.github/workflows/cron.yml +32 -0
- package/.github/workflows/main.yml +68 -0
- package/.github/workflows/pull_request.yml +36 -0
- package/LICENSE.md +21 -0
- package/README.md +48 -0
- package/package.json +89 -0
- package/scripts/fetch-bots.mjs +29 -0
- package/src/index.js +1 -0
- package/src/index.json +8305 -0
package/.editorconfig
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# https://editorconfig.org
|
|
2
|
+
|
|
3
|
+
root = true
|
|
4
|
+
|
|
5
|
+
[*]
|
|
6
|
+
indent_style = space
|
|
7
|
+
indent_size = 2
|
|
8
|
+
end_of_line = lf
|
|
9
|
+
charset = utf-8
|
|
10
|
+
trim_trailing_whitespace = true
|
|
11
|
+
insert_final_newline = true
|
|
12
|
+
max_line_length = 80
|
|
13
|
+
indent_brace_style = 1TBS
|
|
14
|
+
spaces_around_operators = true
|
|
15
|
+
quote_type = auto
|
|
16
|
+
|
|
17
|
+
[package.json]
|
|
18
|
+
indent_style = space
|
|
19
|
+
indent_size = 2
|
package/.gitattributes
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* text=auto
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: cron
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
schedule:
|
|
6
|
+
# Cron job every Monday at 00:00
|
|
7
|
+
# https://crontab.guru/every-monday
|
|
8
|
+
- cron: '0 0 * * MON'
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
update:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
with:
|
|
17
|
+
token: ${{ secrets.GH_TOKEN }}
|
|
18
|
+
- name: Setup Node.js
|
|
19
|
+
uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version: lts/*
|
|
22
|
+
- name: Update
|
|
23
|
+
env:
|
|
24
|
+
CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }}
|
|
25
|
+
CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }}
|
|
26
|
+
run: |
|
|
27
|
+
git config --global user.email ${{ secrets.GIT_EMAIL }}
|
|
28
|
+
git config --global user.name ${{ secrets.GIT_USERNAME }}
|
|
29
|
+
node scripts/fetch-bots.mjs
|
|
30
|
+
git add src/index.json
|
|
31
|
+
git diff-index --quiet HEAD || git commit -m 'build(update): bots' --no-verify
|
|
32
|
+
git push origin ${{ github.head_ref }} || true
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
name: main
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
contributors:
|
|
10
|
+
if: "${{ github.event.head_commit.message != 'build: contributors' }}"
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout
|
|
14
|
+
uses: actions/checkout@v6
|
|
15
|
+
with:
|
|
16
|
+
fetch-depth: 0
|
|
17
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
18
|
+
- name: Setup Node.js
|
|
19
|
+
uses: actions/setup-node@v6
|
|
20
|
+
with:
|
|
21
|
+
node-version: lts/*
|
|
22
|
+
- name: Contributors
|
|
23
|
+
run: |
|
|
24
|
+
git config --global user.email ${{ secrets.GIT_EMAIL }}
|
|
25
|
+
git config --global user.name ${{ secrets.GIT_USERNAME }}
|
|
26
|
+
npm run contributors
|
|
27
|
+
- name: Push changes
|
|
28
|
+
run: |
|
|
29
|
+
git push origin ${{ github.head_ref }}
|
|
30
|
+
|
|
31
|
+
release:
|
|
32
|
+
if: |
|
|
33
|
+
!startsWith(github.event.head_commit.message, 'chore(release):') &&
|
|
34
|
+
!startsWith(github.event.head_commit.message, 'docs:') &&
|
|
35
|
+
!startsWith(github.event.head_commit.message, 'ci:')
|
|
36
|
+
needs: [contributors]
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
steps:
|
|
39
|
+
- name: Checkout
|
|
40
|
+
uses: actions/checkout@v6
|
|
41
|
+
with:
|
|
42
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
43
|
+
- name: Setup Node.js
|
|
44
|
+
uses: actions/setup-node@v6
|
|
45
|
+
with:
|
|
46
|
+
node-version: lts/*
|
|
47
|
+
- name: Setup PNPM
|
|
48
|
+
uses: pnpm/action-setup@v4
|
|
49
|
+
with:
|
|
50
|
+
version: latest
|
|
51
|
+
run_install: true
|
|
52
|
+
- name: Test
|
|
53
|
+
run: pnpm test
|
|
54
|
+
- name: Report
|
|
55
|
+
run: npx c8 report --reporter=text-lcov > coverage/lcov.info
|
|
56
|
+
- name: Coverage
|
|
57
|
+
uses: coverallsapp/github-action@main
|
|
58
|
+
with:
|
|
59
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
60
|
+
- name: Release
|
|
61
|
+
env:
|
|
62
|
+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
63
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
64
|
+
run: |
|
|
65
|
+
git config --global user.email ${{ secrets.GIT_EMAIL }}
|
|
66
|
+
git config --global user.name ${{ secrets.GIT_USERNAME }}
|
|
67
|
+
git pull origin master
|
|
68
|
+
pnpm run release
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: pull_request
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- master
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
if: github.ref != 'refs/heads/master'
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout
|
|
17
|
+
uses: actions/checkout@v6
|
|
18
|
+
with:
|
|
19
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
20
|
+
- name: Setup Node.js
|
|
21
|
+
uses: actions/setup-node@v6
|
|
22
|
+
with:
|
|
23
|
+
node-version: lts/*
|
|
24
|
+
- name: Setup PNPM
|
|
25
|
+
uses: pnpm/action-setup@v4
|
|
26
|
+
with:
|
|
27
|
+
version: latest
|
|
28
|
+
run_install: true
|
|
29
|
+
- name: Test
|
|
30
|
+
run: pnpm test
|
|
31
|
+
- name: Report
|
|
32
|
+
run: npx c8 report --reporter=text-lcov > coverage/lcov.info
|
|
33
|
+
- name: Coverage
|
|
34
|
+
uses: coverallsapp/github-action@main
|
|
35
|
+
with:
|
|
36
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright © 2026 Kiko Beats <josefrancisco.verdu@gmail.com> (kikobeats.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# cloudflare-bot-directory
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<br>
|
|
5
|
+
<img src="https://i.imgur.com/mXwNCvH.png" alt="cloudflare-bot-directory">
|
|
6
|
+
<br>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
> The CloudFlare Radar Bot Directory as a JSON. Check [index.json](/src/index.json)
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
$ npm install cloudflare-bot-directory --save
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
const cloudflareBotDirectory = require('cloudflare-bot-directory')
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
console.log(cloudflareBotDirectory.map(item => item.slug))
|
|
24
|
+
|
|
25
|
+
> console.log(cloudflareBotDirectory.map(item => item.slug))
|
|
26
|
+
// [
|
|
27
|
+
// '2checkout',
|
|
28
|
+
// '360monitoring',
|
|
29
|
+
// 'aasa',
|
|
30
|
+
// 'accessible-web-bot',
|
|
31
|
+
// 'accessstatus',
|
|
32
|
+
// 'acquia-optimize-monsido',
|
|
33
|
+
// 'activecomply-bot',
|
|
34
|
+
// 'adagiobot',
|
|
35
|
+
// 'addsearchbot',
|
|
36
|
+
// 'addthis',
|
|
37
|
+
// 'adidxbot',
|
|
38
|
+
// 'adstxtcrawler',
|
|
39
|
+
// ... 502 more items
|
|
40
|
+
// ]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## License
|
|
44
|
+
|
|
45
|
+
**cloudflare-bot-directory** © [Kiko Beats](https://kikobeats.com), released under the [MIT](https://github.com/kikobeats/cloudflare-bot-directory/blob/master/LICENSE.md) License.<br>
|
|
46
|
+
Authored and maintained by [Kiko Beats](https://kikobeats.com) with help from [contributors](https://github.com/kikobeats/cloudflare-bot-directory/contributors).
|
|
47
|
+
|
|
48
|
+
> [kikobeats.com](https://kikobeats.com) · GitHub [Kiko Beats](https://github.com/kikobeats) · Twitter [@kikobeats](https://twitter.com/kikobeats)
|
package/package.json
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cloudflare-bot-directory",
|
|
3
|
+
"description": "The CloudFlare bots directory",
|
|
4
|
+
"homepage": "https://github.com/kikobeats/cloudflare-bot-directory",
|
|
5
|
+
"version": "0.0.0",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./src/index.js"
|
|
8
|
+
},
|
|
9
|
+
"author": {
|
|
10
|
+
"email": "josefrancisco.verdu@gmail.com",
|
|
11
|
+
"name": "Kiko Beats",
|
|
12
|
+
"url": "https://kikobeats.com"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/kikobeats/cloudflare-bot-directory.git"
|
|
17
|
+
},
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/kikobeats/cloudflare-bot-directory/issues"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"bots",
|
|
23
|
+
"cloudflare",
|
|
24
|
+
"directory",
|
|
25
|
+
"radar"
|
|
26
|
+
],
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@commitlint/cli": "latest",
|
|
29
|
+
"@commitlint/config-conventional": "latest",
|
|
30
|
+
"@ksmithut/prettier-standard": "latest",
|
|
31
|
+
"ava": "latest",
|
|
32
|
+
"c8": "latest",
|
|
33
|
+
"ci-publish": "latest",
|
|
34
|
+
"conventional-changelog-cli": "latest",
|
|
35
|
+
"finepack": "latest",
|
|
36
|
+
"git-authors-cli": "latest",
|
|
37
|
+
"github-generate-release": "latest",
|
|
38
|
+
"nano-staged": "latest",
|
|
39
|
+
"simple-git-hooks": "latest",
|
|
40
|
+
"standard": "latest",
|
|
41
|
+
"standard-version": "latest"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">= 20"
|
|
45
|
+
},
|
|
46
|
+
"license": "MIT",
|
|
47
|
+
"commitlint": {
|
|
48
|
+
"extends": [
|
|
49
|
+
"@commitlint/config-conventional"
|
|
50
|
+
],
|
|
51
|
+
"rules": {
|
|
52
|
+
"body-max-line-length": [
|
|
53
|
+
0
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"nano-staged": {
|
|
58
|
+
"*.js": [
|
|
59
|
+
"prettier-standard",
|
|
60
|
+
"standard --fix"
|
|
61
|
+
],
|
|
62
|
+
"package.json": [
|
|
63
|
+
"finepack"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"simple-git-hooks": {
|
|
67
|
+
"commit-msg": "npx commitlint --edit",
|
|
68
|
+
"pre-commit": "npx nano-staged"
|
|
69
|
+
},
|
|
70
|
+
"dependencies": {
|
|
71
|
+
"p-map": "~7.0.4"
|
|
72
|
+
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"clean": "rm -rf node_modules",
|
|
75
|
+
"contributors": "(npx git-authors-cli && npx finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
|
|
76
|
+
"coverage": "c8 report --reporter=text-lcov > coverage/lcov.info",
|
|
77
|
+
"lint": "standard-markdown README.md && standard",
|
|
78
|
+
"postrelease": "npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)",
|
|
79
|
+
"pretest": "npm run lint",
|
|
80
|
+
"release": "pnpm run release:version && pnpm run release:changelog && pnpm run release:commit && pnpm run release:tag",
|
|
81
|
+
"release:github": "github-generate-release",
|
|
82
|
+
"release:tags": "git push origin HEAD:master --follow-tags",
|
|
83
|
+
"test": "c8 ava",
|
|
84
|
+
"release:changelog": "conventional-changelog -p conventionalcommits -i CHANGELOG.md -s",
|
|
85
|
+
"release:commit": "git add package.json CHANGELOG.md && git commit -m \"chore(release): $(node -p \"require('./package.json').version\")\"",
|
|
86
|
+
"release:tag": "git tag -a v$(node -p \"require('./package.json').version\") -m \"v$(node -p \"require('./package.json').version\")\"",
|
|
87
|
+
"release:version": "standard-version --skip.changelog --skip.commit --skip.tag"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { writeFile } from 'node:fs/promises'
|
|
2
|
+
import pMap from 'p-map'
|
|
3
|
+
|
|
4
|
+
const cloudflare = path =>
|
|
5
|
+
fetch(`https://api.cloudflare.com/client/v4/radar/${path}`, {
|
|
6
|
+
headers: {
|
|
7
|
+
'x-auth-email': process.env.CLOUDFLARE_EMAIL,
|
|
8
|
+
'x-auth-key': process.env.CLOUDFLARE_API_KEY
|
|
9
|
+
}
|
|
10
|
+
}).then(res => res.json())
|
|
11
|
+
|
|
12
|
+
const allBots = (await cloudflare('/bots?limit=999')).result.bots
|
|
13
|
+
|
|
14
|
+
let completed = 0
|
|
15
|
+
|
|
16
|
+
const percentage = completed =>
|
|
17
|
+
`${Math.round((completed / allBots.length) * 100)}%`
|
|
18
|
+
|
|
19
|
+
const bots = await pMap(
|
|
20
|
+
allBots,
|
|
21
|
+
async bot => {
|
|
22
|
+
const details = await cloudflare(`/bots/${bot.slug}`)
|
|
23
|
+
process.stdout.write(`…${percentage(++completed)}`)
|
|
24
|
+
return details.result.bot
|
|
25
|
+
},
|
|
26
|
+
{ concurrency: 2 }
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
await writeFile('src/index.json', JSON.stringify(bots, null, 2))
|
package/src/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./index.json')
|