插件信息:
- 插件名: ArticlePoster
- 下载地址: http://github.com/MoLeft/ArticlePoster
- 作者博客地址:https://www.moleft.cn/post-53.html
以下安装说明来自作者博客: - 安装说明
重头戏来啦!!!
修改海报头图
·Tip:
怎么设置插件用typecho的知道,不清楚的可以到作者博客里自己去看·pajax配置也在作者博客,自己去看
大概作者还在做这个功能,还没有加在typecho插件设置面板里面,不过代码已经写好了,不过是我们自己去改而已
修改过程:
- 打开
usr/plugins/ArticlePoster/
这个目录,即插件根目录 - 插件根目录内容如下
打开上面目录中的
service
文件夹,找到api.php
用编辑器打开它,用
宝塔面板
的可以直接在web端操作,用ftp操作的人,建议先把这个api.php
下载下来,然后进行修改后上传找到
第179行
代码,如图
'stream' => get_curl('https://www.bing.com'.json_decode(get_curl("https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1"),true)['images'][0]['url']),
找一个可以调用
随机图的api
提供网站可以看到请求方法:
往下看
- 复制这一段到图中位置:https://api.btstu.cn/sjbz/api.php?lx=dongman
这一段 https://api.btstu.cn/sjbz/api.php?lx=dongman&format=json 到
改成这样的
'stream' => get_curl('https://api.btstu.cn/sjbz/api.php?lx=dongman'.json_decode(get_curl("https://api.btstu.cn/sjbz/api.php?lx=dongman&format=json"),true)['images'][0]['url']),
- 你想二次元直接用上面这串代码也行,复制粘贴到对应行号即可。
完啦
后言:
写了这么久,支持一下呗!