惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Schneier on Security
The Last Watchdog
The Last Watchdog
Cyberwarzone
Cyberwarzone
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cyber Attacks, Cyber Crime and Cyber Security
L
Lohrmann on Cybersecurity
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美
The Cloudflare Blog
V
V2EX
博客园_首页
博客园 - 聂微东
Vercel News
Vercel News
人人都是产品经理
人人都是产品经理
G
GRAHAM CLULEY
T
Tenable Blog
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
L
LINUX DO - 最新话题
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
SecWiki News
SecWiki News
博客园 - 三生石上(FineUI控件)
S
Secure Thoughts
N
News | PayPal Newsroom
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
T
Troy Hunt's Blog
博客园 - 【当耐特】
Forbes - Security
Forbes - Security
H
Hacker News: Front Page
A
About on SuperTechFans
B
Blog RSS Feed
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
D
DataBreaches.Net
P
Privacy & Cybersecurity Law Blog
Schneier on Security
Schneier on Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Jina AI
Jina AI
D
Docker
P
Proofpoint News Feed

博客园 - 疯吻IT

timestamp for this request was 1000ms ahead of the server's time GitHub无法访问、443 Operation timed out的解决办法 - 疯吻IT Ccxt: ModuleNotFoundError:没有名为“ ccxt”的模块 机器翻译数据集 CENTOS手动安装修复python ,YUM CENTOS手动安装修复YUM Python3 找不到库 UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 0: ordinal not in range(128) 数据集 rnn_model.fit Incompatible shapes Mysql 密码过期 帝国cms打开慢 如何快速获得权重站 HTTP 404 Not Found Error with .woff or .woff2 Font Files php报错 syntax error, unexpected T_VARIABLE 修改帝国cms栏目后,如何更新 帝国cms更新报错解决办法 帝国cms 不能正常显示最新文章 帝国CMS Table '***.phome_ecms_news_data_' doesn't exist 多版本python及多版本pip使用 python 去重
用python 发 帝国cms 文章
疯吻IT · 2018-09-27 · via 博客园 - 疯吻IT

在e\extent下面放一个jiekou.php

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import time
import urllib.request
import urllib.parse


def post(title, content, catid):
    query = "http://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,
        "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 = urllib.request.Request(query, data=data)
    res = urllib.request.urlopen(req, timeout=10)
    result = res.read().decode('utf-8')
    print(result)

if __name__ == "__main__":
    content_list = [line.strip() for line in open("duanwenxue.txt")]
    for wz in content_list[:5]:
        text = wz.split("####")
        title = text[0]
        content = text[1]
        print("开始发布:", title)
        post(title, content, 1)

参考:

如何用MarsEdit快速插入源代码