Find Jobs
Hire Freelancers

Load several instagram accounts at same time

$10-20 USD

Завершено
Опублікований over 8 years ago

$10-20 USD

Оплачується при отриманні
I have very small issue and I think the issue is in lib/[login to view URL] but im not sure. I'm having several names and access tokens stored in my MySql database and I want to display images for those users. I have found a library online and it works great. I'm testing my account and so far so good. But the problem appears when I'm display all accounts. It's just showing latest account added.. While loop is working great to fetch data from MySQL but the problem comes when I add this Instagram code. I want to dislay all instagram accounts and their images which I have in the database. Here is the code: lib/[login to view URL] <?php class InstaWCD{ function userID(){ $username = strtolower($this->username); // sanitization $token = $this->access_token; $url = "[login to view URL]".$username."&access_token=".$token; $get = file_get_contents($url); $json = json_decode($get); foreach($json->data as $user){ if($user->username == $username){ return $user->id; } } return '00000000'; // return this if nothing is found } function userMedia(){ $url = '[login to view URL]'.$this->userID().'/media/recent/?access_token='.$this->access_token; $content = file_get_contents($url); return $json = json_decode($content, true); } } $insta = new InstaWCD(); $insta->username = $username; $insta->access_token = $access_token; ?> And the code I'm trying to run. <?php $statement = $dbConn->prepare("SELECT v2_instagram_users.user_id, v2_instagram_users.instagram_id, [login to view URL], [login to view URL], [login to view URL], v2_instagram_users.instagram_access_token, users.user_name, users.user_age, [login to view URL], [login to view URL], users.gender_search, users.age_from, users.age_to FROM v2_instagram_users, users WHERE v2_instagram_users.user_id = [login to view URL] ORDER by [login to view URL] DESC"); $statement->execute(); while ($row = $statement->fetch(PDO::FETCH_BOTH)) { $username = $row['username']; $access_token = $row['instagram_access_token']; $count = 20; // number of images to show include 'lib/[login to view URL]'; //include instagram library ?> <?php $ins_media = $insta->userMedia(); $i = 0; foreach ($ins_media['data'] as $vm): if($count == $i){ break;} $i++; $img = $vm['images']['low_resolution']['url']; $link = $vm["link"]; ?> <a target="_blank" href="<?php echo $link ?>"> <img src="<?php echo $img; ?>" width="175" style="float:left;" /> </a> <?php endforeach ?> <?php } ?> Can you solve this.. This should take 5 mins max if you are good developer :)
ID проекту: 9481336

Про проект

3 пропозицій(-ї)
Дистанційний проект
Активність 8 yrs ago

Хочете заробити?

Переваги подання заявок на Freelancer

Вкажіть свій бюджет та терміни
Отримайте гроші за свою роботу
Опишіть свою пропозицію
Реєстрація та подання заявок у проекти є безкоштовними
Доручений:
Аватарка користувача
$15 USD за 1 день
0,0 (0 відгуки(-ів))
0,0
0,0

Про клієнта

Прапор SWEDEN
Helsingborg, Sweden
5,0
9
Спосіб оплати верифіковано
На сайті з бер. 8, 2012

Верифікація клієнта

Дякуємо! Ми надіслали на вашу електронну пошту посилання для отримання безкоштовного кредиту.
Під час надсилання електронного листа сталася помилка. Будь ласка, спробуйте ще раз.
Зареєстрованих користувачів Загальна кількість опублікованих робіт
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Завантажуємо для перегляду
Дозвіл на визначення геолокації надано.
Ваш сеанс входу закінчився, і сеанс було закрито. Будь ласка, увійдіть знову.