Topic: flickrX - Basic Flickr API snippet  (Read 4154 times)

Pages: [1]   Go Down

#1: 27-Nov-2007, 02:13 AM

Testers

ganeshXL
Posts: 2,014

true is true

WWW
I was playing around with the Flickr API recently. I started out using simpleXML, but when I realized Flickr is offering now also serialized PHP response format, I abandoned XML altogether.

Anyway... I finally made a snippet for myself. Very basic so far. It doesn't allow using all of the API's methods or parameters. Its aim is to just display a few pics either by tag-searching, by user-id, from a set or randomly. Nothing fancy.

Here's a demo-page with various snippet parameters: http://www.screenlab.ch/flickr-api-tests.html
Code/Infos: http://www.screenlab.ch/assets/snippets/flickrX.phps

I just named it flickrX and installed it with:
include($modx->config['base_path']. 'assets/snippets/flickrX.php');

As already said... it's far from perfect or complete, but maybe somebody else might find it useful.

#2: 27-Nov-2007, 05:37 AM

Testers

dev_cw
Posts: 4,179

WWW
This is great, I will definitely take a closer look at this api/snippet.
Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

Something is happening here, but you don't know what it is.
Do you, Mr. Jones?  -  [bob dylan]

#3: 28-Nov-2007, 06:06 AM

Mike L.
Posts: 38

me too!!
I already integrated the XML feeds (newest pics of a group).
But thats all.
I will watch

#4: 28-Nov-2007, 06:38 AM

Mike L.
Posts: 38

aehm...
I tried to use method http://flickr.com/services/api/flickr.favorites.getList.html
This method needs an authentication.
But I failed...

Can anyone help?

#5: 28-Nov-2007, 07:20 AM

Testers

ganeshXL
Posts: 2,014

true is true

WWW
Do you have an API key?
http://flickr.com/services/api/keys/apply/

#6: 28-Nov-2007, 08:59 AM

Mike L.
Posts: 38

Yes, but I dont have enough knowledge about php and API programming. That's the problem.

#7: 28-Nov-2007, 09:26 AM

Testers

ganeshXL
Posts: 2,014

true is true

WWW
I never actually used those methods that require special authentication. In any case, here's the API docs:

http://flickr.com/services/api/misc.userauth.html
http://flickr.com/services/api/auth.howto.web.html

Seems like a pain in the neck... basically a few extra requests to the Flickr server prior to using the flickr.favorites.getList method.
It's also necessary for doing actual manipulations of your own photos, such as adding tags, removing pics, change permissions etc.
Security measures I reckon... though I don't think viewing someone's favorite pics should be considered "insecure" per se... maybe over-zealous lawyers believe it's breaking some privacy laws or something Smiley

#8: 17-Dec-2008, 10:35 AM


Adam Wintle
Posts: 68

WWW
This thread is so old SMF has warned me to start a new topic!

but anyway, from searching around this seems to be the only good Flickr snippet for MODx - but for a particular project I'm working on being able to interface with a Flickr Group is key; is anybody familiar with the the Flickr API or good enough at PHP to implement this into flickrX?

Of if there's a newer snippet i missed can anybody point me in the right direction? Smiley

#9: 17-Dec-2008, 01:14 PM

Testers

ganeshXL
Posts: 2,014

true is true

WWW
Well, I built something recently that takes tags from a TV, and generates Flickr thumbnails, decriptions, links etc. from one particular group only.

Can you describe what functionality you need exactly?
« Last Edit: 17-Dec-2008, 01:35 PM by ganeshXL »

#10: 17-Dec-2008, 02:24 PM


Adam Wintle
Posts: 68

WWW
Hey ganeshXL, thanks for getting back to me,

Quote
Can you describe what functionality you need exactly?
Yeah, basically I've been asked by a Flickr group Admin to build a site to help the community he's build up move away from Flickr - I thought instead of transferring the users to something like WebLoginPE and getting them to signup and upload their photos, for now they could stick to Flickr for the data side of things.

The most basic functionality I'd say is needed would be to pull the group's photos into MODx and be able to organize them by their user, date taken or by their tags.

I'm not sure what the extent of the Flickr API is, would it theoretically be possible to reconstruct most of Flickr's functionality, like comments, tagging, adding photos, favorites etc in a custom designed MODx site; and then being able to add extra functionality and features through MODx?

The idea behind the group is that artists do a painting and leave it around cities for people to pick up and find for free and the whole process is documented with photos - Additionally the group's Admin has asked about perhaps intergrading Google Maps (or perhaps the Flickr Maps, but I've hardly used them) so people who find these paintings can go onto the site and mark where they found it and where that panting has gone to now; its life's journey if you like - he's also asked about artist blogs, which would totally be possible with MODx - and being able to organize the photos by user I'd be able to build a nice artist portfolio on the site...
« Last Edit: 17-Dec-2008, 02:26 PM by Mallmus »

#11: 18-Dec-2008, 07:19 AM

Testers

ganeshXL
Posts: 2,014

true is true

WWW
All of that is possible. Flickr has also geotagging functions in their API: http://www.flickr.com/services/api/

Flickr belongs to Yahoo now, hence they're using Yahoo-maps, not Google. But as long as you get the long./lat. data from Flickr, you can display it wherever you want.

Since Flickr has already excellent community features, I'm not sure what the benefits are from re-creating all this functionality. Adding / viewing comments, or group discussions already exist. Why replicate it? You'd have to deal with your own (modx) user-registration and -login. Unless you want to build a "dual" user-authentication system that allows your site visitors to login with their existing Flickr credentials. But I guess that's not so trivial.

#12: 20-Dec-2008, 12:50 AM


Adam Wintle
Posts: 68

WWW
Quote
Since Flickr has already excellent community features, I'm not sure what the benefits are from re-creating all this functionality. Adding / viewing comments, or group discussions already exist. Why replicate it?

I had another chat with the Group's admin and mentioned those points and we both agreed that some kind of customized portfolio pages and blogs on the site which pull each particular artists photos through - it would make sense to leave most of the photos-related features on Flickr - but then handles blogging and artist bio on the site.

Then he'd be able to build up the community and slowly move away from Flickr and onto a proper site Smiley

Do you know if it would be possible to have it so visitors could leave blog comments with their Flickr credentials? The comments wouldn't show up on Flickr but instead just use their avatar and usernames?

#13: 20-Dec-2008, 11:27 AM

Testers

ganeshXL
Posts: 2,014

true is true

WWW
Guess you would have to use their Auth API functions: http://www.flickr.com/services/api/auth.spec.html
Not trivial, but certainly possible.

#14: 12-Sep-2009, 02:57 PM

JimKillock
Posts: 34

WWW
Hey ganeshXL,

Is your version that retrieves from a rgoup available at all? Sounds like the tool we need, as we'd like users to be able to add photos, but also to remove them if necessary.

Pages: [1]   Go Up
0 Members and 1 Guest are viewing this topic.