We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › extraction pictures from flickr with processing
Page Index Toggle Pages: 1
extraction pictures from flickr with processing (Read 2286 times)
extraction pictures from flickr with processing
Apr 3rd, 2007, 5:48pm
 
hello,

has somebody done this and could post links, code or ideas. I only found
http://www.eskimoblood.de/2005/05/18/longline-out-of-flickr/
but it didn't helped, cause i am missing the plan, how to do it, what else do i need (php, xml etc)
Since i am a beginner, something like a tutorial would be very nice.

best regards!
Re: extraction pictures from flickr with processin
Reply #1 - Apr 3rd, 2007, 8:44pm
 
Hi, you will need proXML to load and parse the response xml from flickr. Take look at the loadElement method.
http://www.texone.org/proxml/xmlinout_method_loadelement.htm#

For example:
Code:

xmlInOut.loadElement(http://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=yourAPIkey&group_id=13813978%40N00);


loads a xml with the latest 100 photos from the processing group pool. You will get an xml like this:

Code:


<rsp stat="ok">
<photos page="1" pages="12" perpage="100" total="1134">
<photo id="443233908" owner="35468141602@N01" secret="823ceb045b" server="204" farm="1" title="Blend success" ispublic="1" isfriend="0" isfamily="0" ownername="flight404" dateadded="1175495869"/>
<photo id="443166441" owner="35468141602@N01" secret="2f9418f1dc" server="165" farm="1" title="Blend error (or is it?)" ispublic="1" isfriend="0" isfamily="0" ownername="flight404" dateadded="1175495858"/>
.
.
.
</photos>
</rsp>

With this response you can build pathes to the images which you can load simply calling loadImage(imagePath). Note that this will not work in applets. To load the flickr response and the images in applets you will need some php pages to get a response from your server, the only place from where applets can load data.

Take a look at the flickr api documentation and the way the image path is build.

http://www.flickr.com/services/api/

http://www.flickr.com/services/api/misc.urls.html

Re: extraction pictures from flickr with processin
Reply #2 - Apr 4th, 2007, 11:51am
 
thanks a lot foremost, i will check this stuff out
Re: extraction pictures from flickr with processin
Reply #3 - Apr 27th, 2007, 10:08pm
 
eskimoblood wrote on Apr 3rd, 2007, 8:44pm:
For example:
Code:

xmlInOut.loadElement(http://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=yourAPIkey&group_id=13813978%40N00);

loads a xml with the latest 100 photos from the processing group pool. You will get an xml like this:


I tried the above and I received the following error: expecting RPAREN, found ':'

This is my code in processing:
Code:

import proxml.*;

xmlInOut.loadElement(http://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=IPUTMYAPIKEYRIGHTHERE&group_id=13813978%40N00);


I think colon in the "http:" part of the parameter string is causing a problem.  Is there anyway to escape the colon?  Or am I doing something wrong?  When I access the XML file with my API key from my browser, it works fine.

Any help is appreciated.

Thank you.
Re: extraction pictures from flickr with processin
Reply #4 - Apr 27th, 2007, 10:22pm
 
you need quotes around the url to specify that it's a string, not a long sequence of variables or something else:

loadElement("http://blahlblah");
Re: extraction pictures from flickr with processin
Reply #5 - Apr 27th, 2007, 11:26pm
 
Thank you for the prompt reply.

As a matter of fact, I did enclose the string in quotes prior to posting on this forum; however, I received this error:
No accessible field named "xmlInOut" was found in type "Temporary_7612_9065".

/tmp/build10146.tmp/Temporary_7612_9065.java:3:1:3:8: Semantic Error: No accessible field named "xmlInOut" was found in type "Temporary_7612_9065".

when using the following code

Code:

import proxml.*;

xmlInOut.loadElement("http://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=MYSECRETAPIKEYHERE&group_id=13813978%40N00");


I am pretty sure I installed the proxml libary correctly.  I unzipped it and placed the proxml folder that contain data, libary, src, docs, etc. inside of /Apps/Processing/libraries/.

Thank you for the help!
Re: extraction pictures from flickr with processin
Reply #6 - Apr 28th, 2007, 4:02pm
 
that's because xmlInOut, a variable of type XMLInOut is not created in your program. check the examples on his site for more details about how to use the library.
Page Index Toggle Pages: 1