你和这个世界,只差60秒!
参考自冷筱宇的小窝
效果展示
点击查看→60秒看世界
纯图片方法
新建文章或独立页面,加入以下代码即可。(位置、样式等自行调整)
<img src="http://api.03c3.cn/zb" />
API方法
header("content-type:image/jpg");
echo file_get_contents(json_decode(file_get_contents("http://api.03c3.cn/zb/api.php"))->imageUrl);
截取头图
<img src="https://api.03c3.cn/zb/H.php" />
也可以自己截取调整图片
<?php
$src_path = 'https://api.03c3.cn/zb/';
$src = imagecreatefromstring(file_get_contents($src_path));
$x = 50;
$y = 50;
$width = 520;
$height = 285;
$final_width = 500;
$final_height=188;
$new_image = imagecreatetruecolor($final_width, $final_height);
imagecopyresampled($new_image, $src, 0, 0, $x, $y, $final_width, $final_height, $width, $height);
imagejpeg($new_image, 'map.jpg');
知乎接口
https://www.zhihu.com/api/v4/columns/c_1261258401923026944/items
解析方式
<?php
/*
* @Descripttion:
* @version:
* @Author: lengxiaoyu
* @Date: 2022-05-25 18:07:26
* @LastEditTime: 2022-06-21 17:47:59
*/
header("Content-Type: text/html;charset=utf-8");
header("Content-Type: text/json; charset=$charset");
header("Access-Control-Allow-Origin:*");
header('Access-Control-Allow-Methods:GET');
header('Access-Control-Allow-Headers:x-requested-with, content-type');
require('phpQuery/phpQuery.php');
$a = file_get_contents("https://www.zhihu.com/api/v4/columns/c_1261258401923026944/items");
$data = json_decode(Unicode($a))->{"data"};
$html = $data[0]->{"url"};
phpQuery::newDocumentFile($html);
$p = pq('p')->text();
echo ($p);
// 编码转换
function Unicode($str)
{
return preg_replace_callback(
"#\\\u([0-9a-f]{4})#i",
function ($r) {
return iconv('UCS-2BE', 'UTF-8', pack('H4', $r[1]));
},
$str
);
}
挺好的,加上广告有小钱钱赚了,屏蔽的挺好没看见不对劲的广告
@小熊 : 得常常去后台看下,屏蔽掉
过来看看!
@TeacherDu :
@Chrison : Kuma修改了展示策略,不再单独页面显示!
@Teacher Du : okk,了解了