php调用谷歌无头浏览器访问网页(代码备份):
<?php
$i = 1403;
while ($i--) {
$url = "https://wap.xingxinghan.cn/?id=" . $i;
$cmd = "chrome --headless --disable-gpu $url";
echo $url . PHP_EOL;
exec($cmd);
sleep(10);
push($url);
}
function push($url)
{
$urls = array(
$url,
);
$api = 'http://data.zz.baidu.com/urls?site=https://wap.xingxinghan.cn&token=JFlzEXUDAXAZDvXyZl2';
$ch = curl_init();
$options = array(
CURLOPT_URL => $api,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => implode("\n", $urls),
CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
);
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
echo $result . PHP_EOL;
}
<?php
while(true)
{
$response = file_get_contents('http://learn.gaojiufeng.cn/index/test1x/showId');
$response = json_decode($response);
foreach ($response as $key => $value) {
$url = "https://blog.20230611.cn/?id=" . $value;
$cmd = "chrome --headless --disable-gpu --window-size=1920x1080 $url";
echo $url . PHP_EOL;
echo $cmd . PHP_EOL;
exec($cmd);
sleep(15);
}
}目的:刷真实PV增加收录
前公司吃饭是需要在钉钉报餐的,对于不挑剔的我每天都在公司吃饭,有时忘记报餐导致吃不了饭还是很麻烦的。看了下报餐系统需要的是json数据包含我的工号即可。于是编写如下代码,放在360网址监控,1小时执行1次<?php /*自动报餐类*/ class AutoBaocan{...
<?php function go($str) { echo'I\'m '.$str; } $goto='go'; $goto('gaojiufeng'...
在项目中需要对图片进行裁剪,前端裁剪完成发送base64给后端,但是很意外的PHP获取到的数据和前端有点差距,之前我都是先加密,后端解密,但是这次依然不行。于是使用filter_input方法轻松解决。$base64 = filter_input(INPUT_POST...
开启错误提示代码:ini_set("display_errors", "On"); error_reporting(E_ALL | E_STRICT);关闭错误提示代码:error_reporting(E_ALL ^&n...
先在centos安装openssl,然后开始://生成私钥openssl genrsa -out rsa_private_key.pem 1024//生成公钥openssl rsa -in rsa_private_key.pem&...
md5/sha1+salt方式是目前各大cms常用的加密方式,虽然salt安全,但是各大md5网站也在研究这个方向,那么我们应该选择password_hash动态hash来助力,一种密码有多种hash结果.看代码模拟登陆.<?php //01.注册 $user ='zhang...