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 › Switchboard and Youtube
Page Index Toggle Pages: 1
Switchboard and Youtube (Read 801 times)
Switchboard and Youtube
Apr 14th, 2007, 8:55pm
 
I am  new to processing and I am trying to talk to YouTube via the switchboard library but I am unsure of the syntax.  Does anyone one have any simple examples I could follow? I am sure once I get my head wrapped around the idea, it will make sense.
Thx.
Re: Switchboard and Youtube
Reply #1 - Apr 17th, 2007, 9:34pm
 
I took a run at accessing YouTube via Switchboard this morning but without sucess.

Clearly the error is coming from the board.youtube(String url) line but I'm not sure if this a bug or if I am missing something. It is possible I'm not using the correct url for the video but if that's the case I'm not sure where I'd get the correct one.

Code:
import org.switchboard.*;
Switchboard board;

void setup() {
size(300,300);
board = new Switchboard(this);
board.setYouTubeKey("XXXXXXXXXXX");
// Go here to get your own YouTube key
// http://www.youtube.com/dev

board.youtube("http://www.youtube.com/watch?v=kinhybgOOTI");
}

void resultReceived() {
// This should print out the name of the video's author
println(board.youtube.getAuthor());
}

// The following two methods are apparently optional. They are
// included here to avoid the errors generated when they
// are not included.

void endOfResults(){
}

void status(){
}


The documentation here seems to be incomplete since it does not list setYouTubeKey as method however it is a necessary componenet.

When I run this sketch I receive the following error:
Code:
java.lang.NoSuchMethodError: java.lang.String.replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; 
at org.switchboard.util.NetUtil.makeRestRequest(NetUtil.java:130)

Page Index Toggle Pages: 1