Comment create

This commit is contained in:
simonwt 2026-03-31 12:00:49 +01:00
parent 499c5aee98
commit 620553ea14
4 changed files with 56 additions and 16 deletions

View file

@ -31,12 +31,13 @@ if not API.is_token_valid():
with open("token_data.json", "w") as f:
json.dump(tokendata, f, indent=4)
# print("-----------Get a user profile----------------")
# profile = API.run_job('userprofile.get', "simon-little")
# print(profile)
# print("-----------------------------")
# print("-------------- Get a branch -----------------")
# branch = API.run_job('branch.get', "music")
# print(branch)
# print("-----------------------------")
# print("-------------- Get a post -------------------")
# post = API.run_job('post.get', "1774875037-170a46a9")
# print(post)
# print("-----------------------------")
@ -45,15 +46,31 @@ if not API.is_token_valid():
# print("-----------------------------")
# feed = API.run_job('post.listbyuserprofile', "simon-little")
# print(feed)
print("-----------------------------")
post = API.run_job('post.create', {
# print("-----------------------------")
# post = API.run_job('post.create', {
# "blurLabel": None,
# "cardUrl": None,
# "postText": "This is a test post created via the API wrapper.",
# "collaborative": False,
# "parent": {
# "pk": "maintrunk#maintrunk",
# "sk": "maintrunk#maintrunk"
# }
# })
# print(post)
# print("-----------------------------")
post = API.run_job('comment.create', {
"blurLabel": None,
"cardUrl": None,
"postText": "This is a test post created via the API wrapper.",
"collaborative": False,
"commentText": "This is a test comment created via the API wrapper.",
"parent": {
"pk": "maintrunk#maintrunk",
"sk": "maintrunk#maintrunk"
}
"sk": "post#1774951384-98fe38df",
"slug": "1774951384-98fe38df"
},
"topLevel": {
"pk": "maintrunk#maintrunk",
"sk": "post#1774951384-98fe38df"
},
"version": 3
})
print(post)