Skip to content

Instantly share code, notes, and snippets.

@zamfi

zamfi/trump.pde

Created Oct 19, 2017
Embed
What would you like to do?
int trumpFactor;
void setup() {
size(500, 500);
}
void draw() {
background(255);
translate(width/2, height/2);
fill(127, 0, 0);
noStroke();
ellipse(0, 0, trumpFactor * 10, trumpFactor * 10);
}
void mousePressed() {
trumpFactor = 0;
JSONObject data = loadJSONObject("https://www.buzzfeed.com/api/v2/feeds/index");
JSONArray stories = data.getJSONArray("big_stories");
for (int i = 0; i < stories.size(); i++) {
JSONObject story = stories.getJSONObject(i);
if (story.getString("title").contains("Trump")) {
trumpFactor += 1;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.