首页
时事
归档
壁纸
更多
留言
关于
邻里
Search
1
使用必应Bing每日图片做网站背景(自动)
2,987 阅读
2
vue的输入值校验规则整理
1,662 阅读
3
VUE `ERR_CONNECTION_TIMED_OUT`的解决办法
1,628 阅读
4
好站推荐-https://wangchujiang.com/linux-command/
1,598 阅读
5
微信支付开发前准备(小程序、公众号、App、H5)
1,582 阅读
文章
图说
代码
吐槽
登录
Search
标签搜索
Linux
laravel
windows
TYPO3
php
shell脚本
git
微信
好站
vue
第三方登录
centos
linxu
centos7
thinkPHP
微信支付
api
MySQL
桌面
必应首图
Beer
累计撰写
114
篇文章
累计收到
22
条评论
首页
栏目
文章
图说
代码
吐槽
页面
时事
归档
壁纸
留言
关于
邻里
搜索到
2
篇与
api
的结果
2021-11-09
Typecho插件-每日简报
Demo体验菜单:时事使用1.无插件实现1.在你的主题目录下 ~root/usr/themes/your-theme/ 创建一个单页模板文件2.文件名随意,然后在文件中你想要展示的地方添加如下代码<?php $content = file_get_contents('https://news.topurl.cn?ip='.get_real_ip()); echo $content; ?>3.在typecho后台添加单页,选择刚添加的页面作为模板即可
2021年11月09日
956 阅读
0 评论
0 点赞
2019-02-14
使用必应Bing每日图片做网站背景(自动)
创建API文件在项目允许访问的目录下创建一个PHP文件供后续调用 api.php 调用地址:http://访问目录/api.phpAPI代码以下代码复制粘贴即可<?php //从bing获取数据 $str = file_get_contents('https://cn.bing.com/HPImageArchive.aspx?idx=0&n=1'); if (preg_match("/\<url\>(.+?)<\/url>/ies", $str, $matches)) { //正则匹配抓取图片url $imgurl = 'https://cn.bing.com' . $matches[1]; } else { //使用默认的图像 $imgurl = 'https: //picsum.photos/1920/1080/?random'; } header("Location: $imgurl"); ?>使用方法例:如果作为页面背景图的话,使用下面代码即可body{ width:100%; height:100%; background: url(API地址) no-repeat; -moz-background-size: cover; /*背景图片拉伸以铺满全屏*/ -ms-background-size: cover; -webkit-background-size: cover; background-size: cover; }
2019年02月14日
2,987 阅读
2 评论
0 点赞