I'm not sure how to approach this problem, since I'm new to web programming. I have a python program that collects keyword specific tweets from twitter, then adds them to a mysql database. It does this continuously so long as the program is kept running.
Now what I want to do is post the tweets it collects on a website (just start with posting the tweet text, something simple) as soon as the program enters it into the database, or in real time/as close to real time as I can get. Hope that makes sense. Anyways, how should I approach this? I was thinking either:
1) have python send tweet text directly to website using ajax? 2) have website html/javascript/php use ajax to ask mysql if there are any new updates, if so, post new tweets...or does this need to be in reverse ajax?
Any advice or suggestions would be greatly appreciated!
Javascript ajax... I use Jquery so it is mixed in here:
$(document).ready(function(){
setInterval(function(){
$.ajax({
//call to your php script that returns new tweets from mysql in table form or other
}).done(function(response){
$('#displayDiv').append(response);
});
}, 1000);//every one second
});