MDL-16341 Almost finished portfolio flickr plugin. Modified phpflickr->request method...
[moodle.git] / lib / flickrlib.php
CommitLineData
36ea9a6c 1<?php
8988c36b 2/**
3 * Modified by Dongsheng Cai <dongsheng@cvs.moodle.org>
4 * ChangeLog:
5 * 1. Remove PEAR HTTP LIB, use curl.class.php (created by myself)
6 * 2. Remove PEAR DB LIB
7 * 3. Remove all cache code, it will implement in curl class.
8 * 4. Clean up session code
9 *
10 * @version $Id$
11 *
12 */
36ea9a6c 13/* phpFlickr Class 2.2.0
14 * Written by Dan Coulter (dan@dancoulter.com)
15 * Sourceforge Project Page: http://www.sourceforge.net/projects/phpflickr/
16 * Released under GNU Lesser General Public License (http://www.gnu.org/copyleft/lgpl.html)
17 * For more information about the class and upcoming tools and toys using it,
18 * visit http://www.phpflickr.com/ or http://phpflickr.sourceforge.net
19 *
aa754fe3 20 * For installation instructions, open the README.txt file packaged with this
21 * class. If you don't have a copy, you can see it at:
22 * http://www.phpflickr.com/README.txt
36ea9a6c 23 *
aa754fe3 24 * Please submit all problems or questions to the Help Forum on my project page:
25 * http://sourceforge.net/forum/forum.php?forum_id=469652
36ea9a6c 26 *
27 */
36ea9a6c 28
29class phpFlickr {
6e1c2bed 30 var $api_key;
31 var $secret;
32 var $REST = 'http://api.flickr.com/services/rest/';
33 var $Upload = 'http://api.flickr.com/services/upload/';
34 var $Replace = 'http://api.flickr.com/services/replace/';
35 var $req;
36 var $response;
37 var $parsed_response;
38 var $die_on_error;
39 var $error_code;
40 var $error_msg;
41 var $token;
42 var $php_version;
36ea9a6c 43
6e1c2bed 44 /*
45 * When your database cache table hits this many rows, a cleanup
46 * will occur to get rid of all of the old rows and cleanup the
47 * garbage in the table. For most personal apps, 1000 rows should
48 * be more than enough. If your site gets hit by a lot of traffic
49 * or you have a lot of disk space to spare, bump this number up.
50 * You should try to set it high enough that the cleanup only
51 * happens every once in a while, so this will depend on the growth
52 * of your table.
53 */
36ea9a6c 54
8988c36b 55 function __construct ($api_key, $secret = NULL, $token = '')
6e1c2bed 56 {
57 global $CFG;
58 //The API Key must be set before any calls can be made. You can
59 //get your own at http://www.flickr.com/services/api/misc.api_keys.html
60 $this->api_key = $api_key;
61 $this->secret = $secret;
8988c36b 62 $this->die_on_error = false;
6e1c2bed 63 $this->service = "flickr";
8988c36b 64 $this->token = $token;
6e1c2bed 65 //Find the PHP version and store it for future reference
66 $this->php_version = explode("-", phpversion());
67 $this->php_version = explode(".", $this->php_version[0]);
9d8047cb 68 $this->curl = new curl(array('cache'=>true));
6e1c2bed 69 }
70
71 function request ($command, $args = array())
72 {
a55d94d4 73 if ($command == 'upload') {
74 $filecontent = $args['photo'];
75 unset($args['photo']);
76 }
77
6e1c2bed 78 //Sends a request to Flickr's REST endpoint via POST.
79 if (substr($command,0,7) != "flickr.") {
80 $command = "flickr." . $command;
81 }
82
83 //Process arguments, including method and login data.
84 $args = array_merge(array("method" => $command, "format" => "php_serial", "api_key" => $this->api_key), $args);
a55d94d4 85
6e1c2bed 86 if (!empty($this->token)) {
87 $args = array_merge($args, array("auth_token" => $this->token));
6e1c2bed 88 }
a55d94d4 89
6e1c2bed 90 ksort($args);
91 $auth_sig = "";
92 foreach ($args as $key => $data) {
a55d94d4 93 if ($key != 'photo') {
94 $auth_sig .= $key . $data;
95 }
6e1c2bed 96 }
a55d94d4 97
6e1c2bed 98 if (!empty($this->secret)) {
99 $api_sig = md5($this->secret . $auth_sig);
100 $args['api_sig'] = $api_sig;
101 }
102
103 //$this->req->addHeader("Connection", "Keep-Alive");
a55d94d4 104 if ($command != 'flickr.upload') {
105 $ret = $this->curl->post($this->REST, $args);
106 } else {
107 $ret = $this->curl->post($this->Upload, $args);
108 print_object($ret);die();
109 }
110
6e1c2bed 111 $this->parsed_response = $this->clean_text_nodes(unserialize($ret));
112 if ($this->parsed_response['stat'] == 'fail') {
113 if ($this->die_on_error) die("The Flickr API returned the following error: #{$this->parsed_response['code']} - {$this->parsed_response['message']}");
114 else {
115 $this->error_code = $this->parsed_response['code'];
116 $this->error_msg = $this->parsed_response['message'];
117 $this->parsed_response = false;
d72ff7a2 118 }
6e1c2bed 119 } else {
120 $this->error_code = false;
121 $this->error_msg = false;
d72ff7a2 122 }
6e1c2bed 123 return $this->response;
124 }
125
126 function clean_text_nodes($arr) {
127 if (!is_array($arr)) {
128 return $arr;
129 } elseif (count($arr) == 0) {
130 return $arr;
131 } elseif (count($arr) == 1 && array_key_exists('_content', $arr)) {
132 return $arr['_content'];
133 } else {
134 foreach ($arr as $key => $element) {
135 $arr[$key] = $this->clean_text_nodes($element);
d72ff7a2 136 }
6e1c2bed 137 return($arr);
138 }
139 }
140
141 function setToken($token)
142 {
143 // Sets an authentication token to use instead of the session variable
144 $this->token = $token;
145 }
146
147 function setProxy($server, $port)
148 {
149 // Sets the proxy for all phpFlickr calls.
150 //$this->req->setProxy($server, $port);
151 }
152
153 function getErrorCode()
154 {
155 // Returns the error code of the last call. If the last call did not
156 // return an error. This will return a false boolean.
157 return $this->error_code;
158 }
159
160 function getErrorMsg()
161 {
162 // Returns the error message of the last call. If the last call did not
163 // return an error. This will return a false boolean.
164 return $this->error_msg;
165 }
166
167 /* These functions are front ends for the flickr calls */
168
169 function buildPhotoURL ($photo, $size = "Medium")
170 {
171 //receives an array (can use the individual photo data returned
172 //from an API call) and returns a URL (doesn't mean that the
173 //file size exists)
174 $sizes = array(
175 "square" => "_s",
176 "thumbnail" => "_t",
177 "small" => "_m",
178 "medium" => "",
179 "large" => "_b",
180 "original" => "_o"
181 );
182
183 $size = strtolower($size);
184 if (!array_key_exists($size, $sizes)) {
185 $size = "medium";
d72ff7a2 186 }
6e1c2bed 187
188 if ($size == "original") {
189 $url = "http://farm" . $photo['farm'] . ".static.flickr.com/" . $photo['server'] . "/" . $photo['id'] . "_" . $photo['originalsecret'] . "_o" . "." . $photo['originalformat'];
190 } else {
191 $url = "http://farm" . $photo['farm'] . ".static.flickr.com/" . $photo['server'] . "/" . $photo['id'] . "_" . $photo['secret'] . $sizes[$size] . ".jpg";
192 }
193 return $url;
194 }
195
196 function getFriendlyGeodata($lat, $lon) {
197 /* I've added this method to get the friendly geodata (i.e. 'in New York, NY') that the
198 * website provides, but isn't available in the API. I'm providing this service as long
199 * as it doesn't flood my server with requests and crash it all the time.
200 */
201 return unserialize(file_get_contents('http://phpflickr.com/geodata/?format=php&lat=' . $lat . '&lon=' . $lon));
202 }
203
204 function auth ($perms = "read", $remember_uri = true)
205 {
6e1c2bed 206 // Redirects to Flickr's authentication piece if there is no valid token.
207 // If remember_uri is set to false, the callback script (included) will
208 // redirect to its default page.
8988c36b 209 if ($remember_uri) {
210 $redirect = $_SERVER['REQUEST_URI'];
6e1c2bed 211 }
8988c36b 212 $api_sig = md5($this->secret . "api_key" . $this->api_key . "perms" . $perms);
213 $url = 'http://www.flickr.com/services/auth/?api_key=' . $this->api_key . "&perms=" . $perms . '&api_sig='. $api_sig;
214 return $url;
6e1c2bed 215 }
216
217 /*******************************
218
219 To use the phpFlickr::call method, pass a string containing the API method you want
220 to use and an associative array of arguments. For example:
221 $result = $f->call("flickr.photos.comments.getList", array("photo_id"=>'34952612'));
222 This method will allow you to make calls to arbitrary methods that haven't been
223 implemented in phpFlickr yet.
224
225 *******************************/
226
227 function call($method, $arguments)
228 {
229 $this->request($method, $arguments);
230 return $this->parsed_response ? $this->parsed_response : false;
aa754fe3 231 }
6e1c2bed 232
aa754fe3 233 /*
6e1c2bed 234 These functions are the direct implementations of flickr calls.
235 For method documentation, including arguments, visit the address
236 included in a comment in the function.
aa754fe3 237 */
aa754fe3 238
6e1c2bed 239 /* Activity methods */
240 function activity_userComments ($per_page = NULL, $page = NULL)
241 {
242 /* http://www.flickr.com/services/api/flickr.activity.userComments.html */
243 $this->request('flickr.activity.userComments', array("per_page" => $per_page, "page" => $page));
244 return $this->parsed_response ? $this->parsed_response['items']['item'] : false;
245 }
246
247 function activity_userPhotos ($timeframe = NULL, $per_page = NULL, $page = NULL)
248 {
249 /* http://www.flickr.com/services/api/flickr.activity.userPhotos.html */
250 $this->request('flickr.activity.userPhotos', array("timeframe" => $timeframe, "per_page" => $per_page, "page" => $page));
251 return $this->parsed_response ? $this->parsed_response['items']['item'] : false;
252 }
253
254 /* Authentication methods */
255 function auth_checkToken ()
256 {
257 /* http://www.flickr.com/services/api/flickr.auth.checkToken.html */
258 $this->request('flickr.auth.checkToken');
259 return $this->parsed_response ? $this->parsed_response['auth'] : false;
260 }
261
262 function auth_getFrob ()
263 {
264 /* http://www.flickr.com/services/api/flickr.auth.getFrob.html */
265 $this->request('flickr.auth.getFrob');
266 return $this->parsed_response ? $this->parsed_response['frob'] : false;
267 }
268
269 function auth_getFullToken ($mini_token)
270 {
271 /* http://www.flickr.com/services/api/flickr.auth.getFullToken.html */
272 $this->request('flickr.auth.getFullToken', array('mini_token'=>$mini_token));
273 return $this->parsed_response ? $this->parsed_response['auth'] : false;
274 }
275
276 function auth_getToken ($frob)
277 {
6e1c2bed 278 /* http://www.flickr.com/services/api/flickr.auth.getToken.html */
279 $this->request('flickr.auth.getToken', array('frob'=>$frob));
8988c36b 280 $this->token = $this->parsed_response['auth']['token'];
6e1c2bed 281 return $this->parsed_response ? $this->parsed_response['auth'] : false;
282 }
aa754fe3 283
6e1c2bed 284 /* Blogs methods */
285 function blogs_getList ()
286 {
287 /* http://www.flickr.com/services/api/flickr.blogs.getList.html */
288 $this->request('flickr.blogs.getList');
289 return $this->parsed_response ? $this->parsed_response['blogs']['blog'] : false;
290 }
291
292 function blogs_postPhoto($blog_id, $photo_id, $title, $description, $blog_password = NULL)
293 {
294 /* http://www.flickr.com/services/api/flickr.blogs.postPhoto.html */
295 $this->request('flickr.blogs.postPhoto', array('blog_id'=>$blog_id, 'photo_id'=>$photo_id, 'title'=>$title, 'description'=>$description, 'blog_password'=>$blog_password), TRUE);
296 return $this->parsed_response ? true : false;
297 }
298
299 /* Contacts Methods */
300 function contacts_getList ($filter = NULL, $page = NULL, $per_page = NULL)
301 {
302 /* http://www.flickr.com/services/api/flickr.contacts.getList.html */
303 $this->request('flickr.contacts.getList', array('filter'=>$filter, 'page'=>$page, 'per_page'=>$per_page));
304 return $this->parsed_response ? $this->parsed_response['contacts'] : false;
305 }
306
307 function contacts_getPublicList($user_id, $page = NULL, $per_page = NULL)
308 {
309 /* http://www.flickr.com/services/api/flickr.contacts.getPublicList.html */
310 $this->request('flickr.contacts.getPublicList', array('user_id'=>$user_id, 'page'=>$page, 'per_page'=>$per_page));
311 return $this->parsed_response ? $this->parsed_response['contacts'] : false;
312 }
313
314 /* Favorites Methods */
315 function favorites_add ($photo_id)
316 {
317 /* http://www.flickr.com/services/api/flickr.favorites.add.html */
318 $this->request('flickr.favorites.add', array('photo_id'=>$photo_id), TRUE);
319 return $this->parsed_response ? true : false;
320 }
321
322 function favorites_getList($user_id = NULL, $extras = NULL, $per_page = NULL, $page = NULL)
323 {
324 /* http://www.flickr.com/services/api/flickr.favorites.getList.html */
325 if (is_array($extras)) { $extras = implode(",", $extras); }
326 $this->request("flickr.favorites.getList", array("user_id"=>$user_id, "extras"=>$extras, "per_page"=>$per_page, "page"=>$page));
327 return $this->parsed_response ? $this->parsed_response['photos'] : false;
328 }
329
330 function favorites_getPublicList($user_id = NULL, $extras = NULL, $per_page = NULL, $page = NULL)
331 {
332 /* http://www.flickr.com/services/api/flickr.favorites.getPublicList.html */
333 if (is_array($extras)) {
334 $extras = implode(",", $extras);
335 }
336 $this->request("flickr.favorites.getPublicList", array("user_id"=>$user_id, "extras"=>$extras, "per_page"=>$per_page, "page"=>$page));
337 return $this->parsed_response ? $this->parsed_response['photos'] : false;
338 }
339
340 function favorites_remove($photo_id)
341 {
342 /* http://www.flickr.com/services/api/flickr.favorites.remove.html */
343 $this->request("flickr.favorites.remove", array("photo_id"=>$photo_id), TRUE);
344 return $this->parsed_response ? true : false;
345 }
346
347 /* Groups Methods */
348 function groups_browse ($cat_id = NULL)
349 {
350 /* http://www.flickr.com/services/api/flickr.groups.browse.html */
351 $this->request("flickr.groups.browse", array("cat_id"=>$cat_id));
352 return $this->parsed_response ? $this->parsed_response['category'] : false;
353 }
354
355 function groups_getInfo ($group_id)
356 {
357 /* http://www.flickr.com/services/api/flickr.groups.getInfo.html */
358 $this->request("flickr.groups.getInfo", array("group_id"=>$group_id));
359 return $this->parsed_response ? $this->parsed_response['group'] : false;
360 }
361
362 function groups_search ($text, $per_page=NULL, $page=NULL)
363 {
364 /* http://www.flickr.com/services/api/flickr.groups.search.html */
365 $this->request("flickr.groups.search", array("text"=>$text,"per_page"=>$per_page,"page"=>$page));
366 return $this->parsed_response ? $this->parsed_response['groups'] : false;
367 }
368
369 /* Groups Pools Methods */
370 function groups_pools_add ($photo_id, $group_id)
371 {
372 /* http://www.flickr.com/services/api/flickr.groups.pools.add.html */
373 $this->request("flickr.groups.pools.add", array("photo_id"=>$photo_id, "group_id"=>$group_id), TRUE);
374 return $this->parsed_response ? true : false;
375 }
376
377 function groups_pools_getContext ($photo_id, $group_id)
378 {
379 /* http://www.flickr.com/services/api/flickr.groups.pools.getContext.html */
380 $this->request("flickr.groups.pools.getContext", array("photo_id"=>$photo_id, "group_id"=>$group_id));
381 return $this->parsed_response ? $this->parsed_response : false;
382 }
383
384 function groups_pools_getGroups ($page = NULL, $per_page = NULL)
385 {
386 /* http://www.flickr.com/services/api/flickr.groups.pools.getGroups.html */
387 $this->request("flickr.groups.pools.getGroups", array('page'=>$page, 'per_page'=>$per_page));
388 return $this->parsed_response ? $this->parsed_response['groups'] : false;
389 }
390
391 function groups_pools_getPhotos ($group_id, $tags = NULL, $user_id = NULL, $extras = NULL, $per_page = NULL, $page = NULL)
392 {
393 /* http://www.flickr.com/services/api/flickr.groups.pools.getPhotos.html */
394 if (is_array($extras)) {
395 $extras = implode(",", $extras);
396 }
397 $this->request("flickr.groups.pools.getPhotos", array("group_id"=>$group_id, "tags"=>$tags, "user_id"=>$user_id, "extras"=>$extras, "per_page"=>$per_page, "page"=>$page));
398 return $this->parsed_response ? $this->parsed_response['photos'] : false;
399 }
400
401 function groups_pools_remove ($photo_id, $group_id)
402 {
403 /* http://www.flickr.com/services/api/flickr.groups.pools.remove.html */
404 $this->request("flickr.groups.pools.remove", array("photo_id"=>$photo_id, "group_id"=>$group_id), TRUE);
405 return $this->parsed_response ? true : false;
406 }
407
408 /* Interestingness methods */
409 function interestingness_getList($date = NULL, $extras = NULL, $per_page = NULL, $page = NULL)
410 {
411 /* http://www.flickr.com/services/api/flickr.interestingness.getList.html */
412 if (is_array($extras)) {
413 $extras = implode(",", $extras);
414 }
415
416 $this->request("flickr.interestingness.getList", array("date"=>$date, "extras"=>$extras, "per_page"=>$per_page, "page"=>$page));
417 return $this->parsed_response ? $this->parsed_response['photos'] : false;
418 }
419
420 /* People methods */
421 function people_findByEmail ($find_email)
422 {
423 /* http://www.flickr.com/services/api/flickr.people.findByEmail.html */
424 $this->request("flickr.people.findByEmail", array("find_email"=>$find_email));
425 return $this->parsed_response ? $this->parsed_response['user'] : false;
426 }
427
428 function people_findByUsername ($username)
429 {
430 /* http://www.flickr.com/services/api/flickr.people.findByUsername.html */
431 $this->request("flickr.people.findByUsername", array("username"=>$username));
432 return $this->parsed_response ? $this->parsed_response['user'] : false;
433 }
434
435 function people_getInfo($user_id)
436 {
437 /* http://www.flickr.com/services/api/flickr.people.getInfo.html */
438 $this->request("flickr.people.getInfo", array("user_id"=>$user_id));
439 return $this->parsed_response ? $this->parsed_response['person'] : false;
440 }
441
442 function people_getPublicGroups($user_id)
443 {
444 /* http://www.flickr.com/services/api/flickr.people.getPublicGroups.html */
445 $this->request("flickr.people.getPublicGroups", array("user_id"=>$user_id));
446 return $this->parsed_response ? $this->parsed_response['groups']['group'] : false;
447 }
448
449 function people_getPublicPhotos($user_id, $extras = NULL, $per_page = NULL, $page = NULL) {
450 /* http://www.flickr.com/services/api/flickr.people.getPublicPhotos.html */
451 if (is_array($extras)) {
452 $extras = implode(",", $extras);
453 }
454
455 $this->request("flickr.people.getPublicPhotos", array("user_id"=>$user_id, "extras"=>$extras, "per_page"=>$per_page, "page"=>$page));
456 return $this->parsed_response ? $this->parsed_response['photos'] : false;
457 }
458
459 function people_getUploadStatus()
460 {
461 /* http://www.flickr.com/services/api/flickr.people.getUploadStatus.html */
462 /* Requires Authentication */
463 $this->request("flickr.people.getUploadStatus");
464 return $this->parsed_response ? $this->parsed_response['user'] : false;
465 }
466
467
468 /* Photos Methods */
469 function photos_addTags ($photo_id, $tags)
470 {
471 /* http://www.flickr.com/services/api/flickr.photos.addTags.html */
472 $this->request("flickr.photos.addTags", array("photo_id"=>$photo_id, "tags"=>$tags), TRUE);
473 return $this->parsed_response ? true : false;
474 }
475
476 function photos_delete($photo_id)
477 {
478 /* http://www.flickr.com/services/api/flickr.photos.delete.html */
479 $this->request("flickr.photos.delete", array("photo_id"=>$photo_id), TRUE);
480 return $this->parsed_response ? true : false;
481 }
482
483 function photos_getAllContexts ($photo_id)
484 {
485 /* http://www.flickr.com/services/api/flickr.photos.getAllContexts.html */
486 $this->request("flickr.photos.getAllContexts", array("photo_id"=>$photo_id));
487 return $this->parsed_response ? $this->parsed_response : false;
488 }
489
490 function photos_getContactsPhotos ($count = NULL, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL)
491 {
492 /* http://www.flickr.com/services/api/flickr.photos.getContactsPhotos.html */
493 $this->request("flickr.photos.getContactsPhotos", array("count"=>$count, "just_friends"=>$just_friends, "single_photo"=>$single_photo, "include_self"=>$include_self, "extras"=>$extras));
494 return $this->parsed_response ? $this->parsed_response['photos']['photo'] : false;
495 }
496
497 function photos_getContactsPublicPhotos ($user_id, $count = NULL, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL)
498 {
499 /* http://www.flickr.com/services/api/flickr.photos.getContactsPublicPhotos.html */
500 $this->request("flickr.photos.getContactsPublicPhotos", array("user_id"=>$user_id, "count"=>$count, "just_friends"=>$just_friends, "single_photo"=>$single_photo, "include_self"=>$include_self, "extras"=>$extras));
501 return $this->parsed_response ? $this->parsed_response['photos']['photo'] : false;
502 }
503
504 function photos_getContext ($photo_id)
505 {
506 /* http://www.flickr.com/services/api/flickr.photos.getContext.html */
507 $this->request("flickr.photos.getContext", array("photo_id"=>$photo_id));
508 return $this->parsed_response ? $this->parsed_response : false;
509 }
510
511 function photos_getCounts ($dates = NULL, $taken_dates = NULL)
512 {
513 /* http://www.flickr.com/services/api/flickr.photos.getCounts.html */
514 $this->request("flickr.photos.getCounts", array("dates"=>$dates, "taken_dates"=>$taken_dates));
515 return $this->parsed_response ? $this->parsed_response['photocounts']['photocount'] : false;
516 }
517
518 function photos_getExif ($photo_id, $secret = NULL)
519 {
520 /* http://www.flickr.com/services/api/flickr.photos.getExif.html */
521 $this->request("flickr.photos.getExif", array("photo_id"=>$photo_id, "secret"=>$secret));
522 return $this->parsed_response ? $this->parsed_response['photo'] : false;
523 }
524
525 function photos_getFavorites($photo_id, $page = NULL, $per_page = NULL)
526 {
527 /* http://www.flickr.com/services/api/flickr.photos.getFavorites.html */
528 $this->request("flickr.photos.getFavorites", array("photo_id"=>$photo_id, "page"=>$page, "per_page"=>$per_page));
529 return $this->parsed_response ? $this->parsed_response['photo'] : false;
530 }
531
532 function photos_getInfo($photo_id, $secret = NULL)
533 {
534 /* http://www.flickr.com/services/api/flickr.photos.getInfo.html */
535 $this->request("flickr.photos.getInfo", array("photo_id"=>$photo_id, "secret"=>$secret));
536 return $this->parsed_response ? $this->parsed_response['photo'] : false;
537 }
538
539 function photos_getNotInSet($min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = NULL, $extras = NULL, $per_page = NULL, $page = NULL)
540 {
541 /* http://www.flickr.com/services/api/flickr.photos.getNotInSet.html */
542 if (is_array($extras)) {
543 $extras = implode(",", $extras);
544 }
545 $this->request("flickr.photos.getNotInSet", array("min_upload_date"=>$min_upload_date, "max_upload_date"=>$max_upload_date, "min_taken_date"=>$min_taken_date, "max_taken_date"=>$max_taken_date, "privacy_filter"=>$privacy_filter, "extras"=>$extras, "per_page"=>$per_page, "page"=>$page));
546 return $this->parsed_response ? $this->parsed_response['photos'] : false;
547 }
548
549 function photos_getPerms($photo_id)
550 {
551 /* http://www.flickr.com/services/api/flickr.photos.getPerms.html */
552 $this->request("flickr.photos.getPerms", array("photo_id"=>$photo_id));
553 return $this->parsed_response ? $this->parsed_response['perms'] : false;
554 }
36ea9a6c 555
6e1c2bed 556 function photos_getRecent($extras = NULL, $per_page = NULL, $page = NULL)
557 {
558 /* http://www.flickr.com/services/api/flickr.photos.getRecent.html */
36ea9a6c 559
6e1c2bed 560 if (is_array($extras)) {
561 $extras = implode(",", $extras);
562 }
563 $this->request("flickr.photos.getRecent", array("extras"=>$extras, "per_page"=>$per_page, "page"=>$page));
564 return $this->parsed_response ? $this->parsed_response['photos'] : false;
565 }
566
567 function photos_getSizes($photo_id)
568 {
569 /* http://www.flickr.com/services/api/flickr.photos.getSizes.html */
570 $this->request("flickr.photos.getSizes", array("photo_id"=>$photo_id));
571 return $this->parsed_response ? $this->parsed_response['sizes']['size'] : false;
572 }
573
574 function photos_getUntagged($min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = NULL, $extras = NULL, $per_page = NULL, $page = NULL)
575 {
576 /* http://www.flickr.com/services/api/flickr.photos.getUntagged.html */
577 if (is_array($extras)) {
578 $extras = implode(",", $extras);
579 }
580 $this->request("flickr.photos.getUntagged", array("min_upload_date"=>$min_upload_date, "max_upload_date"=>$max_upload_date, "min_taken_date"=>$min_taken_date, "max_taken_date"=>$max_taken_date, "privacy_filter"=>$privacy_filter, "extras"=>$extras, "per_page"=>$per_page, "page"=>$page));
581 return $this->parsed_response ? $this->parsed_response['photos'] : false;
582 }
583
584 function photos_getWithGeoData($args = NULL) {
585 /* See the documentation included with the photos_search() function.
586 * I'm using the same style of arguments for this function. The only
587 * difference here is that this doesn't require any arguments. The
588 * flickr.photos.search method requires at least one search parameter.
589 */
590 /* http://www.flickr.com/services/api/flickr.photos.getWithGeoData.html */
591 if (is_null($args)) {
592 $args = array();
593 }
594 $this->request("flickr.photos.getWithGeoData", $args);
595 return $this->parsed_response ? $this->parsed_response['photos'] : false;
596 }
597
598 function photos_getWithoutGeoData($args = NULL) {
599 /* See the documentation included with the photos_search() function.
600 * I'm using the same style of arguments for this function. The only
601 * difference here is that this doesn't require any arguments. The
602 * flickr.photos.search method requires at least one search parameter.
603 */
604 /* http://www.flickr.com/services/api/flickr.photos.getWithoutGeoData.html */
605 if (is_null($args)) {
606 $args = array();
607 }
608 $this->request("flickr.photos.getWithoutGeoData", $args);
609 return $this->parsed_response ? $this->parsed_response['photos'] : false;
610 }
611
612 function photos_recentlyUpdated($min_date = NULL, $extras = NULL, $per_page = NULL, $page = NULL)
613 {
614 /* http://www.flickr.com/services/api/flickr.photos.getUntagged.html */
615 if (is_array($extras)) {
616 $extras = implode(",", $extras);
617 }
618 $this->request("flickr.photos.recentlyUpdated", array("min_date"=>$min_date, "extras"=>$extras, "per_page"=>$per_page, "page"=>$page));
619 return $this->parsed_response ? $this->parsed_response['photos'] : false;
620 }
621
622 function photos_removeTag($tag_id)
623 {
624 /* http://www.flickr.com/services/api/flickr.photos.removeTag.html */
625 $this->request("flickr.photos.removeTag", array("tag_id"=>$tag_id), TRUE);
626 return $this->parsed_response ? true : false;
627 }
628
629 function photos_search($args)
630 {
631 /* This function strays from the method of arguments that I've
632 * used in the other functions for the fact that there are just
633 * so many arguments to this API method. What you'll need to do
634 * is pass an associative array to the function containing the
635 * arguments you want to pass to the API. For example:
636 * $photos = $f->photos_search(array("tags"=>"brown,cow", "tag_mode"=>"any"));
637 * This will return photos tagged with either "brown" or "cow"
638 * or both. See the API documentation (link below) for a full
639 * list of arguments.
640 */
641
642 /* http://www.flickr.com/services/api/flickr.photos.search.html */
643 $this->request("flickr.photos.search", $args);
644 return $this->parsed_response ? $this->parsed_response['photos'] : false;
645 }
646
647 function photos_setContentType ($photo_id, $content_type) {
648 /* http://www.flickr.com/services/api/flickr.photos.setContentType.html */
649 return $this->call('flickr.photos.setContentType', array('photo_id' => $photo_id, 'content_type' => $content_type));
650 }
651
652 function photos_setDates($photo_id, $date_posted = NULL, $date_taken = NULL, $date_taken_granularity = NULL)
653 {
654 /* http://www.flickr.com/services/api/flickr.photos.setDates.html */
655 $this->request("flickr.photos.setDates", array("photo_id"=>$photo_id, "date_posted"=>$date_posted, "date_taken"=>$date_taken, "date_taken_granularity"=>$date_taken_granularity), TRUE);
656 return $this->parsed_response ? true : false;
657 }
658
659 function photos_setMeta($photo_id, $title, $description)
660 {
661 /* http://www.flickr.com/services/api/flickr.photos.setMeta.html */
662 $this->request("flickr.photos.setMeta", array("photo_id"=>$photo_id, "title"=>$title, "description"=>$description), TRUE);
663 return $this->parsed_response ? true : false;
664 }
665
666 function photos_setPerms($photo_id, $is_public, $is_friend, $is_family, $perm_comment, $perm_addmeta)
667 {
668 /* http://www.flickr.com/services/api/flickr.photos.setPerms.html */
669 $this->request("flickr.photos.setPerms", array("photo_id"=>$photo_id, "is_public"=>$is_public, "is_friend"=>$is_friend, "is_family"=>$is_family, "perm_comment"=>$perm_comment, "perm_addmeta"=>$perm_addmeta), TRUE);
670 return $this->parsed_response ? true : false;
671 }
672
673 function photos_setSafetyLevel ($photo_id, $safety_level, $hidden = null) {
674 /* http://www.flickr.com/services/api/flickr.photos.setSafetyLevel.html */
675 return $this->call('flickr.photos.setSafetyLevel', array('photo_id' => $photo_id, 'safety_level' => $safety_level, 'hidden' => $hidden));
676 }
677
678
679 function photos_setTags($photo_id, $tags)
680 {
681 /* http://www.flickr.com/services/api/flickr.photos.setTags.html */
682 $this->request("flickr.photos.setTags", array("photo_id"=>$photo_id, "tags"=>$tags), TRUE);
683 return $this->parsed_response ? true : false;
684 }
685
686 /* Photos - Comments Methods */
687 function photos_comments_addComment($photo_id, $comment_text) {
688 /* http://www.flickr.com/services/api/flickr.photos.comments.addComment.html */
689 $this->request("flickr.photos.comments.addComment", array("photo_id" => $photo_id, "comment_text"=>$comment_text), TRUE);
690 return $this->parsed_response ? $this->parsed_response['comment'] : false;
691 }
692
693 function photos_comments_deleteComment($comment_id) {
694 /* http://www.flickr.com/services/api/flickr.photos.comments.deleteComment.html */
695 $this->request("flickr.photos.comments.deleteComment", array("comment_id" => $comment_id), TRUE);
696 return $this->parsed_response ? true : false;
697 }
698
699 function photos_comments_editComment($comment_id, $comment_text) {
700 /* http://www.flickr.com/services/api/flickr.photos.comments.editComment.html */
701 $this->request("flickr.photos.comments.editComment", array("comment_id" => $comment_id, "comment_text"=>$comment_text), TRUE);
702 return $this->parsed_response ? true : false;
703 }
704
705 function photos_comments_getList($photo_id)
706 {
707 /* http://www.flickr.com/services/api/flickr.photos.comments.getList.html */
708 $this->request("flickr.photos.comments.getList", array("photo_id"=>$photo_id));
709 return $this->parsed_response ? $this->parsed_response['comments'] : false;
710 }
711
712 /* Photos - Geo Methods */
713 function photos_geo_getLocation($photo_id)
714 {
715 /* http://www.flickr.com/services/api/flickr.photos.geo.getLocation.html */
716 $this->request("flickr.photos.geo.getLocation", array("photo_id"=>$photo_id));
717 return $this->parsed_response ? $this->parsed_response['photo'] : false;
718 }
719
720 function photos_geo_getPerms($photo_id)
721 {
722 /* http://www.flickr.com/services/api/flickr.photos.geo.getPerms.html */
723 $this->request("flickr.photos.geo.getPerms", array("photo_id"=>$photo_id));
724 return $this->parsed_response ? $this->parsed_response['perms'] : false;
725 }
726
727 function photos_geo_removeLocation($photo_id)
728 {
729 /* http://www.flickr.com/services/api/flickr.photos.geo.removeLocation.html */
730 $this->request("flickr.photos.geo.removeLocation", array("photo_id"=>$photo_id), TRUE);
731 return $this->parsed_response ? true : false;
732 }
733
734 function photos_geo_setLocation($photo_id, $lat, $lon, $accuracy = NULL)
735 {
736 /* http://www.flickr.com/services/api/flickr.photos.geo.setLocation.html */
737 $this->request("flickr.photos.geo.setLocation", array("photo_id"=>$photo_id, "lat"=>$lat, "lon"=>$lon, "accuracy"=>$accuracy), TRUE);
738 return $this->parsed_response ? true : false;
739 }
740
741 function photos_geo_setPerms($photo_id, $is_public, $is_contact, $is_friend, $is_family)
742 {
743 /* http://www.flickr.com/services/api/flickr.photos.geo.setPerms.html */
744 $this->request("flickr.photos.geo.setPerms", array("photo_id"=>$photo_id, "is_public"=>$is_public, "is_contact"=>$is_contact, "is_friend"=>$is_friend, "is_family"=>$is_family), TRUE);
745 return $this->parsed_response ? true : false;
746 }
747
748 /* Photos - Licenses Methods */
749 function photos_licenses_getInfo()
750 {
751 /* http://www.flickr.com/services/api/flickr.photos.licenses.getInfo.html */
752 $this->request("flickr.photos.licenses.getInfo");
753 return $this->parsed_response ? $this->parsed_response['licenses']['license'] : false;
754 }
755
756 function photos_licenses_setLicense($photo_id, $license_id)
757 {
758 /* http://www.flickr.com/services/api/flickr.photos.licenses.setLicense.html */
759 /* Requires Authentication */
760 $this->request("flickr.photos.licenses.setLicense", array("photo_id"=>$photo_id, "license_id"=>$license_id), TRUE);
761 return $this->parsed_response ? true : false;
762 }
763
764 /* Photos - Notes Methods */
765 function photos_notes_add($photo_id, $note_x, $note_y, $note_w, $note_h, $note_text)
766 {
767 /* http://www.flickr.com/services/api/flickr.photos.notes.add.html */
768 $this->request("flickr.photos.notes.add", array("photo_id" => $photo_id, "note_x" => $note_x, "note_y" => $note_y, "note_w" => $note_w, "note_h" => $note_h, "note_text" => $note_text), TRUE);
769 return $this->parsed_response ? $this->parsed_response['note'] : false;
770 }
771
772 function photos_notes_delete($note_id)
773 {
774 /* http://www.flickr.com/services/api/flickr.photos.notes.delete.html */
775 $this->request("flickr.photos.notes.delete", array("note_id" => $note_id), TRUE);
776 return $this->parsed_response ? true : false;
777 }
778
779 function photos_notes_edit($note_id, $note_x, $note_y, $note_w, $note_h, $note_text)
780 {
781 /* http://www.flickr.com/services/api/flickr.photos.notes.edit.html */
782 $this->request("flickr.photos.notes.edit", array("note_id" => $note_id, "note_x" => $note_x, "note_y" => $note_y, "note_w" => $note_w, "note_h" => $note_h, "note_text" => $note_text), TRUE);
783 return $this->parsed_response ? true : false;
784 }
785
786 /* Photos - Transform Methods */
787 function photos_transform_rotate($photo_id, $degrees)
788 {
789 /* http://www.flickr.com/services/api/flickr.photos.transform.rotate.html */
790 $this->request("flickr.photos.transform.rotate", array("photo_id" => $photo_id, "degrees" => $degrees), TRUE);
791 return $this->parsed_response ? true : false;
792 }
793
794 /* Photos - Upload Methods */
795 function photos_upload_checkTickets($tickets)
796 {
797 /* http://www.flickr.com/services/api/flickr.photos.upload.checkTickets.html */
798 if (is_array($tickets)) {
799 $tickets = implode(",", $tickets);
800 }
801 $this->request("flickr.photos.upload.checkTickets", array("tickets" => $tickets), TRUE);
802 return $this->parsed_response ? $this->parsed_response['uploader']['ticket'] : false;
803 }
804
805 /* Photosets Methods */
806 function photosets_addPhoto($photoset_id, $photo_id)
807 {
808 /* http://www.flickr.com/services/api/flickr.photosets.addPhoto.html */
809 $this->request("flickr.photosets.addPhoto", array("photoset_id" => $photoset_id, "photo_id" => $photo_id), TRUE);
810 return $this->parsed_response ? true : false;
811 }
812
813 function photosets_create($title, $description, $primary_photo_id)
814 {
815 /* http://www.flickr.com/services/api/flickr.photosets.create.html */
816 $this->request("flickr.photosets.create", array("title" => $title, "primary_photo_id" => $primary_photo_id, "description" => $description), TRUE);
817 return $this->parsed_response ? $this->parsed_response['photoset'] : false;
818 }
819
820 function photosets_delete($photoset_id)
821 {
822 /* http://www.flickr.com/services/api/flickr.photosets.delete.html */
823 $this->request("flickr.photosets.delete", array("photoset_id" => $photoset_id), TRUE);
824 return $this->parsed_response ? true : false;
825 }
826
827 function photosets_editMeta($photoset_id, $title, $description = NULL)
828 {
829 /* http://www.flickr.com/services/api/flickr.photosets.editMeta.html */
830 $this->request("flickr.photosets.editMeta", array("photoset_id" => $photoset_id, "title" => $title, "description" => $description), TRUE);
831 return $this->parsed_response ? true : false;
832 }
833
834 function photosets_editPhotos($photoset_id, $primary_photo_id, $photo_ids)
835 {
836 /* http://www.flickr.com/services/api/flickr.photosets.editPhotos.html */
837 $this->request("flickr.photosets.editPhotos", array("photoset_id" => $photoset_id, "primary_photo_id" => $primary_photo_id, "photo_ids" => $photo_ids), TRUE);
838 return $this->parsed_response ? true : false;
839 }
840
841 function photosets_getContext($photo_id, $photoset_id)
842 {
843 /* http://www.flickr.com/services/api/flickr.photosets.getContext.html */
844 $this->request("flickr.photosets.getContext", array("photo_id" => $photo_id, "photoset_id" => $photoset_id));
845 return $this->parsed_response ? $this->parsed_response : false;
846 }
847
848 function photosets_getInfo($photoset_id)
849 {
850 /* http://www.flickr.com/services/api/flickr.photosets.getInfo.html */
851 $this->request("flickr.photosets.getInfo", array("photoset_id" => $photoset_id));
852 return $this->parsed_response ? $this->parsed_response['photoset'] : false;
853 }
854
855 function photosets_getList($user_id = NULL)
856 {
857 /* http://www.flickr.com/services/api/flickr.photosets.getList.html */
858 $this->request("flickr.photosets.getList", array("user_id" => $user_id));
859 return $this->parsed_response ? $this->parsed_response['photosets'] : false;
860 }
861
862 function photosets_getPhotos($photoset_id, $extras = NULL, $privacy_filter = NULL, $per_page = NULL, $page = NULL)
863 {
864 /* http://www.flickr.com/services/api/flickr.photosets.getPhotos.html */
865 $this->request("flickr.photosets.getPhotos", array("photoset_id" => $photoset_id, "extras" => $extras, "privacy_filter" => $privacy_filter, "per_page" => $per_page, "page" => $page));
866 return $this->parsed_response ? $this->parsed_response['photoset'] : false;
867 }
868
869 function photosets_orderSets($photoset_ids)
870 {
871 /* http://www.flickr.com/services/api/flickr.photosets.orderSets.html */
872 if (is_array($photoset_ids)) {
873 $photoset_ids = implode(",", $photoset_ids);
874 }
875 $this->request("flickr.photosets.orderSets", array("photoset_ids" => $photoset_ids), TRUE);
876 return $this->parsed_response ? true : false;
877 }
878
879 function photosets_removePhoto($photoset_id, $photo_id)
880 {
881 /* http://www.flickr.com/services/api/flickr.photosets.removePhoto.html */
882 $this->request("flickr.photosets.removePhoto", array("photoset_id" => $photoset_id, "photo_id" => $photo_id), TRUE);
883 return $this->parsed_response ? true : false;
884 }
885
886 /* Photosets Comments Methods */
887 function photosets_comments_addComment($photoset_id, $comment_text) {
888 /* http://www.flickr.com/services/api/flickr.photosets.comments.addComment.html */
889 $this->request("flickr.photosets.comments.addComment", array("photoset_id" => $photoset_id, "comment_text"=>$comment_text), TRUE);
890 return $this->parsed_response ? $this->parsed_response['comment'] : false;
891 }
892
893 function photosets_comments_deleteComment($comment_id) {
894 /* http://www.flickr.com/services/api/flickr.photosets.comments.deleteComment.html */
895 $this->request("flickr.photosets.comments.deleteComment", array("comment_id" => $comment_id), TRUE);
896 return $this->parsed_response ? true : false;
897 }
898
899 function photosets_comments_editComment($comment_id, $comment_text) {
900 /* http://www.flickr.com/services/api/flickr.photosets.comments.editComment.html */
901 $this->request("flickr.photosets.comments.editComment", array("comment_id" => $comment_id, "comment_text"=>$comment_text), TRUE);
902 return $this->parsed_response ? true : false;
903 }
904
905 function photosets_comments_getList($photoset_id)
906 {
907 /* http://www.flickr.com/services/api/flickr.photosets.comments.getList.html */
908 $this->request("flickr.photosets.comments.getList", array("photoset_id"=>$photoset_id));
909 return $this->parsed_response ? $this->parsed_response['comments'] : false;
910 }
911
912 /* Places Methods */
913 function places_resolvePlaceId ($place_id) {
914 /* http://www.flickr.com/services/api/flickr.places.resolvePlaceId.html */
915 $rsp = $this->call('flickr.places.resolvePlaceId', array('place_id' => $place_id));
916 return $rsp ? $rsp['location'] : $rsp;
917 }
918
919 function places_resolvePlaceURL ($url) {
920 /* http://www.flickr.com/services/api/flickr.places.resolvePlaceURL.html */
921 $rsp = $this->call('flickr.places.resolvePlaceURL', array('url' => $url));
922 return $rsp ? $rsp['location'] : $rsp;
923 }
924
925 /* Prefs Methods */
926 function prefs_getContentType () {
927 /* http://www.flickr.com/services/api/flickr.prefs.getContentType.html */
928 $rsp = $this->call('flickr.prefs.getContentType', array());
929 return $rsp ? $rsp['person'] : $rsp;
930 }
931
932 function prefs_getHidden () {
933 /* http://www.flickr.com/services/api/flickr.prefs.getHidden.html */
934 $rsp = $this->call('flickr.prefs.getHidden', array());
935 return $rsp ? $rsp['person'] : $rsp;
936 }
937
938 function prefs_getPrivacy () {
939 /* http://www.flickr.com/services/api/flickr.prefs.getPrivacy.html */
940 $rsp = $this->call('flickr.prefs.getPrivacy', array());
941 return $rsp ? $rsp['person'] : $rsp;
942 }
943
944 function prefs_getSafetyLevel () {
945 /* http://www.flickr.com/services/api/flickr.prefs.getSafetyLevel.html */
946 $rsp = $this->call('flickr.prefs.getSafetyLevel', array());
947 return $rsp ? $rsp['person'] : $rsp;
948 }
949
950 /* Reflection Methods */
951 function reflection_getMethodInfo($method_name)
952 {
953 /* http://www.flickr.com/services/api/flickr.reflection.getMethodInfo.html */
954 $this->request("flickr.reflection.getMethodInfo", array("method_name" => $method_name));
955 return $this->parsed_response ? $this->parsed_response : false;
956 }
957
958 function reflection_getMethods()
959 {
960 /* http://www.flickr.com/services/api/flickr.reflection.getMethods.html */
961 $this->request("flickr.reflection.getMethods");
962 return $this->parsed_response ? $this->parsed_response['methods']['method'] : false;
963 }
964
965 /* Tags Methods */
966 function tags_getHotList($period = NULL, $count = NULL)
967 {
968 /* http://www.flickr.com/services/api/flickr.tags.getHotList.html */
969 $this->request("flickr.tags.getHotList", array("period" => $period, "count" => $count));
970 return $this->parsed_response ? $this->parsed_response['hottags'] : false;
971 }
972
973 function tags_getListPhoto($photo_id)
974 {
975 /* http://www.flickr.com/services/api/flickr.tags.getListPhoto.html */
976 $this->request("flickr.tags.getListPhoto", array("photo_id" => $photo_id));
977 return $this->parsed_response ? $this->parsed_response['photo']['tags']['tag'] : false;
978 }
979
980 function tags_getListUser($user_id = NULL)
981 {
982 /* http://www.flickr.com/services/api/flickr.tags.getListUser.html */
983 $this->request("flickr.tags.getListUser", array("user_id" => $user_id));
984 return $this->parsed_response ? $this->parsed_response['who']['tags']['tag'] : false;
985 }
986
987 function tags_getListUserPopular($user_id = NULL, $count = NULL)
988 {
989 /* http://www.flickr.com/services/api/flickr.tags.getListUserPopular.html */
990 $this->request("flickr.tags.getListUserPopular", array("user_id" => $user_id, "count" => $count));
991 return $this->parsed_response ? $this->parsed_response['who']['tags']['tag'] : false;
992 }
993
994 function tags_getListUserRaw($tag)
995 {
996 /* http://www.flickr.com/services/api/flickr.tags.getListUserRaw.html */
997 $this->request("flickr.tags.getListUserRaw", array("tag" => $tag));
998 return $this->parsed_response ? $this->parsed_response['who']['tags']['tag'][0]['raw'] : false;
999 }
1000
1001 function tags_getRelated($tag)
1002 {
1003 /* http://www.flickr.com/services/api/flickr.tags.getRelated.html */
1004 $this->request("flickr.tags.getRelated", array("tag" => $tag));
1005 return $this->parsed_response ? $this->parsed_response['tags'] : false;
1006 }
1007
1008 function test_echo($args = array())
1009 {
1010 /* http://www.flickr.com/services/api/flickr.test.echo.html */
1011 $this->request("flickr.test.echo", $args);
1012 return $this->parsed_response ? $this->parsed_response : false;
1013 }
1014
1015 function test_login()
1016 {
1017 /* http://www.flickr.com/services/api/flickr.test.login.html */
1018 $this->request("flickr.test.login");
1019 return $this->parsed_response ? $this->parsed_response['user'] : false;
1020 }
1021
1022 function urls_getGroup($group_id)
1023 {
1024 /* http://www.flickr.com/services/api/flickr.urls.getGroup.html */
1025 $this->request("flickr.urls.getGroup", array("group_id"=>$group_id));
1026 return $this->parsed_response ? $this->parsed_response['group']['url'] : false;
1027 }
1028
1029 function urls_getUserPhotos($user_id = NULL)
1030 {
1031 /* http://www.flickr.com/services/api/flickr.urls.getUserPhotos.html */
1032 $this->request("flickr.urls.getUserPhotos", array("user_id"=>$user_id));
1033 return $this->parsed_response ? $this->parsed_response['user']['url'] : false;
1034 }
1035
1036 function urls_getUserProfile($user_id = NULL)
1037 {
1038 /* http://www.flickr.com/services/api/flickr.urls.getUserProfile.html */
1039 $this->request("flickr.urls.getUserProfile", array("user_id"=>$user_id));
1040 return $this->parsed_response ? $this->parsed_response['user']['url'] : false;
1041 }
1042
1043 function urls_lookupGroup($url)
1044 {
1045 /* http://www.flickr.com/services/api/flickr.urls.lookupGroup.html */
1046 $this->request("flickr.urls.lookupGroup", array("url"=>$url));
1047 return $this->parsed_response ? $this->parsed_response['group'] : false;
1048 }
1049
1050 function urls_lookupUser($url)
1051 {
1052 /* http://www.flickr.com/services/api/flickr.photos.notes.edit.html */
1053 $this->request("flickr.urls.lookupUser", array("url"=>$url));
1054 return $this->parsed_response ? $this->parsed_response['user'] : false;
1055 }
1056}
36ea9a6c 1057?>