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 & HelpIntegration › last fm rss feed in sketch
Page Index Toggle Pages: 1
last fm rss feed in sketch (Read 2948 times)
last fm rss feed in sketch
Jan 15th, 2008, 6:31pm
 
Hi guys, new to Processing, and perhaps my idea is too ambitious for a beginner, but I'm hoping i can get some help.

Basically, i want to include xml data from last fm (showing the most popular artists in the uk in the last wek) in my sketch, i would like the information to float around the screen, with the size of the information proportional to the popularity of it.

I understand that im going to need proxml to work with the xml , and ive installed that in my libraries, I'm just not sure how to get the xml data to appear in my sketch, I've looked in  the book, and around here, but havn't had any luck.

Any help, ideas or suggestions would be greatly appreciated

Thanks, Dan.
Re: last fm rss feed in sketch
Reply #1 - Jan 15th, 2008, 8:04pm
 
check out this thread.

I posted an example on how to load an rss feed and display it (pretty roughly) in Processing.

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Integrate;action=display;num=1194465303
Re: last fm rss feed in sketch
Reply #2 - Jan 15th, 2008, 8:18pm
 
Hi,

Thanks for the quick reply, when i try your script and add a font to the data folder i get the following error:

java.lang.NullPointerException
at java.io.DataInputStream.readInt(Unknown Source)
at processing.core.PFont.<init>(PFont.java:125)
at processing.core.PApplet.loadFont(PApplet.java:4020)
at Temporary_829_4214.setup(Temporary_829_4214.java:15)


Any ideas?
Re: last fm rss feed in sketch
Reply #3 - Jan 16th, 2008, 12:55am
 
I believe that's because it can't find the font.
Check if you named it right.

Or to avoid any confusion, you can also use "createFont" instead of "loadFont"

Code:
font = createFont("Verdana",20); //loads the font 



After further testing, I noticed that the code doesn't work with Processing 135 but with Processing 125, it works fine. I looked at the change log and I don't see anything that would affect it. Will try to figure out why.

On version 135, we get:
Quote:
java.lang.reflect.InvocationTargetException at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


Anyone knows why?
Re: last fm rss feed in sketch
Reply #4 - May 25th, 2008, 5:03pm
 
i know its an old thread, but i couldn find an answer to the last question on the boards.
i ask because i get the
Quote:
java.lang.reflect.InvocationTargetException at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

error as well.. and cant figure out why...

best,

troop
Re: last fm rss feed in sketch
Reply #5 - May 26th, 2008, 11:53am
 
Funnily enough, I got this error the first time I ran the sketch. I added some println to see at which point it happened, and it worked!
Even after removing the println...
Re: last fm rss feed in sketch
Reply #6 - Jun 1st, 2008, 3:51am
 
Is it possible that you were trying to load the font too many times?  I just ran into the same error and the problem was that I was running the code inside a class that was getting instantiated many times.  I moved it out of the class to the main sketch and it seems to be working fine now.
Page Index Toggle Pages: 1