这是我用来获取没有API的hashtag图像的代码.我不想使用任何凭证.无需添加client_id或访问令牌.但我只得到15张图片.我怎样才能获得所有图像?
<div>
<form action='#' method='post'>
<input type='input' name='txttag' />
<input type='submit' value='Get Image' />
</form>
</div>
<?php
function scrape_insta_hash($tag) {
$insta_source = file_get_contents('https://www.instagram.com/explore/tags/'.$tag.'/'); // instagrame tag url
$shards = explode('window._sharedData = ', $insta_source);
$insta_json = explode(';</script>', $shards[1]);
$insta_array = json_decode($insta_json[0], TRUE);
return $insta_array; // this return a lot things print it and see what else you need
}
if(isset($_POST['txttag']))
{
$tag =$_POST['txttag']; // tag for which ou want images
$results_array = scrape_insta_hash($tag);
$limit = 15; // provide the …Run Code Online (Sandbox Code Playgroud) 我想使用 curl 删除文件
我正在使用 SFTP,下面是我正在使用的代码。它不适合我
$ch = curl_init();
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_URL, "sftp://use:@101.101.101.101/");
curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_SFTP);
curl_setopt($ch, CURLOPT_PORT, 51402);
curl_setopt($ch, CURLOPT_SSH_PRIVATE_KEYFILE, '/home/web/.ssh/id_rsa');
curl_setopt($ch, CURLOPT_SSH_PUBLIC_KEYFILE, '/home/web/.ssh/id_rsa.pub');
curl_setopt($ch, CURLOPT_SSH_AUTH_TYPES, CURLSSH_AUTH_PUBLICKEY);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_QUOTE, array("DELE /dispatch/confirm/W00027478.csv"));
$result = curl_exec($ch);
$error_no = curl_errno($ch);
curl_close($ch);
if ($error_no == 0) {
echo "Delete File $filename<br>";
} else {
echo "File Not Delete $filename<br>";
}
Run Code Online (Sandbox Code Playgroud)