Hello everyone
first post here.
Im currently working on a project for my master degree at University of Aveiro (Portugal) and I could use some help since its my first time coding processing.
My app should get the RSS feed from twitter and print a line, whenever a new tweet is sent.
At the moment everything is working fine but im checking my own tweets, and only the ones that come from my user. I can get a XML file using cURL with all the tweets from my friends (wich is exactly what i need).
Code:Get updates from users you follow in XML, authenticated: curl -u username:password hxxp://twitter.com/statuses/friends_timeline.xml
My question is, how can Processing interact with cURL so I can authenticate and get that same result.
as long as it works its ok, doesnt really need to be cURL. I need to authenticate before i get that friends_timeline.xml
After authenticating, i can get teh friends_timeline.rss and apply it on my existing processing code.
heres my processing code so far (its speaking to arduino):
Code:
import simpleML.*;
import processing.serial.*;
XMLRequest xmlRequest;
int time;
String lasttweet;
int i;
String[] check;
String[] titulo;
Serial port;
void setup() {
println("starting....");
frameRate(1);
//xmlRequest = new XMLRequest(this,"hxxp://twitter.com/statuses/friends_timeline.rss");
xmlRequest = new XMLRequest(this,"hxxp://twitter.com/statuses/user_timeline/23058764.rss");
int time = 0;
lasttweet=" ";
port = new Serial(this, Serial.list()[1], 9600);
}
void draw() {
background(0);
time++;
if (time>=4){
xmlRequest.makeRequest();
time=0;
}
}
void netEvent(XMLRequest ml) {
println("\n\nRequesting Info...\n");
titulo = ml.getElementArray("title");
check = match(titulo[1], lasttweet);
if (check != null){
println("New Tweet");
port.write('H');
}
else{
println("No Activity \n");
port.write('L');
}
println("Tweet Anterior: " + lasttweet + "\nTweet Novo: " + titulo[1]);
lasttweet = titulo[1];
}