Нет, не хватает мне моих ресурсов, чтоб я модуль написал.
Есть код
function SendRequest($url, $post, $post_data, $user_agent, $cookies) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://i.instagram.com/api/v1/'.$url);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
if($post) {
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
}
if($cookies) {
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
} else {
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
}
$response = curl_exec($ch);
$http = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
return array($http, $response);
}
function GenerateGuid() {
return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
mt_rand(0, 65535),
mt_rand(0, 65535),
mt_rand(0, 65535),
mt_rand(16384, 20479),
mt_rand(32768, 49151),
mt_rand(0, 65535),
mt_rand(0, 65535),
mt_rand(0, 65535));
}
Он вот так работает
http://lancenewman.me/ig/Все что нужно, чтоб репостируемая картинка была квадратная. Первая картинка у меня всегда квардратиш.
Как сделать так, чтоб этот код заработал на моей странице в product.tpl или в блоке soscialsharing.tpl не принципиально.
Но чтоб эта функция по умолчанию брала дефолтный image (тот что отмечен в метатегах opengraph) и публиковала на instagram.
Пожалуйста, помогите, подскажите. Я уже понял, что без вашей помощи я ничего написать сам не могу
Вот статья автора
http://lancenewman.me/posting-a-photo-to-instagram-without-a-phone/