Пример #1
0
 public function getTimelines(&$statuses, $twitter_statuses)
 {
     foreach (explode(",", $twitter_statuses) as $user) {
         $params = array("screen_name=" . $user, "count=12", "include_rts=1");
         $statsUser = Tweet::tweetsFrom($user)->get();
         if (!$statsUser->isEmpty()) {
             $params[] = "since_id" . $statsUser[0]->id;
         }
         $tweets = json_decode(SocialPhishController::twitterTimeline($user, $params));
         if ($tweets) {
             foreach ($tweets as $entry) {
                 $statuses[$entry->id_str] = $entry;
             }
         }
     }
 }
Пример #2
0
 /**
  *    Gets images from Instagram
  */
 public function getFromInstagram($type, &$collect, &$streams, &$users)
 {
     $last = null;
     $fields = $type == 'instagram' ? array('log') : array('tid');
     if ($last = Image::lastByType($type, $fields)->get()) {
         //dd($last);
         if (isset($last[0])) {
             $last = $last[0]->log;
         }
     }
     $images = $type == 'instagram' ? SocialPhishController::instagram($last) : SocialPhishController::instatag($last);
     if (!empty($images)) {
         foreach ($images as $media) {
             if ($media->type == 'image') {
                 $collect[$media->id] = $this->parseCollectAndStreams($media, $type);
             } else {
                 $streams[$media->id] = $this->parseCollectAndStreams($media, $type);
             }
             $users[$media->user->username] = $this->parseUsers($media);
         }
     }
 }