http://www.reibang.com/p/b72572a11e37
封裝的方法:https://www.cnblogs.com/CHEUNGKAMING/p/5717429.html
請(qǐng)求頭,響應(yīng)頭
https://www.cnblogs.com/tianye8123/p/5942643.html
偽造ip
https://www.cnblogs.com/qunshu/p/3367482.html
curl 當(dāng)時(shí)訪問
https://www.cnblogs.com/mingforyou/p/3930636.html
https://blog.csdn.net/richangbiji/article/details/81667725
定時(shí)任務(wù)啟動(dòng)
https://blog.csdn.net/LOUISLIAOXH/article/details/48242289
周一到周五
https://www.cnblogs.com/mingforyou/p/3930636.html
實(shí)現(xiàn)秒級(jí)別定時(shí)
https://www.cnblogs.com/handle/p/9246197.html
注意修改文件權(quán)限777
55 9 * * 1-5 mail -s "hi" alex@domain.name /dev/null 2>&1
//九點(diǎn)55分周一到周五
55 9 * * 1-5 /bin/sh /home/guofu.sh
55 20 * * 1-5 /bin/sh /home/guofu.sh
/usr/bin/curl http://www.baidu.com >> /home/guofu.txt
/etc/init.d/cron reload
/etc/init.d/cron stop
http://my_tp.com/
# m h dom mon dow command
# */1 * * * * date >> /home/testCron.txt
# */1 * * * * /usr/bin/curl http://www.baidu.com >> /home/guofu.txt
# */1 * * * * /bin/sh /home/guofu.sh
55 9 * * * /bin/sh /home/guofu.sh
55 20 * * * /bin/sh /home/guofu.sh
秒級(jí)別定時(shí)
sleep 5;/usr/bin/curl http://my_tp.com >> /home/guofu.txt
date >> /home/guofu.txt
封裝的方法
function curl_get($url, $timeout = 5)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt ( $ch, CURLOPT_NOSIGNAL,true);
$file_contents = curl_exec($ch);
curl_close($ch);
return $file_contents;
}
function curl_post($url, array $params = array(), $timeout)
{
$ch = curl_init();//初始化
curl_setopt($ch, CURLOPT_URL, $url);//抓取指定網(wǎng)頁
curl_setopt($ch, CURLOPT_HEADER, 0);//設(shè)置header
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//要求結(jié)果為字符串且輸出到屏幕上
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_POST, 1);//post提交方式
curl_setopt ( $ch, CURLOPT_NOSIGNAL,true);//忽略所有的curl傳遞給php進(jìn)行的信號(hào) 避免curl timeout was reached(毫秒超時(shí)bug)
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
$data = curl_exec($ch);//運(yùn)行curl
curl_close($ch);
return ($data);
}