Skip to content

Commit 23ba7c4

Browse files
lhzxbsdrclaude
andcommitted
feat: add note.com adapter (search, user, articles)
User and articles use public API (no auth). Search uses cookie strategy (note.com requires login for search endpoint). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5949654 commit 23ba7c4

3 files changed

Lines changed: 106 additions & 0 deletions

File tree

src/clis/note/articles.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
site: note
2+
name: articles
3+
description: List articles by a note.com user
4+
domain: note.com
5+
strategy: public
6+
browser: false
7+
8+
args:
9+
username:
10+
type: str
11+
required: true
12+
positional: true
13+
description: "note.com username (urlname)"
14+
limit:
15+
type: int
16+
default: 6
17+
description: Number of articles
18+
19+
pipeline:
20+
- fetch:
21+
url: https://note.com/api/v2/creators/${{ args.username }}/contents
22+
params:
23+
kind: note
24+
page: "1"
25+
26+
- select: data.contents
27+
28+
- map:
29+
rank: ${{ index + 1 }}
30+
title: ${{ item.name }}
31+
likes: ${{ item.likeCount }}
32+
comments: ${{ item.commentCount }}
33+
created: "${{ item.publishAt ? item.publishAt.slice(0, 10) : '' }}"
34+
url: ${{ item.noteUrl }}
35+
36+
- limit: ${{ args.limit }}
37+
38+
columns: [rank, title, likes, comments, created, url]

src/clis/note/search.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
site: note
2+
name: search
3+
description: Search note.com articles
4+
domain: note.com
5+
strategy: cookie
6+
7+
args:
8+
query:
9+
type: str
10+
required: true
11+
positional: true
12+
description: Search query
13+
limit:
14+
type: int
15+
default: 10
16+
description: Number of results (max ~10 per request)
17+
18+
pipeline:
19+
- fetch:
20+
url: https://note.com/api/v3/searches
21+
params:
22+
context: note
23+
q: ${{ args.query }}
24+
size: ${{ args.limit }}
25+
start: "0"
26+
27+
- select: data.notes
28+
29+
- map:
30+
rank: ${{ index + 1 }}
31+
title: ${{ item.name }}
32+
author: ${{ item.user.urlname }}
33+
likes: ${{ item.likeCount }}
34+
url: ${{ item.noteUrl }}
35+
36+
- limit: ${{ args.limit }}
37+
38+
columns: [rank, title, author, likes, url]

src/clis/note/user.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
site: note
2+
name: user
3+
description: Get note.com user profile
4+
domain: note.com
5+
strategy: public
6+
browser: false
7+
8+
args:
9+
username:
10+
type: str
11+
required: true
12+
positional: true
13+
description: "note.com username (urlname)"
14+
15+
pipeline:
16+
- fetch:
17+
url: https://note.com/api/v2/creators/${{ args.username }}
18+
19+
- select: data
20+
21+
- map:
22+
id: ${{ item.urlname }}
23+
name: ${{ item.nickname }}
24+
bio: ${{ item.profile }}
25+
followers: ${{ item.followerCount }}
26+
following: ${{ item.followingCount }}
27+
articles: ${{ item.noteCount }}
28+
url: "https://note.com/${{ item.urlname }}"
29+
30+
columns: [id, name, bio, followers, following, articles, url]

0 commit comments

Comments
 (0)