Idea for a Python REST API plugin to modify the content
-
I know WordPress is made with PHP, but nonetheless I want to ask you this question, because for my own use cases, like an e-commerce shop or a custom dictionary, I need this functionality. And since it has become easier to set up a site, I want to make WP headless with Python. So up to now, I have written some short codes;
from openpyxl import Workbook
workbook = Workbook()
sheet = workbook.active
sheet["A1"] = "hallo"
sheet["B1"] = "wereld!"
sheet["B2"] = "Dag"
workbook.save(filename="HalloWereld.xlsx")import requests
auth = ("[Site name]", "[secret code")
url = "[Site URL on localhost]"
new_post = {
'title': '[Blog title]',
'content': '[Blog content]',
'status': 'publish'
}
response = requests.post(url, json=new_post, auth=auth)I wonder how I can merge openpyxl and the Rest API, so you can connect Excel to your WooCommerce multisite shop (for each worksheet is another site). And I test it out on localhost because messing with API is dangerous, you can instantly make posts.
You must be logged in to reply to this topic.