Size: a a a

Love Frontend Chat

2020 September 14

c

cosmonaut in Love Frontend Chat
Oscar Handsome
будь тру кодером
аха вот сейчас ебусь в проекте юзали блядский styled-components
источник

c

cosmonaut in Love Frontend Chat
я бы никогда не потянул бы сталед компонентс
источник

c

cosmonaut in Love Frontend Chat
до меня работал 3 чела и все они дрочили как хотели + тс потянули
источник

c

cosmonaut in Love Frontend Chat
и сука проп-тайпс еще есть
источник

c

cosmonaut in Love Frontend Chat
просто АХУЕННО
источник

OH

Oscar Handsome in Love Frontend Chat
нихуя не понятно, но очень интересно
источник

c

cosmonaut in Love Frontend Chat
Oscar Handsome
нихуя не понятно, но очень интересно
вот именно
источник

IG

Ilshat Gayanov in Love Frontend Chat
Valentine 🦖
Красноярцы публикуют вот такие жуткие видео из центра города. Нашествие насекомых, что дальше, 2020-ый?

@borusio
обычные мошки, видать много осадков было
источник

IC

Ilya Cooller in Love Frontend Chat
Всем привет, помогите
Заказчик попросил настроить ленту instagramm на сайте. Просто поменять новый api, но по каким-то причинам у меня не выходи этого сделать. Попросил его зарегаться через : https://developers.facebook.com и сделать все по инструкции, которую я ему скинул. Он мне перекинул код, который ему дал сам facebook, я так понял это и был api, но он почему-то не работает в коде. Вот код:
<?php
class Instagram {

static function get_gallery($params = array()) {
 $access_token = htmlentities('IGQVJXbTV0eXJfQ3o4cWswak9SYlhPTmo5bVRIR3B2TkZACT1owdlVYMFFDeHlPMXQzdFozZA3RUek04dVJ0NUh4M09DRFBOZA1hpUXVYQ1pFM1hPeXY1dmhGVjNuTXpkSEc1b19FMlRCWTdXVzF2NzJmUgZDZD');
 $unique_str = htmlentities('d4b3e776394f9c');
 $theme_url = get_template_directory();
 $cache_dir = $theme_url.'/'.htmlentities('/cache_instagram');
 $filename = $cache_dir.'/'.date('Ymd').'_'.$unique_str;
 $output = '';
 $output2 = '';
 if (file_exists($filename)) {

  // Если есть файл в кеше - считываем
  $insta_json = file_get_contents($filename);
  $insta_array = json_decode($insta_json, true);

 } else {

  // В противном случае - очищаем папку кеша
  $oldfiles = scandir($cache_dir);
  foreach ($oldfiles as $oldfile) {
   if ($oldfile != '.' && $oldfile != '..' && $oldfile != 'index.php') {
    unlink($cache_dir.'/'.$oldfile);
   }
  }
  reset($oldfiles);

  // Затем получаем новый JSON
  $insta_json = file_get_contents('https://api.instagram.com/v1/users/self/media/recent?access_token='.$access_token);
  $insta_array = json_decode($insta_json, true);

  // И записываем его в файл
  $fp = fopen($filename, 'w');
  fwrite($fp, $insta_json);
  fclose($fp);

 };

 if (isset($insta_array['data'])) {
  $output .= '<div class="instagram-feed">';
  $output .= '<div class="instagram-posts">';
  $output .= '<div class="owl-carousel">';
  foreach($insta_array['data'] as $instagram_post) {
   $post_id = $instagram_post['id'];
   $post_thumb = $instagram_post['images']['standard_resolution']['url'];
   $post_type = $instagram_post['type'];
   $post_link = $instagram_post['link'];
   $post_likes = $instagram_post['likes']['count'];
   $post_comments = $instagram_post['comments']['count'];
   $post_caption = $instagram_post['caption'];
   $post_caption_from = $instagram_post['caption']['from']['username'];
   $post_caption_text = $instagram_post['caption']['text'];
   $profile_full_name = $instagram_post['user']['full_name'];
   $profile_picture = $instagram_post['user']['profile_picture'];
   $profile_username = $instagram_post['user']['username'];

   $post_caption_text_f = '';
   $post_caption_text = str_replace('#', ' #', $post_caption_text);
   $post_caption_text_a = explode(' ', $post_caption_text);
   foreach ($post_caption_text_a as $pctpart) {
    if ($pctpart) {
     if ($pctpart[0] == '#') {
      $pctpart = '<a href="https://www.instagram.com/explore/tags/'.rawurlencode(substr($pctpart, 1)).'/" class="instagram-tag" target="_blank">'.$pctpart.'</a> ';
     };
     $post_caption_text_f .= $pctpart.' ';
    };
   };

   $output .= '<div class="instagram-post">';
   $output .= '<div class="instagram-post-inner" style="background-image: url('.$post_thumb.')">';
   $output .= '<div class="instagram-type type-'.$post_type.'"></div>';
   $output .= '<a href="#" rel="nofollow" class="instagram-post-hover-info js-instagram-post-open" data-id="#instagram_post_'.$post_id.'">';
   $output .= '<div><span>'.$post_likes.'</span> <span>'.$post_comments.'</span></div>';
   $output .= '</a>';
   $output .= '</div>';
   $output .= '</div>';

   $output2 .= '<div class="instagram-popup" id="instagram_post_'.$post_id.'">';
   $output2 .= '<div class="instagram-popup-inner">';

   if ($post_type == 'carousel') {
    if ($instagram_post['carousel_media']) {
     $output2 .= ' <div class="instagram-popup-media instagram-popup-media-carousel">';
     $carousel_count = 0;
     foreach ($instagram_post['carousel_media'] as
$carousel_im
источник

IC

Ilya Cooller in Love Frontend Chat
FFDeHlPMXQzdFozZA3RUek04dVJ0NUh4M09DRFBOZA1hpUXVYQ1pFM1hPeXY1dmhGVjNuTXpkSEc1b19FMlRCWTdXVzF2NzJmUgZDZD&response_type=token
источник

NM

Nikita Mihalyov in Love Frontend Chat
Ilya Cooller
Всем привет, помогите
Заказчик попросил настроить ленту instagramm на сайте. Просто поменять новый api, но по каким-то причинам у меня не выходи этого сделать. Попросил его зарегаться через : https://developers.facebook.com и сделать все по инструкции, которую я ему скинул. Он мне перекинул код, который ему дал сам facebook, я так понял это и был api, но он почему-то не работает в коде. Вот код:
<?php
class Instagram {

static function get_gallery($params = array()) {
 $access_token = htmlentities('IGQVJXbTV0eXJfQ3o4cWswak9SYlhPTmo5bVRIR3B2TkZACT1owdlVYMFFDeHlPMXQzdFozZA3RUek04dVJ0NUh4M09DRFBOZA1hpUXVYQ1pFM1hPeXY1dmhGVjNuTXpkSEc1b19FMlRCWTdXVzF2NzJmUgZDZD');
 $unique_str = htmlentities('d4b3e776394f9c');
 $theme_url = get_template_directory();
 $cache_dir = $theme_url.'/'.htmlentities('/cache_instagram');
 $filename = $cache_dir.'/'.date('Ymd').'_'.$unique_str;
 $output = '';
 $output2 = '';
 if (file_exists($filename)) {

  // Если есть файл в кеше - считываем
  $insta_json = file_get_contents($filename);
  $insta_array = json_decode($insta_json, true);

 } else {

  // В противном случае - очищаем папку кеша
  $oldfiles = scandir($cache_dir);
  foreach ($oldfiles as $oldfile) {
   if ($oldfile != '.' && $oldfile != '..' && $oldfile != 'index.php') {
    unlink($cache_dir.'/'.$oldfile);
   }
  }
  reset($oldfiles);

  // Затем получаем новый JSON
  $insta_json = file_get_contents('https://api.instagram.com/v1/users/self/media/recent?access_token='.$access_token);
  $insta_array = json_decode($insta_json, true);

  // И записываем его в файл
  $fp = fopen($filename, 'w');
  fwrite($fp, $insta_json);
  fclose($fp);

 };

 if (isset($insta_array['data'])) {
  $output .= '<div class="instagram-feed">';
  $output .= '<div class="instagram-posts">';
  $output .= '<div class="owl-carousel">';
  foreach($insta_array['data'] as $instagram_post) {
   $post_id = $instagram_post['id'];
   $post_thumb = $instagram_post['images']['standard_resolution']['url'];
   $post_type = $instagram_post['type'];
   $post_link = $instagram_post['link'];
   $post_likes = $instagram_post['likes']['count'];
   $post_comments = $instagram_post['comments']['count'];
   $post_caption = $instagram_post['caption'];
   $post_caption_from = $instagram_post['caption']['from']['username'];
   $post_caption_text = $instagram_post['caption']['text'];
   $profile_full_name = $instagram_post['user']['full_name'];
   $profile_picture = $instagram_post['user']['profile_picture'];
   $profile_username = $instagram_post['user']['username'];

   $post_caption_text_f = '';
   $post_caption_text = str_replace('#', ' #', $post_caption_text);
   $post_caption_text_a = explode(' ', $post_caption_text);
   foreach ($post_caption_text_a as $pctpart) {
    if ($pctpart) {
     if ($pctpart[0] == '#') {
      $pctpart = '<a href="https://www.instagram.com/explore/tags/'.rawurlencode(substr($pctpart, 1)).'/" class="instagram-tag" target="_blank">'.$pctpart.'</a> ';
     };
     $post_caption_text_f .= $pctpart.' ';
    };
   };

   $output .= '<div class="instagram-post">';
   $output .= '<div class="instagram-post-inner" style="background-image: url('.$post_thumb.')">';
   $output .= '<div class="instagram-type type-'.$post_type.'"></div>';
   $output .= '<a href="#" rel="nofollow" class="instagram-post-hover-info js-instagram-post-open" data-id="#instagram_post_'.$post_id.'">';
   $output .= '<div><span>'.$post_likes.'</span> <span>'.$post_comments.'</span></div>';
   $output .= '</a>';
   $output .= '</div>';
   $output .= '</div>';

   $output2 .= '<div class="instagram-popup" id="instagram_post_'.$post_id.'">';
   $output2 .= '<div class="instagram-popup-inner">';

   if ($post_type == 'carousel') {
    if ($instagram_post['carousel_media']) {
     $output2 .= ' <div class="instagram-popup-media instagram-popup-media-carousel">';
     $carousel_count = 0;
     foreach ($instagram_post['carousel_media'] as
$carousel_im
А ты можешь код всего сайта сюда текстом скинуть пожалуйста спасибо?
источник

IC

Ilya Cooller in Love Frontend Chat
Я понял, спасибо за помощь
источник

V🦖

Valentine 🦖 in Love Frontend Chat
Гист для кого придумали?
источник

IC

Ilya Cooller in Love Frontend Chat
Valentine 🦖
Гист для кого придумали?
источник

V🦖

Valentine 🦖 in Love Frontend Chat
Это пхп, John
источник

JT

John Travolta in Love Frontend Chat
Valentine 🦖
Это пхп, John
Я уже не пхпшник))
источник

A

Artur in Love Frontend Chat
так получи новый аксес токен и дебажь по шагам
источник

IC

Ilya Cooller in Love Frontend Chat
Artur
так получи новый аксес токен и дебажь по шагам
FFDeHlPMXQzdFozZA3RUek04dVJ0NUh4M09DRFBOZA1hpUXVYQ1pFM1hPeXY1dmhGVjNuTXpkSEc1b19FMlRCWTdXVzF2NzJmUgZDZD вот и есть этот токен
Как именно дебажить? Через dev консольку в браузере?
источник

A

Artur in Love Frontend Chat
нет, это же пыха
источник

A

Artur in Love Frontend Chat
я так понял там аксесс токен выдается под апликуху, то есть экспайрится не должен

сначала проверь что  этот запрос верный
$insta_json = file_get_contents('https://api.instagram.com/v1/users/self/media/recent?access_token='.$access_token);
источник