Skip to content

Commit 88cf3b5

Browse files
committed
feat(api): add methods for managing post tags
- Incremented version to 0.1.19 in pyproject.toml. - Added `add_tags_to_post` method to allow adding multiple tags to a post. - Implemented `get_publication_post_tags` to retrieve all tags for the current publication. - Created `add_tag_to_post` to check for existing tags before creating new ones and applying them to posts.
1 parent 7ede834 commit 88cf3b5

File tree

6 files changed

+206
-123
lines changed

6 files changed

+206
-123
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,4 @@ dmypy.json
129129
.pyre/
130130

131131
.idea/
132+
.vscode/

examples/draft.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ write_comment_permissions:
88
"none" # none, only_paid, everyone
99
section:
1010
"rick"
11+
tags:
12+
- "python"
13+
- "api"
1114
body:
1215
0:
1316
type: "heading"
@@ -43,7 +46,7 @@ body:
4346
content: "Set the EMAIL, PASSWORD, PUBLICATION_URL and USER_ID environment variables."
4447
7:
4548
type: "captionedImage"
46-
src: "rickroll_4k.jpg"
49+
src: "examples/rickroll_4k.jpg"
4750
8:
4851
type: "youtube2"
4952
src: "EnDg65ISswg"

examples/publish_post.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@
6969
# post.set_section(post_data.get("section"), api.get_sections())
7070
api.put_draft(draft.get("id"), draft_section_id=post.draft_section_id)
7171

72+
api.add_tags_to_post(draft.get("id"), post_data.get("tags", []))
73+
7274
if args.publish:
7375
api.prepublish_draft(draft.get("id"))
7476

0 commit comments

Comments
 (0)