neilcrookes / cakephp-gdata-plugin Goto Github PK
View Code? Open in Web Editor NEWCakePHP plugin for interacting with Gdata API
Home Page: http://www.neilcrookes.com/
CakePHP plugin for interacting with Gdata API
Home Page: http://www.neilcrookes.com/
Here's a patch to models/you_tube_playlist.php
:
83d82
< 'playlist' => true,
144,154d142
< $query = $this->_paginationParams($query);
< return $query;
< } else {
< return $results;
< }
< }
<
< protected function _findPlaylist($state, $query = array(), $results = array()) {
< if ($state == 'before') {
< $this->request['auth'] = true;
< $this->request['uri']['path'] = 'feeds/api/playlists/' . $query['conditions']['playlistId'];
I've added support for the Google Documents List API in my fork.
Here's my master which includes all this, as well as other my other fixes: http://github.com/jamiemill/CakePHP-GData-Plugin/commits/master
Sorry - I suppose I should have created a separate branch for this to separate it from the other enhancements, I'm not that used to collaboration! What should I do... separate it out on to a separate branch and send a pull request? Or could you merge it from here?
I found that the use of $this->here caused me a problem for an app I'm running in a subdirectory, because $this->here includes the subdirectory, so it's unsuitable for passing to the Router. Instead I used '/'.$this->params['url']['url'] which I use commonly, because it doesn't have the prefix. (see http://book.cakephp.org/view/423/url)
Also, I saw you URLEncoded the redirect URL 3 times for passing in the request URL, but I found I had to do it 4 times!. Obviously something wrong there, so I tried base64URLencoding instead (just once) and it works much better for me and I hope this would be a lot more robust to be passed around.
Both these enhancements are here included in my fork in this commit: http://github.com/jamiemill/CakePHP-GData-Plugin/commit/aeb66bdcb4a664cd8b185b88ffad4b39135f3d2d - but I'm filing other tickets too and have commited various other things I'd love you to pull in if appropriate too.
I wanted to store the access token and secret in the database rather than in the session, but I found that there's no opportunity to grab a newly-created token before the component redirects, and instead I'd have to read it from the session.
Not such a problem I suppose, but I've no way of knowing when a new token has been generated and it seemed much cleaner to add a way to disable the autoRedirect in GdataAuthComponent:: getOAuthAccessToken() and return the new data instead, so my controller can capture it at the right instance.
I added an $autoRedirect = true param to the signature here, hopefully it's a drop-in replacement:
http://github.com/jamiemill/CakePHP-GData-Plugin/commit/7ddeb0698809eb25b9da24a235a09cd695eed1c1
If you wish to force google to show a "google hosted domain" login page rather than the personal google login page, you can pass the &hd=mydomain.com parameter to https://www.google.com/accounts/OAuthAuthorizeToken. (see http://code.google.com/apis/accounts/docs/OAuth_ref.html#Parameters3 )
This seems to me to be important, as it is impossible to log into a hosted domain through the personal google login.
To solve this I added space for extraParams in the GdataAuthComponent::getOAuthRequestToken signature here:
http://github.com/jamiemill/CakePHP-GData-Plugin/commit/6102c82d9c045d760475122adc25eefe61347a4a
It defaults to an empty array so shouldn't upset any existing implementations.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.