Exemple #1
0
 public function onGetFBPageInfor()
 {
     $post = post();
     extract($post);
     $obj = array();
     if (!empty($AdSharePage['fb_link'])) {
         $obj = UserAccessToken::get_fb_page_infor($AdSharePage['fb_link']);
     }
 }
Exemple #2
0
 public function getAdSharePage()
 {
     $records = AdShare::whereRaw('status = ? AND crawl = ?', array(true, false))->take(100)->get();
     if (!count($records)) {
         AdShare::all()->update(array('crawl' => false));
         return Response::json(array('status' => 'error'), 500);
     }
     foreach ($records as $record) {
         if ($record->fb_id) {
             $link = "https://www.facebook.com/" . $record->fb_id;
             UserAccessToken::get_fb_page_infor($AdSharePage['fb_link']);
             $record->crawl = true;
             $record->save();
         }
     }
     return Response::json(array('status' => 'success'), 200);
 }