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

$kv['classname'],'cid'=>$kv['classid'],'pid'=>$kv['bclassid']);

}

}

if(empty($_POST))

{

//这里刷新列表

echo ""; #echo maketree($cates,0,''); foreach($ar as $k=>$v){ $pid=$v['pid']; $cname=$v['cname']; $cid=$v['cid']; if($pid==$id) { $ids.="{$pre}{$cname}"; foreach($ar as $kk=>$vv) { $pp=$vv['pid']; if($pp==$cid) { $ids.=maketree($ar,$cid,$pre."  "); break; } } } } echo '';

exit();

}

$link=db_connect();

$empire=new mysqlquery();

//验证用户

$loginin=$_POST['username'];

$lur=$empire->fetch1("select * from {$dbtbpre}enewsuser where `username`='$loginin'");

if(!$lur) exit('不存在的用户名'.$loginin);

$logininid=$lur['userid'];

$loginrnd=$lur['rnd'];

$loginlevel=$lur['groupid'];

$loginadminstyleid=$lur['adminstyleid'];

$incftp=0;

if($public_r['phpmode'])

{

include("../class/ftp.php");

$incftp=1;

}

require("../class/hinfofun.php");

$navtheid=(int)$_POST['filepass'];

AddNews($_POST,$logininid,$loginin);

$arturl=$empire->fetch1("select titleurl from {$dbtbpre}ecms_news where `classid`='$classid' order by id desc limit 1");

db_close();

$empire=null;

exit($arturl)

/***生成目录的一个遍历算法***/

?>

#!/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/emcms/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)

参考:

来源:http://www.icode9.com/content-1-26341.html

帝国cms怎么搭建python环境_用python 发 帝国cms 文章相关推荐

  1. linux服务器配置python环境_服务器python环境配置福利,CentOS ,Linux 一键下载python3和环境配置...

    很多新手对于linux 系统很是费解,通常下一个环境就需要大半天,中途还会出现各种这样的问题 ,干脆写一个脚本一键配置python环境 shell 脚本start.sh: #!/bin/bash yu ...

  2. atom配置python环境_用Python制作网站Django实操与开发环境配置

    上篇文章简单介绍了Django的基础知识,本篇将进入实际操作部分,包括Django的运行环境.开发环境配置与新建项目等内容.由于篇幅原因,笔者不得不把Demo演示放到下一篇文章,望读者(如果有的话)见 ...

  3. 帝国cms怎么搭建python环境_自己写的帝国cms后台文章添加增加二级或多级联动功能...

    define('EmpireCMSAdmin','1'); require("../class/connect.php"); require("../class/db_s ...

  4. 认识python编程环境_认识Python和安装Python环境

    学习目标: 1. 了解什么是Python?为什么学习Python?Python都可以做什么? 2. 了解并安装Python环境,体验第一Python程序. 学习内容: 1.什么是Python? Pyt ...

  5. 生物信息 python 书籍_用python做生物信息数据分析(1-环境准备)

    写在前面 四五年前,接触生物信息的时候,阴差阳错,我选择用perl.事实上,直到嫌我,我还是认为我当初的选择,完全正确!. 在做一些小文本的快速处理上,perl在我看来,从来最优最快 当然,进步往往来 ...

  6. 第一章 第一节:Python基础_认识Python

    Python基础入门(全套保姆级教程) 第一章 第一节:Python基础_认识Python 1. 什么是编程 通俗易懂,编程就是用代码编写程序,编写程序有很多种办法,像c语言,javaPython语言 ...

  7. 【100天精通python】Day1:python入门_初识python,搭建python环境,运行第一个python小程序

    目录 专栏导读 1 初始python python 概述 python的应用领域 应用python的公司 2 搭建python 开发环境 2.1 安装python(以windows 系统为例)(1)下 ...

  8. geany搭建python环境_第一章:搭建Python的开发环境

    第一步: 我们在Python的官网上下载Python的安装包,此安装包内含有Python解释器.Python运行的基础库,以及交互式运行工具--Python Shell 第二步: 安装时弹出下面对话框 ...

  9. 阿里云服务器搭建python web环境_《Python入门》Linux 下 Python Web开发环境搭建笔记-阿里云开发者社区...

    之前写过 Windows 7下Python Web开发环境搭建笔记,今天写一下在Linux系统下搭建Python Web的开发测试环境. 我使用的系统是:ubuntu 14.04 server,根据个 ...

最新文章

  1. Sublime_正则查找替换
  2. 这些基本职业技术---programmer
  3. 十八、前端必学Bootstrap美化(上篇)
  4. OpenCV线特征Line Features
  5. Linux系统任务计划(at、crontab)的使用方法
  6. html 完全复制div中的内容_LOL手游现在远非完全体,未来还有哪些端游内容会加入手游中?...
  7. 乘法最快的算法计算机,人类史上最快乘法算法诞生
  8. MonoBehaviour常用方法
  9. oracle数据库创建回滚,如何重建Oracle数据库的回滚段?
  10. Eureka Server 集群
  11. 数值计算基础(上溢下溢、梯度优化、牛顿法、KKT方法)
  12. Aria2 一键安装管理脚本 与Snap安装Nextcloud 与离线下载百度云
  13. Springboot的工作机制:1 Springboot初体验
  14. 联想M7650DF加粉和重置/清零的正确方法
  15. Java实现Map转List
  16. ShellServiceObjectDelayLoad注册表键值作用
  17. v7000更换电池步骤_UPS电池更换方案
  18. insert into select 语法使用
  19. 嵌入式系统开发笔记39:重叠五角星
  20. js/javascript获取时间戳的5种方法

热门文章

  1. TensorFlow 2 Object Detection API 教程: 安装
  2. Halcon阈值分割
  3. Spring Boot 2 - 初识与新工程的创建
  4. Office 2016 到底有没有更新?
  5. JavaScript中匿名函数的困惑
  6. phoenixframe自动化测试平台对Firefox和chrome支持的说明
  7. 检查客户机上能否使用WebBrowser控件
  8. 路由器与交换机的区别【知识普及】
  9. 无锡东亭计算机培训班,锡山区东亭办公自动化培训、电脑培训班有哪些?
  10. 常用c语言函数实现,常用的C语言库函数实现