Code Errors
in
Programming Questions
•
10 months ago
I am new and doing a tutorial right now. This is the code that is given, but unfortunately I am receiving the error "unexpected token: void" at my line "void setup()"... Here is my code below:
import org.json.*;
String apiKey = "<imagine_a_key_here>"
String baseURL = "http://api.nytimes.com/svc/search/v1/article"
void setup(){
getOJArticles(); //THE METHOD GETS CALLED HERE
};
void draw() {
};
void getOJArticles() {
String request = baseURL + "?query=O.J.+Simpson&begin_date=19940101&end_date=19960101&api-key=" + apiKey;
String result = join( loadStrings( request ), "");
println( result );
};
1