Ejemplo n.º 1
0
 /**
  * Initialize debugging (using the Request instance).
  * Load the configuration settings.
  *
  * @return	void
  */
 public function __construct()
 {
     $this->_debug = class_exists('MMI_Request') ? MMI_Request::debug() : FALSE;
     $config = MMI_API::get_config();
     $this->_service_config = $config->get($this->_service, array());
     $this->_auth_config = Arr::get($this->_service_config, 'auth', array());
 }
Ejemplo n.º 2
0
 /**
  * Initialize debugging (using the Request instance).
  * Include the OAuth vendor files.
  * Load the configuration settings.
  *
  * @return	void
  */
 public function __construct()
 {
     require_once Kohana::find_file('vendor', 'oauth/required');
     $this->_debug = class_exists('MMI_Request') ? MMI_Request::debug() : FALSE;
     $config = MMI_API::get_config();
     $this->_service_config = $config->get($this->_service, array());
     $this->_auth_config = Arr::get($this->_service_config, 'auth', array());
 }
Ejemplo n.º 3
0
 /**
  * Test the Mixx API.
  *
  * @return	void
  */
 public function action_index()
 {
     $config = MMI_API::get_config(TRUE);
     $username = Arr::path($config, 'mixx.auth.username', 'memakeit');
     $svc = MMI_API::factory(MMI_API::SERVICE_MIXX);
     //		$response = $svc->get('users/show', array('user_key' => $username));
     $requests = array('profile' => array('url' => 'users/show', 'parms' => array('user_key' => $username)), 'real-life-size-bus-transformer' => array('url' => 'thingies/show', 'parms' => array('url' => 'http://www.atcrux.com/2010/03/11/real-life-size-bus-transformer/', 'comments' => 1, 'tags' => 1)));
     $response = $svc->mget($requests);
     $this->_set_response($response, $svc->service());
 }
Ejemplo n.º 4
0
 /**
  * Test the GitHub API.
  *
  * @return	void
  */
 public function action_index()
 {
     $config = MMI_API::get_config(TRUE);
     $username = Arr::path($config, 'github.auth.username', 'memakeit');
     $svc = MMI_API::factory(MMI_API::SERVICE_GITHUB);
     //		$response = $svc->get("user/show/{$username}");
     $requests = array($username => array('url' => "user/show/{$username}"), 'shadowhand' => array('url' => 'user/show/shadowhand'));
     $response = $svc->mget($requests);
     $this->_set_response($response, $svc->service());
 }
Ejemplo n.º 5
0
 /**
  * Test the Gowalla API.
  *
  * @return	void
  */
 public function action_index()
 {
     $config = MMI_API::get_config(TRUE);
     $username = Arr::path($config, 'gowalla.auth.username', 'memakeit');
     $svc = MMI_API::factory(MMI_API::SERVICE_GOWALLA);
     //		$response = $svc->get("users/{$username}");
     $requests = array('profile' => array('url' => "users/{$username}"), 'stamps' => array('url' => "users/{$username}/stamps"), 'top spots' => array('url' => "users/{$username}/top_spots"));
     $response = $svc->mget($requests);
     $this->_set_response($response, $svc->service());
 }
Ejemplo n.º 6
0
 /**
  * Test the SlideShare API.
  *
  * @return	void
  */
 public function action_index()
 {
     $config = MMI_API::get_config(TRUE);
     $username = Arr::path($config, 'slideshare.auth.username', 'memakeit');
     $svc = MMI_API::factory(MMI_API::SERVICE_SLIDESHARE);
     //		$response = $svc->get('get_slideshows_by_user', array('username_for' => $username, 'detailed' => '1'));
     $requests = array('user slideshows' => array('url' => 'get_slideshows_by_user', 'parms' => array('username_for' => $username, 'detailed' => '1')), 'user groups' => array('url' => 'get_user_groups', 'parms' => array('username_for' => $username)), 'user contacts' => array('url' => 'get_user_contacts', 'parms' => array('username_for' => $username)), 'get slideshow' => array('url' => 'get_slideshow', 'parms' => array('slideshow_url' => 'http://www.slideshare.net/vortexau/improving-php-application-performance-with-apc-presentation', 'detailed' => '1')));
     $response = $svc->mget($requests);
     $this->_set_response($response, $svc->service());
 }
Ejemplo n.º 7
0
 /**
  * Test the Reddit API.
  *
  * @return	void
  */
 public function action_index()
 {
     $config = MMI_API::get_config(TRUE);
     $username = Arr::path($config, 'reddit.auth.username', 'memakeit');
     $svc = MMI_API::factory(MMI_API::SERVICE_REDDIT);
     $svc->login();
     //		$response = $svc->get('api/info', array('url' => 'http://www.1stwebdesigner.com/tutorials/create-stay-on-top-menu-css3-jquery/'));
     $requests = array('user about' => array('url' => "user/{$username}/about"), 'clear vote' => array('method' => MMI_HTTP::METHOD_POST, 'url' => 'api/vote', 'parms' => array('api_type' => 'json', 'dir' => '0', 'id' => 't3_ckvqi', 'r' => 'web_design')));
     $response = $svc->mexec($requests);
     $this->_set_response($response, $svc->service());
 }
