/** * Get network updates and add it to database * * @access public * @return void */ public function getUpdates() { $token = unserialize($this->_token['data']); if (is_array($token)) { $this->_linkedin->setToken($token); $qOptions = array('?scope=self&count=250&show-hidden-members=true', '?scope=self&type=SHAR&count=250&show-hidden-members=true', '?count=250&show-hidden-members=true', '?type=SHAR&count=250&show-hidden-members=true'); foreach ($qOptions as $options) { $result = array(); $response = $this->_linkedin->updates($options); $result = $this->parseUpdates($response['linkedin']); echo $response['linkedin'] . "\n"; $response = null; if (count($result) > 0) { foreach ($result as $update) { $activity = new Social_activity(); foreach ($update as $k => $v) { if (is_array($v)) { $v = serialize($v); } $activity->{$k} = $v; } $activity->save(); } } } } }
/** * Linkedin post like * * @access public * @return void */ public function linkedin_unlike() { $this->load->library('Socializer/socializer'); $linkedin = Socializer::factory('Linkedin', $this->c_user->id); $response = $linkedin->unlike(); if ($response['linkedin'] == '') { $result['success'] = true; Social_activity::inst()->update_other_field($this->input->post('key'), 'liked', 'false'); } else { $result['success'] = false; $result['error'] = simplexml_load_string($response['linkedin'])->message; } echo json_encode($result); }