⽤python发帝国cms⽂章在e\extent下⾯放⼀个jiekou.php
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time
quest
import urllib.parse
def post(title, content, catid):
query = "127.0.0.1/e/extend/jiekou.php?pw=123456"
data_form = {
"enews": "AddNews",
"classid": catid,  # 栏⽬id
"bclassid": 0,  # ⽗栏⽬id
"id": 0,
"filepass": int(time.time()),  # 发布⽂章的时间戳
"username": "admin",
"oldchecked": 1,
"ecmsnfrom": 1,
"ecmscheck": 0,
"havetmpic": 0,
"title": title,
"checked": 1,
"isgood": 0,
"firsttitle": 0,
"newstime": time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),
"writer": "admin",
"befrom": "",
"newstext": content,
帝国cms文库模板"dokey": 1,
"copyimg": 1,
"autosize": 5000,
"istop": 0,
"newstempid": 0,
"groupid": 0,
"userfen": 0,
"onclick": 0,
"totaldown": 0,
"addnews": "提交",
}
data = urllib.parse.urlencode(data_form).encode(encoding='utf-8')
req = quest.Request(query, data=data)
res = quest.urlopen(req, timeout=10)
result = ad().decode('utf-8')
print(result)
if __name__ == "__main__":
content_list = [line.strip() for line in open("")]
for wz in content_list[:5]:
text = wz.split("####")
title = text[0]
content = text[1]
print("开始发布:", title)
post(title, content, 1)
参考:

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。