Exemplo n.º 1
0
 public function scan()
 {
     $url = $_REQUEST['url'];
     $scraper = new Site_scraper($url);
     $results = $scraper->execute();
     $profiles = $results['profiles'];
     $feeds = $results['feeds'];
     $p = array();
     foreach ($profiles as $profile) {
         $item = ORM::factory('profile');
         $item->favicon = socialFeed::get_favicon_from($profile);
         $item->url = $profile;
         $item->fl_active = 1;
         $item->save();
         $p[] = $item->as_array();
     }
     $f = array();
     foreach ($feeds as $title => $feed) {
         $item = ORM::factory('external_feed');
         $item->favicon = socialFeed::get_favicon_from($feed['profile']);
         $item->title = $title;
         $item->url = $feed['feed'];
         $item->save();
         $f[] = $item->as_array();
     }
     $array = array("profiles" => $p, "feeds" => $f);
     echo json_encode($array);
     exit;
 }
Exemplo n.º 2
0
 public function __construct()
 {
     socialFeed::get_favicon_from('http://www.delicious.com/sydlawrence');
     $this->session = Session::instance();
     $this->db = new Database();
     parent::__construct();
     $_POST = $this->input->xss_clean($_POST);
     if ($this->input->post('attempt_login')) {
         $return = login::attempt_login();
         if (isset($return->id) && $return->id > 0) {
             $this->user = $return;
         } else {
             $this->__set_options(array('error' => $return));
         }
         if (isset($_GET['redirect'])) {
             url::redirect(urldecode($_GET['redirect']));
         }
     }
     $this->user = login::check_login();
     if ($this->input->get('logout')) {
         Auth::instance()->logout(TRUE);
         url::redirect();
     }
     $this->page = Page_Model::get_by_url();
     $this->feed = Feed_Model::get_by_url();
     $this->feedpost = Feedpost_Model::get_by_url();
     $this->__setup();
     $this->header = new View('includes/header');
     $this->footer = new View('includes/footer');
     $this->__binds();
 }
Exemplo n.º 3
0
 public function get_favicon()
 {
     return socialFeed::get_favicon_from($this->url);
 }