Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php tag.net API无法连接到主机错误_Php_Api_Tags - Fatal编程技术网

Php tag.net API无法连接到主机错误

Php tag.net API无法连接到主机错误,php,api,tags,Php,Api,Tags,我曾使用以下代码成功访问.net API,但现在不起作用: $content = "some content"; // Build the URL $url = "http://tagthe.net/api/?text=".urlencode($content)."&view=json"; $result = json_decode(request_get($url)); $seeds = @$result->memes[0]->dimensions->topic;

我曾使用以下代码成功访问.net API,但现在不起作用:

$content = "some content";
// Build the URL
$url = "http://tagthe.net/api/?text=".urlencode($content)."&view=json";
$result = json_decode(request_get($url));
$seeds = @$result->memes[0]->dimensions->topic;
我提出请求的职能是:

function request_get($url) {
            $headers[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'; 
            $headers[] = 'Connection: Keep-Alive'; 
            $headers[] = 'Content-type: application/x-www-form-urlencoded;charset=UTF-8'; 
            $user_agent = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0)';
            $referer = 'http://domain/'.rand(1,100000);

            $process = curl_init($url); 
            curl_setopt($process, CURLOPT_HTTPHEADER, $headers); 
            curl_setopt($process, CURLOPT_HEADER, 0); 
            curl_setopt($process, CURLOPT_USERAGENT, $user_agent); 
            curl_setopt($process, CURLOPT_ENCODING , 'gzip'); 
            curl_setopt($process, CURLOPT_TIMEOUT, 30);  
            curl_setopt($process, CURLOPT_RETURNTRANSFER, 1); 
            curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);
            $return = curl_exec($process);

            // Check for possible errors
            if ($return === false) {
                log_error(curl_error($process) . ', Url: ' . $url);
            }

            curl_close($process); 
            return $return;
        }
当我执行代码以获取建议的标记时,我得到的结果为空,并且出现以下cURL错误:

无法连接到主机,Url:

在出现这个问题之前,我成功地访问并获得了标签列表。 我做错了什么?如有任何建议或想法,将不胜感激。
也许服务改变了?我搜索了一下,但没有找到任何关于它的通知。

难怪,那个网站似乎已经关闭了。