BiteStats to have access to their data 1) Get a Request Token <?php // Get Request Token $oauth = new new OAuth($config['consumer_key'], $config['consumer_secret'] ); $oauth->setAuthType(OAUTH_AUTH_TYPE_URI); $request_options = array array("scope" => $config['scope'], "oauth_callback" => $config['callbackurl']); $url = $config['requesturl'] . '?' . http_build_query($request_options); $token_req = $oauth->getRequestToken($url);
BiteStats to have access to their data 2) Send the user off to google to authenticate <?php $oauth_options = array array( "oauth_token" => $token_req['oauth_token'], "oauth_token_secret" => $token_req['oauth_token_secret'] ); $url = $config['oauthurl'] . '?' . http_build_query($oauth_options); $this->_redirect($url);
BiteStats to have access to their data 3) User returns, and we can get the access token <?php $oauth = new new OAuth($config['consumer_key'], $config['consumer_secret'] ); $oauth->setAuthType(OAUTH_AUTH_TYPE_URI); $oauth->setToken($config['request_token'], $config['request_token_secret']); $access = $oauth->getAccessToken($config['access_uri'], null null, $config['verification']);
user have access to? <?php $oauth = new new OAuth($consumer_key, $consumer_secret ); $oauth->setToken($access_token, $access_token_secret); $result = $oauth->fetch( 'https://www.google.com/analytics/feeds/datasources/ga/accounts/' . $account_id . '/webproperties/~all/profiles'); They can pick which ones they want every month, or request one NOW
servers add jobs to the queue Web server then gets on with whatever it was doing Worker processes fetch jobs from the queue, and process them Gearman oversees each job being succesfully completed
PDF Still need to do some maths yourself! The origin (0,0) is in the bottom left of the page ... public function drawLine($x1, $y1, $x2, $y2); public function drawText($text, $x, $y, $charEncoding = ''); public function drawImage(Zend_Pdf_Resource_Image $image, $x1, $y1, $x2, $y2);
create incrementally-numbered tag export code and tar it up transfer it to live, and untar it handle db patches and things point the docroot symlink at the new files restart the gearman workers ... all in one command