V
V
VadinTrueStudio2020-02-03 12:25:32
PHP
VadinTrueStudio, 2020-02-03 12:25:32

How to use the new api instagram()facebook to display posts from instagram?

Good afternoon! There was a site that displayed Instagram posts from the account. Posts from your account were displayed on each page. But in November there was a change in the api and the posts were no longer displayed. I read the api several times, but it is too incomprehensible there and there are many questions with the implementation. How to use the new api instagram (facebook) to display posts from instagram? Are there any examples, articles or videos on YouTube. I would be very grateful.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem Volkov, 2020-02-03
@Artemkeer

$token = 'Токен'; // https://instagram.pixelunion.net/ (потребуется авторизация в инсте)
$user_id = 'сюда цифры айди';  // https://codeofaninja.com/tools/find-instagram-user-id (получить id можно тут)

$instagram_cnct = curl_init(); // инициализация cURL подключения
curl_setopt( $instagram_cnct, CURLOPT_URL, "https://api.instagram.com/v1/users/" . $user_id . "/media/recent?access_token=" . $token ); // подключаемся
curl_setopt( $instagram_cnct, CURLOPT_RETURNTRANSFER, 1 ); // просим вернуть результат
curl_setopt( $instagram_cnct, CURLOPT_TIMEOUT, 15 );
$media = json_decode( curl_exec( $instagram_cnct ) ); // получаем и декодируем данные из JSON
curl_close( $instagram_cnct ); // закрываем соединение

foreach(array_slice($media->data, 0) as $data) {
var_dump($data);
}

M
Maria, 2020-02-14
@ZhemmehZ

https://frisbuy.ru/ is suitable for automatic display of your posts and posts of clients (who tagged the brand, put a hashtag or location)
convenient if you need to translate from the post itself to the desired pages on the site
example - https://viviennesabo.com /instashopping
example "our customer reviews block" https://www.mothercare.ru/ru/%D0%BA%D0%B0%D0%BF%D1...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question