wmaraci reklam

İnstagram Fotoğrafın ID'sini Bulmak hk.

6 Mesajlar 1.688 Okunma
pst.net
wmaraci reklam

epicsosyal epicsosyal Dijital Dünya Kullanıcı
  • Üyelik 24.09.2018
  • Yaş/Cinsiyet 32 / E
  • Meslek Sosyal Mühendis
  • Konum Afyon
  • Ad Soyad M** Ç**
  • Mesajlar 339
  • Beğeniler 36 / 49
  • Ticaret 2, (%100)
Merhabalar, bir fotoğrafımızın olduğunu düşünün ben bunun id'sini nasıl bulabilirim ?

Örnek:
Foto: https://www.instagram.com/p/Bf5W-R_l9Sc/
ID : 1727512969024623772

Yardım edermisiniz bulamadım.:(

Teşekkürler
 

 

wmaraci
reklam

Decimas Decimas WM Aracı Kullanıcı
  • Üyelik 19.04.2015
  • Yaş/Cinsiyet 26 / E
  • Meslek Developer
  • Konum İstanbul Avrupa
  • Ad Soyad E** E**
  • Mesajlar 821
  • Beğeniler 1 / 302
  • Ticaret 1, (%100)

// target media url
$media_url = 'https://www.instagram.com/p/Bf5W-R_l9Sc/';
// api call url
$ig_api_call = "https://api.instagram.com/oembed/?callback=&url={$media_url}";
// get file contents
$response = file_get_contents($ig_api_call);

// if there is valid response
if ($response){
// decode json content
$content = json_decode($response);

// if is set media id and it is not empty
if (isset($content->media_id) && !empty($content->media_id)){
echo $content->media_id;
}

//print_r($content);
}
epicsosyal

kişi bu mesajı beğendi.

no time for caution

epicsosyal epicsosyal Dijital Dünya Kullanıcı
  • Üyelik 24.09.2018
  • Yaş/Cinsiyet 32 / E
  • Meslek Sosyal Mühendis
  • Konum Afyon
  • Ad Soyad M** Ç**
  • Mesajlar 339
  • Beğeniler 36 / 49
  • Ticaret 2, (%100)
Decimas sagolun en kisa zamanda test edecegim.
 

 

epicsosyal epicsosyal Dijital Dünya Kullanıcı
  • Üyelik 24.09.2018
  • Yaş/Cinsiyet 32 / E
  • Meslek Sosyal Mühendis
  • Konum Afyon
  • Ad Soyad M** Ç**
  • Mesajlar 339
  • Beğeniler 36 / 49
  • Ticaret 2, (%100)

Decimas adlı üyeden alıntı


// target media url
$media_url = 'https://www.instagram.com/p/Bf5W-R_l9Sc/';
// api call url
$ig_api_call = "https://api.instagram.com/oembed/?callback=&url={$media_url}";
// get file contents
$response = file_get_contents($ig_api_call);

// if there is valid response
if ($response){
// decode json content
$content = json_decode($response);

// if is set media id and it is not empty
if (isset($content->media_id) && !empty($content->media_id)){
echo $content->media_id;
}

//print_r($content);
}


Artık çalışmıyor yardımcı olabilecek varmı ? :norespond:
 

 

wmaraci
Mersin evden eve nakliyat

Dilekci Dilekci WM Aracı Kullanıcı
  • Üyelik 01.12.2016
  • Yaş/Cinsiyet 26 / E
  • Meslek Öğrenci
  • Konum Konya
  • Ad Soyad M** D**
  • Mesajlar 91
  • Beğeniler 3 / 22
  • Ticaret 2, (%100)
Alternatif olarak curl ile çekebilirsiniz.

$go = "https://www.instagram.com/p/Bf5W-R_l9Sc/";
$url = "https://api.instagram.com/oembed/?callback=&url=" . $go;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_REFERER, "https://google.com");
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36");
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
$result = curl_exec($curl);
$result = json_decode($result, TRUE);

echo $result['media_id'];
epicsosyal

kişi bu mesajı beğendi.

Decimas Decimas WM Aracı Kullanıcı
  • Üyelik 19.04.2015
  • Yaş/Cinsiyet 26 / E
  • Meslek Developer
  • Konum İstanbul Avrupa
  • Ad Soyad E** E**
  • Mesajlar 821
  • Beğeniler 1 / 302
  • Ticaret 1, (%100)

epicsosyal adlı üyeden alıntı

Artık çalışmıyor yardımcı olabilecek varmı ? :norespond:


Bende çalışıyor, belki ua header'dan kaynaklanıyor olabilir.


function curl($url, $user_agent = null)
{
$user_agent = $user_agent ? $user_agent : 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1';
$options = array(
CURLOPT_CUSTOMREQUEST => "GET", //set request type post or get
CURLOPT_POST => false, //set to GET
CURLOPT_USERAGENT => $user_agent, //set user agent
CURLOPT_COOKIEFILE => "cookie.txt", //set cookie file
CURLOPT_COOKIEJAR => "cookie.txt", //set cookie jar
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don't return headers
CURLOPT_FOLLOWLOCATION => true, // follow redirects
CURLOPT_ENCODING => "", // handle all encodings
CURLOPT_AUTOREFERER => true, // set referer on redirect
CURLOPT_CONNECTTIMEOUT => 20, // timeout on connect
CURLOPT_TIMEOUT => 20, // timeout on response
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
);

$ch = curl_init($url);
curl_setopt_array($ch, $options);
$content = curl_exec($ch);
$err = curl_errno($ch);
$errmsg = curl_error($ch);
$header = curl_getinfo($ch);
curl_close($ch);

$header['errno'] = $err;
$header['errmsg'] = $errmsg;
$header['content'] = $content;

return $header;
}

// target media url
$media_url = 'https://www.instagram.com/p/Bf5W-R_l9Sc/';
// api call url
$ig_api_call = "https://api.instagram.com/oembed/?callback=&url={$media_url}";
// get file contents
$response = curl($ig_api_call)['content'];

// if there is valid response
if ($response){
// decode json content
$content = json_decode($response);

// if is set media id and it is not empty
if (isset($content->media_id) && !empty($content->media_id)){
echo $content->media_id;
}

//print_r($content);
}
 

 

no time for caution
wmaraci
Konuyu toplam 1 kişi okuyor. (0 kullanıcı ve 1 misafir)
Site Ayarları
  • Tema Seçeneği
  • Site Sesleri
  • Bildirimler
  • Özel Mesaj Al