RE: Making a unbranded movie search engine 09-13-2018, 10:02 PM
#2
Nice Guide, Worked straight away, although Googles API has a daily search limit which i have reached already.
For my 1st post i thought id try and be helpful, I altered it a little (formatting and included brief description for link), Save code as php file.
example search: "search.php?photoshop"
Once my daily limit resets you can preview it HERE
For my 1st post i thought id try and be helpful, I altered it a little (formatting and included brief description for link), Save code as php file.
example search: "search.php?photoshop"
Code:
<script>
var keyword = "<? echo $_SERVER['QUERY_STRING'] ?>";
if (keyword != null) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var myObj = JSON.parse(this.responseText);
document.write('<center><table><tr><td>');
for (x in myObj.items) {
document.write('<a href="'+ myObj.items[x].link +'" target="_blank" style="text-decoration:none">');
document.write('<font style="color:blue;font-size:12;"><b>' +myObj.items[x].title +'</b></font><br>');
document.write('<font style="color:black;font-size:10;">' +myObj.items[x].snippet +'</font><br>');
document.write('<font style="color:grey;font-size:10;font-style:italic;">'+myObj.items[x].link +'</font></a><br><br>');
} ; document.write('</td></tr></table></center>') ; } ; } ;
xmlhttp.open("GET", "https://www.googleapis.com/customsearch/v1?key=AIzaSyBuR2Oz3LCECz6SQy5ZOiJn7hZ2aIj_-S0&cx=001070665017575917052:gmagdjk2wye&q="+keyword+"&alt=json", true);
xmlhttp.send() ; }</script>Once my daily limit resets you can preview it HERE

![[+]](https://sinister.li/images/modern/collapse_collapsed.png)