question about twitter4j and how to tie it in my processing code, urgent matter, please help
for a personal project I'm rebranding science center, located in los angeles, california. this is overall my concept for my logo.
i changed the name of the museum to 'museum of science' for international aspirations. the museum of science can be abbreviated down to 'mos', pronounced as 'moss'. the logo consists of particles revolving and gravitating towards the 'o' of 'mos'. this structure was inspired by their iconic sculpture of hundreds of balls hanging from the ceiling above the entrance, which symbolized the connectivity of everything science. i decided to further work with the concept of 'connectivity'. once in a few months the museum of science houses a special exhibition, for example they're currently having an exhibition titled '1001 inventions, the golden age of muslim civilization'. the logo extracts twitter feeds that consist of key words of the exhibition; in this case the key words would be '1001', 'inventions', 'golden age', 'muslim', 'civilization', 'science' and 'museum'. once the logo extracts a twitter feed, a color coded particle appears. however, the particles have, for example, a 10-20 second life span, and fades away until it eventually disappears.
because I'm new to this program, i was wondering if you guys can help with the technical coding.
here are the problems that I'm encountering:
- how can i get twitter4j to pick up multiple twitter feeds that consist of key words (explained above)
- how can i set up the fade away function and tie it together with twitter4j?
- how can i color code the twitter feed particles?
i know this is a lot to ask, but please help me out. this is due friday morning and I'm panicking..
heres my code. if you want the full file that consists of additional files that tie into the code below, i can do that. thank you!
PShape a;
Mover[] movers = new Mover[190];
Mover[] movers2 = new Mover[25];
Mover[] movers3 = new Mover[7];
//VOID SETUP////////////////////
void setup() {
size(800, 800);
smooth();
background(0);
a = loadShape("mos.svg");
for (int i = 0; i < movers.length; i++) {
movers[i] = new Mover(4, .07);
}
for (int i = 0; i < movers2.length; i++) {
movers2[i] = new Mover(4, .13);
}
for (int i = 0; i < movers3.length; i++) {
movers3[i] = new Mover(4, .2);
}
}
//VOID DRAW////////////////////
void draw() {
noStroke();
fill(255);
rect(0, 0, width, height);
for (int i = 0; i < movers.length; i++) {
movers[i].update();
movers[i].checkEdges();
movers[i].display();
}
for (int i = 0; i < movers2.length; i++) {
movers2[i].update();
movers2[i].checkEdges();
movers2[i].display();
}
for (int i = 0; i < movers3.length; i++) {
movers3[i].update();
movers3[i].checkEdges();
movers3[i].display();
}
shape (a, -200, -200, 1200, 1200);
}
class Mover {
PVector location;
PVector velocity;
PVector acceleration;
float topspeed;
int size;
float multiplier;
color col;
Mover(int xsp, float xmu) {
size = int(random(4, 9.5));
location = new PVector(random(width), random(height));
velocity = new PVector(random(width), random(height));
topspeed = xsp;
multiplier = xmu;
int x = int(random(0, 255));
float c = random(0, 100);
float m = random(0, 100);
float y = random(0, 0);
float k = random(0, 0);
col = convert(c, m, y, k);
}
//VOID UPDATE////////////////////
void update() {
PVector mouse = new PVector(width/2, height/2);
PVector dir = PVector.sub(mouse, location);
dir.normalize();
dir.mult(multiplier);
acceleration = dir;
velocity.add(acceleration);
velocity.limit(topspeed);
location.add(velocity);
}
//COLOR//9*I;//////////////////
color convert(float c, float m, float y, float k) {
c = c / 100;
m = m / 100;
y = y / 100;
k = k / 100;
c = ( c * ( 1 - k ) + k );
m = ( m * ( 1 - k ) + k );
y = ( y * ( 1 - k ) + k );
float r = ( 1 - c ) * 255;
float g = ( 1 - m ) * 255;
float b = ( 1 - y ) * 255;
return color(r, g, b);
}
//VOID DISPLAY////////////////////
void display() {
noStroke();
fill(col);
ellipse(location.x, location.y, size, size);
}
void checkEdges() {
if (location.x > width) {
location.x = 0;
}
else if (location.x < 0) {
location.x = width;
}
if (location.y > height) {
location.y = 0;
}
else if (location.y < 0) {
location.y = height;
}
}
}