<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Test extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -  
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in 
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
	public function index()
	{
		require(APPPATH.'/third_party/fbsdk/Facebook/autoload.php');
		
		$fb = new Facebook\Facebook([
		  'app_id'     => '1509366035981264',
		  'app_secret' => '93d1a42bac5d0f3912e28ed0b987d28a',
		  'default_graph_version' => 'v2.2',
		  ]);
		  $access_token='EAAVcwqppI9ABAKP6MrWIjviQysTLZAAe56CLRM8N9iAvlhuZCZCZBRCevbg30vR06RDkdFZBC0wzebC1SYCabpYjZA7ndZAgheIOWwTDZBZBju8ZCtI7Xu3r7DC6AUaHgREJer7mCbTL9hJxLCMYiAu5BiopSZAAjzsi1534lKhEeaA6QZDZD';
		   $res = $fb->post( '/1756549887910962/feed', array(
                        'message' => 'Welcome to Dewas Classifieds',
                        'access_token'=>$access_token
                  ));
 
                  $post = $res->getGraphObject();
 
                echo $post_id = $post->getProperty('id');
		
	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */