當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Instagram::pagination方法代碼示例

本文整理匯總了PHP中Instagram::pagination方法的典型用法代碼示例。如果您正苦於以下問題:PHP Instagram::pagination方法的具體用法?PHP Instagram::pagination怎麽用?PHP Instagram::pagination使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Instagram的用法示例。


在下文中一共展示了Instagram::pagination方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: instagram

 public function instagram()
 {
     $id = '1600192808';
     set_time_limit(0);
     ini_set('memory_limit', '-1');
     ini_set('max_execution_time', '999999');
     require APPPATH . 'third_party/Instagram/Instagram.php';
     require APPPATH . 'third_party/Instagram/InstagramException.php';
     $config = '2440e15f188a41439c6edcd698ff081f';
     $instagram = new Instagram($config);
     $response = $instagram->getUserMedia($id);
     while ($response && count($response->data)) {
         if ($response->meta->code != 200) {
             print_r($response);
             exit;
         }
         $items = $response->data;
         foreach ($items as $item) {
             if (!isset($item->images->standard_resolution->url)) {
                 continue;
             }
             $link = $item->link;
             $sql = "select * from instagram where link = '{$link}'";
             $row = $this->db->query($sql)->row();
             if ($row) {
                 die('FINISH');
             }
             $file = str_replace(array('https://instagram.com/p/', '/'), '', $link) . '.jpg';
             $folder = 'instagram/';
             $url = $item->images->low_resolution->url;
             copy($url, FCPATH . 'files/' . $folder . $file);
             $this->db->insert('nz_file', array('id_folder' => 28, 'id_type' => 1, 'file' => $folder . $file, 'name' => $file, 'alt' => '', 'id_user' => 1, 'deleted' => 0, 'date' => date('Y-m-d H:i:s')));
             $idf = $this->db->insert_id();
             $this->db->insert('instagram', array('id_file' => $idf, 'link' => $link));
         }
         $response = $instagram->pagination($response);
     }
 }
開發者ID:juanazareno,項目名稱:ananagulo,代碼行數:38,代碼來源:app.php

示例2: smamo_instagram

function smamo_instagram()
{
    // Klargør svar
    $response = array();
    $num = isset($_POST['num']) ? 4 * wp_strip_all_tags($_POST['num']) : 4;
    // vi skal bruge et hashtag, ellers die();
    if (!isset($_POST['hash'])) {
        $response['code'] = '400';
        $response['error'] = 'No hashtag received';
        wp_die(json_encode($response));
    }
    // Indstil $tag
    $tag = wp_strip_all_tags($_POST['hash']);
    // Inkluder instagram class
    require get_template_directory() . '/functions/instagram/instagram.class.php';
    // Opret ny instance
    $instagram = new Instagram(array('apiKey' => 'dd36cc7a7be445c8a00d9f383e49f8c8', 'apiSecret' => 'e750735ffba74f8a8ed753a33c7351da', 'apiCallback' => 'http://faaborg-gym.dk'));
    $response['images'] = array();
    $inst_obj = $instagram->getTagMedia($tag, $num);
    $next_page = $instagram->pagination($inst_obj);
    $response['next'] = $next_page;
    foreach ($inst_obj->data as $key => $val) {
        $response['images'][] = $val;
    }
    wp_die(json_encode($response));
}
開發者ID:JeppeSigaard,項目名稱:faaborggym,代碼行數:26,代碼來源:ajax-instagram.php


注:本文中的Instagram::pagination方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。