Hi there,
I'm building a sketch with various subclasses, all based on pulling in various data streams. All work fine except this part that calls yahoo weather data. As I'm still a learner-driver and after a lot of puzzling I still can't figure out what the problem is.- It keeps tellng me "The constructor XMLRequest (weatherclass.WeatherClass( int, int) is undefined".
To try to solve it, I've simplefied the code just calling the weather data and visualising it as a dot. It works fine as a "classless" sketche. But if I try using a "class" I get the same remark. What am I doing wrong?
Is it the parameters in the constructor, it does not make a difference if I put none or 1 in there?
void getWeather() {
String url = "http://weather.yahooapis.com/forecastrss?w=26360988&u=c";
XMLRequest req = new XMLRequest(this, url);
req.makeRequest();
println ("loaded from xml.weather.yahoo.com");
}
void netEvent(XMLRequest ml) { // Get the specific XML content we want
temperature = int(ml.getElementAttributeText("yweather:condition", "temp"));
weather = int (ml.getElementAttributeText("yweather:condition", "code"));
}
//------------------------
void dotObject() {
fill (100);
ellipse (weather*2, temperature*2, weather, weather);
}
------------------------------------------------------------------------------------------------------------------------------------
with class:
Hi
I'm trying to make a clock that shows real time, so it can work as a timer as well as trigger events. ( i want it for sunrise and sunset. I found some code here in the forum that helps as far as it creates the clock, but it doesn't refresh.
What am I doing wrong?
ps is the if statement right as a trigger (it's not accurate, but will be linked up to yahoo xml)?
thanks
nanette
here is the code:
import java.util.*;
Calendar calendar = new GregorianCalendar();
String am_pm;
int hour = calendar.get(Calendar.HOUR);
int minute = calendar.get(Calendar.MINUTE);
int second = calendar.get(Calendar.SECOND);
// int framerate (60);
after a day of trying, and applying ideas within the forum I really could do with some help. I believe it's simple ( but not for me...)
I'm trying to create a simple api showing 'two moods' - good and bad- based on twitter feeds. ( this as a starting point to something more complex) One stream is based on positive words in tweets, one on negative.
I can make it work, based on a single search term, but when I add several words in the search string there is no output, while I expect an increase of output. Can someone help?
Here is the code:
//Build an ArrayList to hold all of the words that we get from the imported tweets
String good []= {"good", "wonderfull", "great"};
String bad[] = {"bad", "down", "shit"};
ArrayList<String> words = new ArrayList();
import java.util.Date;
void setup() {
//Set the size of the stage, and the background to black.
size(400, 400);
background(0);
smooth();
//Credentials (authentication to allow to get on twitter)
ConfigurationBuilder cb = new ConfigurationBuilder();