From d96d38e50879c870ff3246be3c7a60cd0fbcac44 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Tue, 28 Mar 2023 16:43:56 +0200 Subject: [PATCH] add author name --- insert_wordpress.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/insert_wordpress.py b/insert_wordpress.py index 044292d..be12c65 100644 --- a/insert_wordpress.py +++ b/insert_wordpress.py @@ -117,7 +117,7 @@ if __name__ == '__main__': print("Article ajoute : {0}".format(result["title"]["raw"])) print(comment_post) for i in comment_post: - data = {"post": result["id"], "content": i["content"], "date": i["date"]} + data = {"post": result["id"], "content": i["content"], "date": i["date"], "author_name": i["author"]} page = requests.post("http://localhost:8080/wp-json/wp/v2/comments", auth=basic, data=data) print(page.status_code) if page.status_code == 201: