| | 46 | |
|---|
| | 47 | // google scopes |
|---|
| | 48 | 'contacts_api' => 'http://www.google.com/m8/feeds/', |
|---|
| | 49 | 'calendar_api' => 'http://www.google.com/calendar/feeds/', |
|---|
| | 50 | 'blogger_api' => 'http://www.blogger.com/feeds/', |
|---|
| | 51 | 'analytics_api' => 'https://www.google.com/analytics/feeds/', |
|---|
| | 52 | 'base_api' => 'http://www.google.com/base/feeds/', |
|---|
| | 53 | 'books_api' => 'http://www.google.com/books/feeds/', |
|---|
| | 54 | 'docs_api' => 'http://docs.google.com/feeds/', |
|---|
| | 55 | 'finance_api' => 'http://finance.google.com/finance/feeds/', |
|---|
| | 56 | 'gmail_api' => 'https://mail.google.com/mail/feed/atom', |
|---|
| | 57 | 'health_api' => 'https://www.google.com/h9/feeds/', |
|---|
| | 58 | 'maps_api' => 'http://maps.google.com/maps/feeds/', |
|---|
| | 59 | 'picasa_api' => 'http://picasaweb.google.com/data/', |
|---|
| | 60 | 'opensocial_api' => 'http://www-opensocial.googleusercontent.com/api/', |
|---|
| | 61 | 'spreadsheets_api' => 'http://spreadsheets.google.com/feeds/', |
|---|
| | 62 | 'webmaster_api' => 'http://www.google.com/webmasters/tools/feeds/', |
|---|
| | 63 | 'youtube_api' => 'http://gdata.youtube.com', |
|---|
| | 64 | |
|---|
| | 70 | public function getRequestToken(array $scopes = array()) |
|---|
| | 71 | { |
|---|
| | 72 | $apis = array(); |
|---|
| | 73 | foreach($scopes as $scope) |
|---|
| | 74 | { |
|---|
| | 75 | $scope_api = $scope.'_api'; |
|---|
| | 76 | if (isset($this->options[$scope_api])) |
|---|
| | 77 | { |
|---|
| | 78 | $apis = $this->options[$scope_api]; |
|---|
| | 79 | } |
|---|
| | 80 | else |
|---|
| | 81 | { |
|---|
| | 82 | throw new sfException(); |
|---|
| | 83 | } |
|---|
| | 84 | } |
|---|
| | 85 | |
|---|
| | 86 | return $this->getConsumer()->getRequestToken(sprintf('%s?scope=%s', $this->options['oauth_request_token_api'], oauth_urlencode(implode(' ', $apis))), $callbackUrl); |
|---|
| | 87 | } |
|---|
| | 88 | |
|---|
| | 89 | public function getProfile() |
|---|
| | 90 | { |
|---|
| | 91 | if ($this->options['logging']) |
|---|
| | 92 | { |
|---|
| | 93 | $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Fetching yahoo user presence for guid: "%s"', $guid)))); |
|---|
| | 94 | } |
|---|
| | 95 | |
|---|
| | 96 | $this->getConsumer()->fetch(sprintf('%s/user/%s/presence/presence?format=json', $this->options['social_api'], oauth_urlencode($guid))); |
|---|
| | 97 | |
|---|
| | 98 | return json_decode($this->getConsumer()->getLastResponse()); |
|---|
| | 99 | } |
|---|
| | 100 | |
|---|
| | 101 | |
|---|
| 55 | | |
|---|
| | 105 | |
|---|
| | 106 | |
|---|
| | 107 | # Google Base |
|---|
| | 108 | # http://www.google.com/base/feeds/snippets |
|---|
| | 109 | # http://www.google.com/base/feeds/items |
|---|
| | 110 | # http://www.google.com/base/feeds/attributes |
|---|
| | 111 | # http://www.google.com/base/feeds/itemtypes/<locale> |
|---|
| | 112 | # |
|---|
| | 113 | # Analytics |
|---|
| | 114 | # https://www.google.com/analytics/feeds/accounts/default |
|---|
| | 115 | # |
|---|
| | 116 | # Book Search |
|---|
| | 117 | # http://www.google.com/books/feeds/volumes/[<volume_ID>] |
|---|
| | 118 | # http://www.google.com/books/feeds/p/<PARTNER_COBRAND_ID>/volumes |
|---|
| | 119 | # http://www.google.com/books/feeds/users/me/collections/library/volumes |
|---|
| | 120 | # http://www.google.com/books/feeds/users/me/volumes |
|---|
| | 121 | # |
|---|
| | 122 | # Blogger |
|---|
| | 123 | # http://www.blogger.com/feeds/default/blogs |
|---|
| | 124 | # http://www.blogger.com/feeds/<blogID>/posts/default |
|---|
| | 125 | # http://www.blogger.com/feeds/<blogID>/[<postID>]/comments/default |
|---|
| | 126 | # |
|---|
| | 127 | # Calendar |
|---|
| | 128 | # http://www.google.com/calendar/feeds/default/allcalendars/full/[<calendarID>] |
|---|
| | 129 | # http://www.google.com/calendar/feeds/default/owncalendars/full |
|---|
| | 130 | # http://www.google.com/calendar/feeds/default/<visibility>/full/[<eventID>] |
|---|
| | 131 | # |
|---|
| | 132 | # Contacts |
|---|
| | 133 | # http://www.google.com/m8/feeds/contacts/default/full/[<contactID>] |
|---|
| | 134 | # http://www.google.com/m8/feeds/groups/default/full/[<contactID>] |
|---|
| | 135 | # |
|---|
| | 136 | # Documents List |
|---|
| | 137 | # http://docs.google.com/feeds/documents/private/full/ |
|---|
| | 138 | # http://docs.google.com/feeds/acl/private/full/<resource_id> |
|---|
| | 139 | # http://docs.google.com/feeds/folder/private/full/<folder_id> |
|---|
| | 140 | # |
|---|
| | 141 | # Finance |
|---|
| | 142 | # http://finance.google.com/finance/feeds/default/portfolios/[<portfolioID>] |
|---|
| | 143 | # http://finance.google.com/finance/feeds/default/portfolios/<portfolioID>/positions/[<tickerID>] |
|---|
| | 144 | # http://finance.google.com/finance/feeds/default/portfolios/<portfolioID>/positions/<tickerID>/transactions/[<transactionID>] |
|---|
| | 145 | # |
|---|
| | 146 | # YouTube |
|---|
| | 147 | # http://gdata.youtube.com/feeds/api/users/default |
|---|
| | 148 | # http://gdata.youtube.com/feeds/api/users/default/contacts |
|---|
| | 149 | # http://gdata.youtube.com/feeds/api/users/default/favorites |
|---|
| | 150 | # http://gdata.youtube.com/feeds/api/users/default/playlists/[<playlistID>] |
|---|
| | 151 | # http://gdata.youtube.com/feeds/api/users/default/subscriptions |
|---|
| | 152 | # http://gdata.youtube.com/feeds/api/videos/<videoID>/related |
|---|
| | 153 | # http://gdata.youtube.com/feeds/api/videos/<videoID>/responses |
|---|
| | 154 | # http://gdata.youtube.com/feeds/api/videos/<videoID>/comments |
|---|
| | 155 | # http://gdata.youtube.com/feeds/api/standardfeeds/[<regionID>]/top_rated |
|---|
| | 156 | # http://gdata.youtube.com/feeds/api/standardfeeds/[<regionID>]/top_favorites |
|---|
| | 157 | # http://gdata.youtube.com/feeds/api/standardfeeds/[<regionID>]/most_viewed |
|---|
| | 158 | # http://gdata.youtube.com/feeds/api/standardfeeds/[<regionID>]/most_popular |
|---|
| | 159 | # http://gdata.youtube.com/feeds/api/standardfeeds/[<regionID>]/most_recent |
|---|
| | 160 | # http://gdata.youtube.com/feeds/api/standardfeeds/[<regionID>]/most_discussed |
|---|
| | 161 | # http://gdata.youtube.com/feeds/api/standardfeeds/[<regionID>]/most_linked |
|---|
| | 162 | # http://gdata.youtube.com/feeds/api/standardfeeds/[<regionID>]/most_responded |
|---|
| | 163 | # http://gdata.youtube.com/feeds/api/standardfeeds/[<regionID>]/recently_featured |
|---|
| | 164 | # http://gdata.youtube.com/feeds/api/standardfeeds/watch_on_mobile |
|---|
| | 165 | # |
|---|
| | 166 | # Spreadsheets |
|---|
| | 167 | # http://spreadsheets.google.com/feeds/spreadsheets/private/full/[<key>] |
|---|
| | 168 | # http://spreadsheets.google.com/feeds/worksheets/<key>/private/full/[<worksheetID>] |
|---|
| | 169 | # http://spreadsheets.google.com/feeds/list/<key>/<worksheetID>/private/full/[<rowID>] |
|---|
| | 170 | # http://spreadsheets.google.com/feeds/cells/<key>/<worksheetID>/private/full/[<cellID>] |
|---|
| | 171 | # http://spreadsheets.google.com/feeds/<key>/tables/[<tableID>] |
|---|
| | 172 | # http://spreadsheets.google.com/feeds/<key>/records/<tableID>/[<recordID>] |
|---|
| | 173 | # |
|---|
| | 174 | # Webmaster Tools |
|---|
| | 175 | # http://www.google.com/webmasters/tools/feeds/sites/[<siteID>] |
|---|
| | 176 | # http://www.google.com/webmasters/tools/feeds/<siteID>/sitemaps |
|---|
| | 177 | # |
|---|
| | 178 | # Picasa Web |
|---|
| | 179 | # http://picasaweb.google.com/data/feed/api/user/default/[albumid/<albumID>] |
|---|
| | 180 | # http://picasaweb.google.com/data/entry/api/user/default/albumid/<albumID>/<versionNumber> |
|---|
| | 181 | # http://picasaweb.google.com/data/entry/api/user/default/albumid/<albumID>/photoid/<photoID>/<versionNumber> |
|---|
| | 182 | # http://picasaweb.google.com/data/media/api/user/default/albumid/<albumID>/photoid/<photoID>/<versionNumber> |
|---|
| | 183 | # |
|---|
| | 184 | # Maps |
|---|
| | 185 | # http://maps.google.com/maps/feeds/maps/default/full |
|---|
| | 186 | # http://maps.google.com/maps/feeds/maps/userID/full/[<elementID>] |
|---|
| | 187 | # http://maps.google.com/maps/feeds/features/default/[<mapID>]/full/[<elementID>] |
|---|
| | 188 | # |
|---|
| | 189 | # GMail |
|---|
| | 190 | # https://mail.google.com/mail/feed/atom/[<label>] |
|---|
| | 191 | |
|---|
| | 192 | |
|---|