鼠子 0 @于小丘9天前山东
免费网创项目:onezhuanone.com 作者
0 # wordpress配置 WP_URL = "https://xxx.com/wp-json/wp/v2/posts" WP_USERNAME = "xxxxxxx" WP_APP_PASSWORD = "xxxxxxxxx" # 发布文章到wordpress def upload_to_wordpress(title, content): article = { "title": title, "content": content, "status": "publish", "categories": [166], } credentials = base64.b64encode(f"{WP_USERNAME}:{WP_APP_PASSWORD}".encode()).decode() headers = { "Authorization": f"Basic {credentials}", "Content-Type": "application/json" } try: response = requests.post(WP_URL, json=article, headers=headers) return response.status_code == 201 except requests.RequestException as e: print(f"请求失败: {e}") return False10天前浙江
落魄的书生 1 看这个文章https://www.zibll.com/forum-post/8544.html 将他的采集规则的php文件上传到wordpress的根目录(记得改密钥)往https://域名/Locoy.php?action=save&secret=密钥发送post请求(请求带文章表单)就能发文了。 这是部分表单对应关系,没有的自己后台发文找就行了(f12大法)11天前四川已采纳
回答3
只看作者最新最热