I have a script that makes an ajax call to yahoo API which then 'crawls' a given URL and sent back the data. Second the data is being send to a service called "Embedly" (which is another call) The embedly service then does its thing and sens back the data which is showed as plain HTML. Please look at the script, its very simple: JsFiddle
$(document).ready(function() {
baseUrl = "http://www.nu.nl";
$.ajax({
url: baseUrl,
type: "get",
dataType: "",
success: function(data) {
$foop = $('<form>' + data.responseText + '</form>');
console.log(data.responseText);
$.each($foop.find('h3 a[href]'), function(idx, item) {
lnk = $(item).attr("href");
text = ('http://www.nu.nl');
$('<fb:like href="' + text + lnk + '"></fb:like><a href="' + text + lnk + '"></a>').appendTo('#content');
});
$('div#content').embedly({key: 'XXXXXXXXXXXXXXXXXX',
words: 10
});
},
error: function(status) {
//console.log("request error:"+url);
}
});
});
The problem I'm facing is that sometimes it takes to long to make the calls, especially in the evening and weekends the yahoo API and embedly really take a long time to return data. I would like to solve this problem by making the calls server side with PHP. So that if a visitor visits my site he would receive data from my server instead. Of course the data would have to be 'refreshed' somehow for instance every minute or so. I have googled for this but I cant seem to find anything which describes ajax call with PHP and so on.