PHP站群 >
ChatGPT接口缓冲
ChatGPT接口缓冲
Chatgpt通过openai获取数据实现多线程采集代码
2024-10-30 11:28:37ChatGPT接口缓冲
摘要:单个线程代码详解
include "SSDB.php"; include "config_ssdb.php"; include "conn.php"; if(empty($_POST["shujubao"])) return; $arr_data=unserialize($_POST["shujubao"]); $dir=$arr_data['dir']; $site_id=$arr_data['site_id']; $type=$arr_data['type']; if($dir=='') return; $bs=md5($dir.$site_id); $sql=mysql_query("select id from t".$type."_caiji_config where bs='".$bs."'",$conn); $info=mysql_fetch_array($sql); if(!isset($info['id'])){ // echo '不存在'; $data=$_POST["shujubao"]; $qname='q'; if($ssdb->qpush_back($qname,$data)){ }else{ } }else{ // echo '存在'; /*查询列表*/ $sql=mysql_query("select m.id,n.id as article_id,n.content from t".$type."_caiji_config as m INNER JOIN t".$type."_articles as n ON m.id=n.pid where m.bs='".$bs."'",$conn); $info=mysql_fetch_array($sql); if(isset($info['content'])){ $content=$info["content"]; echo $content; /*删除所有相关表数据 start*/ $article_id=$info["article_id"]; $pid=$info["id"]; mysql_query("delete from t".$type."_caiji_config where id=".$pid,$conn); mysql_query("delete from t".$type."_caiji_content3 where pid=".$pid,$conn); mysql_query("delete from t".$type."_articles where id=".$article_id,$conn); /*删除所有相关表数据 end*/ } }