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 & HelpSyntax Questions › Importing & moving images
Pages: 1 2 
Importing & moving images (Read 1959 times)
Re: Importing & moving images
Reply #15 - Jan 31st, 2010, 11:54am
 
well, i was bored yesterday and still curious about this so i, er, ,did a bit of a rewrite...

i've added an Item class to hold all the details of the, er, items. the setter methods handle parsing and setting of multiple fields where required (getting image url from description, for instance). i haven't bothered with getter methods as they are all trivial.

added an ArrayList of Items replacing your arrays and making them easier to add new entries to (i merge the newly downloaded list with the current list. this is mainly (wholly) so i can make sure i'm only downloading new images (took me a while to realise that the r= argument was random...))

got rid of simpleML and used the inbuilt xml routines instead (getChild, getContent...). it gets the rss feed once, handles the CDATA, returns an arraylist of items which it can compare / merge in with the current set.

it's not perfect - it no longer loads the xml in the background like it used to, or the images. so it might grind to a halt every minute when it reloads. (the images are the worst thing as they can be quite large). might be an idea to use another thread or that other image loading code.

it's here: http://www.koogy.clara.co.uk/Ladle.pde (but don't feel obliged to use it, i did it as something to do on a boring saturday)

lots of debug in it still and i haven't actually seen it merge in new images as the feed was quiet when i was testing it.

i haven't touched the displaying of images and text either, beyond changing the images to 200x200 so i could see them.
Pages: 1 2