javascript - PHP regular retrieval of JS-generated content for SEO purposes? -
i thought read in tutorial on yql chris heilmann if you're generating content client-side json, should include server-side function generate content @ regular intervals search engines find. (i wish find reference back.) true, , if so, php way run json function once week search bots?
$.getjson('http://query.yahooapis.com/v1/public/yql?q=this%20*%20is%20query&format=json&callback=', function (data) { $.each(data.query.results.row, function (i, item) { $("table#results") .append('<tr><td class="color">' + item.color + '</td><td class="size">' + item.size + '</td><td class="brand">' + item.brand + '</td></tr>'); });
i found the reference (last line)
a commenter provides php, html got stripped in comment:
<?php $scsvfile = 'https://spreadsheets.google.com/pub?key=12345678&hl=en&output=csv'; if (($handle = fopen($scsvfile, "r")) !== false) { while (($acsvdata = fgetcsv($handle, 1000, ",")) !== false) { echo '‘ . $acsvdata[0] . ‘‘ . php_eol; echo ‘‘ . $acsvdata[1] . ‘‘ . php_eol; } fclose($handle); } ?>
but it's either/or, right? either php or js/json?
Comments
Post a Comment