-
Notifications
You must be signed in to change notification settings - Fork 2
Apache module for flickr access.
vshankar/mod_flickr
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
mod_flickr is a apache module (for apache 2.0 and above) that makes call to flickr via flickr API's to get a users (configured in httpd.conf) public photo sets, photos in sets and recent photos uploaded in flickr etc... Currently only 4 api calls have been implmeneted (all are GET calls). These API's return data in XML format. The XML can then be parsed by the calling code (e.g. front end Javascript/php) to display thumbnails of the images say in a scrollbar. (Code for front end is not distributed as yet) This module can be used by web developers who want to show their photos/albums uploaded in flickr on their website and/or access to metadata of their photos for their own needs/purposes. WWW: http://www.vshank.com/code/mod_flickr 0. INSTALLATION --------------- mod_flickr needs libcurl and any *nix/*BSD system. You may need to edit the paths in the 'Makefile' (INCLDIR/LIBDIR) to specify the include and the library paths for libcurl includes and shared library. (need to provide `configure' script for this, later) % make # make sure `apxs' is in $PATH else edit the Makefile giving the full path for `apxs' Apache configuration (httpd.conf) -------------------------------- 1. Make sure you have the following line in the Apache configuration file (noramlly httpd.conf) LoadModule mod_flickr libexec/apache22/mod_flickr.so # see apache manuals on how to load DSO's. 2. Also to activate mod_flickr and to configure the user the following lines need to be added in apache conf. file. 2.a Activate the flickr module FlickrMod On 2.b Provide the reuired key, secret and auth-token as follows. <user> is the name of the user that will be called as a part of the URI (see below, step 4). Enter the key, secret and auth-token in place of 'xxxx' in repective directives (Keys can be obtained from: http://www.flickr.com/services/api/ Auth Mode: Mobile) FlickrUser <user> FlickrKey <user> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx FlickrSecret <user> xxxxxxxxxxxxxxx FlickrAuth <user> xxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxx 3. Enter the following so that the request reached mod_flickr handler. <Location /flickr> SetHandler flickr-handler </Location> 4. URL formats: If you have configured apache as per Step 3, then the format to call flickr module would be: http://whatsoever.com/flickr/<user>/<api>/<arguments/to/the/api> e.g. http://whatsoever.com/flickr/vshankar/getMyPhotos/1/10 This would fetch the public photos for user 'vshankar' (actually whatever 'vshankar' maps to the keys). NOTE: As of now mod_flickr supports four api calls. (see below) API Calls (NOTE: Any extra parameters are ignored by the API) ------------------------------------------------------------- ------------------------------------------------------------- a. getMyPhotos - get public photos of the user (takes 2 param: page number, number of photos) ---------------------------------------------------- http://www.whatsoever.com/flickr/vshankar/getMyPhotos/1/10 # get 10 photos in 1st page http://www.whatsoever.com/flickr/vshankar/getMyPhotos/2/10 # get 10 photos in 2nd page http://www.whatsoever.com/flickr/vshankar/getMyPhotos/1/30 # get 30 photos in 1nd page b. getMySets - get sets of the user (takes no param) ---------------------------------------------------- http://www.whatsoever.com/flickr/vshankar/getMySets/ # get sets (no parameters) c. getPhotosInSet - get public photos in set (takes 3 params: set id, page number, number of photos) ---------------------------------------------------- http://www.whatsoever.com/flickr/vshankar/getPhotosInSet/123456/1/20 http://www.whatsoever.com/flickr/vshankar/getPhotosInSet/123456/2/20 d. getRecentPhotos - get recent public photos in flickr (take 2 param: page number, number of photos) ---------------------------------------------------- http://www.whatsoever.com/flickr/vshankar/getRecentPhotos/1/50 # get 50 photos in 1st page http://www.whatsoever.com/flickr/vshankar/getRecentPhotos/1/100 # get 100 photos in 1st page TODO: ---- ---- > Add more API's. > Make privacy level as a config. parameter (in case the user wants to use this module for other purposes) > Configuration option for returning the data as XML/JSON or as a markup (so that this can be pointed to from an iframe) > Caching response for calls that dont change frequently or if the user updates his album once a day or so.
About
Apache module for flickr access.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published