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

推荐订阅源

T
The Blog of Author Tim Ferriss
Know Your Adversary
Know Your Adversary
P
Palo Alto Networks Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
L
LINUX DO - 热门话题
P
Proofpoint News Feed
P
Privacy & Cybersecurity Law Blog
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
Cisco Talos Blog
Cisco Talos Blog
AI
AI
L
LINUX DO - 最新话题
H
Heimdal Security Blog
Hacker News: Ask HN
Hacker News: Ask HN
Webroot Blog
Webroot Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The GitHub Blog
The GitHub Blog
I
Intezer
Blog — PlanetScale
Blog — PlanetScale
有赞技术团队
有赞技术团队
S
Securelist
博客园_首页
IT之家
IT之家
Schneier on Security
Schneier on Security
博客园 - 叶小钗
罗磊的独立博客
WordPress大学
WordPress大学
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
阮一峰的网络日志
阮一峰的网络日志
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
W
WeLiveSecurity
The Register - Security
The Register - Security
D
DataBreaches.Net
S
Security @ Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
Recorded Future
Recorded Future
NISL@THU
NISL@THU
N
News and Events Feed by Topic
T
Tailwind CSS Blog
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
T
Tor Project blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com

Rat's Blog - wordpress

零基础的萌新搭建属于自己的Typecho/WordPress等博客教程 - Rat's Blog 小内存VPS一键安装Typecho/WordPress/Zblog/Kodexplorer及整站备份等 - Rat's Blog Caddy环境下一些Web应用程序的配置参考 - Rat's Blog Caddy环境下WordPress博客伪静态设置 - Rat's Blog VPS服务器如何优化/加快网站的访问速度 - Rat's Blog SC private letter: 一个基于serverchan微信推送服务的私信发送站 - Rat's Blog 好看的WordPress主题:Kratos 2.5.8主题修改美化版,支持PJAX - Rat's Blog 给WordPress、Emlog等博客网站添加下雪特效,附带Typecho下雪插件 - Rat's Blog WordPress博客后台自动更新后,还一直提示更新的解决方法 - Rat's Blog
使用VPS采集1024贴图区,并自动发布到WordPress博客 - Rat's Blog
博主: Rat's · 2018-03-09 · via Rat's Blog - wordpress
  •  发布时间:
  •  14612 次浏览
  •   2 条评论
  •  1137 字数
  • 分类: 建站知识
  1.  首页
  2. 正文  
  3. 分享到:

说明:本教程使用的是基于Python3爬虫,配合Chevereto图床一起使用,这里说下搭建教程,且只适用于国外的服务器。

教程

首先你得有一个WordPress博客,不会搭建的可以在本博客搜索关键词,找到教程。然后还得有一个Chevereto图床,搭建方法:一款强大好用的图床程序:chevereto安装教程,搭建好了后需要去后台关闭防洪保护。

1、安装Python 3.6

#检查系统是否有Python3
python3 -V

#安装Python3
#CentOS系统
wget https://www.moerats.com/usr/shell/Python3/CentOS_Python3.6.sh && sh CentOS_Python3.6.sh
#Debian系统
wget https://www.moerats.com/usr/shell/Python3/Debian_Python3.6.sh && sh Debian_Python3.6.sh

2、安装Python所需库

pip3 install requests
pip3 install pymysql

3、下载并编辑爬虫

wget https://www.moerats.com/usr/shell/Python3/1024_wp.py
nano 1024_wp.py

修改如下:

1、设置连接的Mysql数据库信息,在代码第11行。
2、还有要修改第26、28行的图床Key,和图床url,只支持chevereto。
3、第80行文章分类ID(默认未分类)。
4、保留了采集一次后停止60s后再采集,如果不需要,删除第121行即可。

4、运行爬虫

chmod +x spider.py
python3 spider.py

建议配合screen一起使用,参考:使用screen来实现多任务不断线操作命令

爬虫来源:Github地址


版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/534/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。

Vultr新用户注册送100美元/16个机房按小时计费,支持支付宝,【点击查看】。