Ejemplo n.º 8
0
 /**
  * Test the LastFM API.
  *
  * @return	void
  */
 public function action_index()
 {
     $config = MMI_API::get_config(TRUE);
     $username = Arr::path($config, 'lastfm.auth.username', 'memakeit');
     $parms1 = array('method' => 'user.getinfo', 'user' => $username);
     $parms2 = array('method' => 'artist.gettoptracks', 'artist' => 'the fall');
     $svc = MMI_API::factory(MMI_API::SERVICE_LASTFM);
     //		$response = $svc->get(NULL, $parms1);
     $requests = array($parms1['method'] => array('parms' => $parms1), $parms2['method'] => array('parms' => $parms2));
     $response = $svc->mget($requests);
     $this->_set_response($response, $svc->service());
 }
Ejemplo n.º 9
0
 /**
  * Test the Tumblr API.
  *
  * @return	void
  */
 public function action_index()
 {
     $config = MMI_API::get_config(TRUE);
     $email = 'XXXXXXXXXX';
     $password = '******';
     $username = Arr::path($config, 'tumblr.auth.username', 'memakeit');
     $svc = MMI_API::factory(MMI_API::SERVICE_TUMBLR);
     //		$response = $svc->get('http://memakeit.tumblr.com/api/read');
     $requests = array('posts' => array('url' => "http://{$username}.tumblr.com/api/read"), 'pages' => array('url' => "http://{$username}.tumblr.com/api/pages"), 'posts (private)' => array('method' => MMI_HTTP::METHOD_POST, 'url' => "http://{$username}.tumblr.com/api/read", 'parms' => array('email' => $email, 'password' => $password)), 'likes' => array('method' => MMI_HTTP::METHOD_POST, 'url' => 'likes', 'parms' => array('email' => $email, 'password' => $password)), 'settings' => array('method' => MMI_HTTP::METHOD_POST, 'url' => 'authenticate', 'parms' => array('email' => $email, 'password' => $password)));
     $response = $svc->mexec($requests);
     $this->_set_response($response, $svc->service());
 }
Ejemplo n.º 10
0
 /**
  * Test the Picasa API.
  *
  * @return	void
  */
 public function action_index()
 {
     $config = MMI_API::get_config(TRUE);
     $username = Arr::path($config, 'picasa.auth.username', 'memakeit');
     $svc = MMI_API::factory(MMI_API::SERVICE_PICASA);
     if (!$svc->is_valid_token(NULL, TRUE)) {
         die(HTML::anchor($svc->get_auth_redirect(), $svc->service() . ' authorization required'));
     }
     //		$response = $svc->get("user/{$username}", array('kind' => 'photo', 'access' => 'all'));
     $requests = array('albums' => array('url' => "user/{$username}", 'parms' => array('kind' => 'album', 'access' => 'all')), 'recent photos' => array('url' => "user/{$username}", 'parms' => array('kind' => 'photo', 'access' => 'all')));
     $response = $svc->mget($requests);
     $this->_set_response($response, $svc->service());
 }
Ejemplo n.º 11
0
 /**
  * Test the FriendFeed API.
  *
  * @return	void
  */
 public function action_index()
 {
     $config = MMI_API::get_config(TRUE);
     $username = Arr::path($config, 'friendfeed.auth.username', 'memakeit');
     $svc = MMI_API::factory(MMI_API::SERVICE_FRIENDFEED);
     if (!$svc->is_valid_token(NULL, TRUE)) {
         die(HTML::anchor($svc->get_auth_redirect(), $svc->service() . ' authorization required'));
     }
     //		$response = $svc->get('feed/home');
     $requests = array('me feed' => array('url' => 'feed/me'), 'user feed' => array('url' => "feed/{$username}"), 'friends feed' => array('url' => "feed/{$username}/friends"), 'comments feed' => array('url' => "feed/{$username}/comments"), 'likes feed' => array('url' => "feed/{$username}/likes"));
     $response = $svc->mget($requests);
     $this->_set_response($response, $svc->service());
 }
Ejemplo n.º 12
0
 /**
  * Test the Brightkite API.
  *
  * @return	void
  */
 public function action_index()
 {
     $config = MMI_API::get_config(TRUE);
     $username = Arr::path($config, 'brightkite.auth.username', 'memakeit');
     $svc = MMI_API::factory(MMI_API::SERVICE_BRIGHTKITE);
     if (!$svc->is_valid_token(NULL, TRUE)) {
         die(HTML::anchor($svc->get_auth_redirect(), $svc->service() . ' authorization required'));
     }
     //		$response = $svc->get("people/{$username}");
     $requests = array('profile' => array('url' => "people/{$username}"), 'config' => array('url' => "people/{$username}/config"), 'friends' => array('url' => "people/{$username}/friends"), 'placemarks' => array('url' => "people/{$username}/placemarks"), 'objects' => array('url' => "people/{$username}/objects", 'parms' => array('filters' => 'checkins,notes,photos')));
     $response = $svc->mget($requests);
     $this->_set_response($response, $svc->service());
 }
Ejemplo n.º 13
0
 /**
  * Test the Digg API.
  *
  * @return	void
  */
 public function action_index()
 {
     $config = MMI_API::get_config(TRUE);
     $username = Arr::path($config, 'digg.auth.username', 'memakeit');
     $svc = MMI_API::factory(MMI_API::SERVICE_DIGG);
     if (!$svc->is_valid_token(NULL, TRUE)) {
         die(HTML::anchor($svc->get_auth_redirect(), $svc->service() . ' authorization required'));
     }
     //		$response = $svc->get(NULL, array('method' => 'user.getInfo', 'username' => $username));
     $requests = array('user.getDiggs' => array('url' => '', 'parms' => array('method' => 'user.getDiggs', 'username' => $username)), 'user.getInfo' => array('url' => '', 'parms' => array('method' => 'user.getInfo', 'username' => $username)));
     $response = $svc->mget($requests);
     $this->_set_response($response, $svc->service());
 }