Subscribe to RSS feed

Separate blog

Moved my blog to http://rreverser.com/. From now and on all my articles will be published there.

"Suggest URL"s for some search engines

Google Translate suggestion in Opera

, , ,

There is a way to add Google Translate suggestions in Opera (at least, for those who has PHP on local machine; if you don't, please choose any free PHP hosting with allowed HTTP request). So, firstly create and upload such PHP file:
<?php
header('content-type:text/javascript');
$q=stripslashes($_GET['q']);$sl=$_GET['sl'];$tl=$_GET['tl'];
$t=file_get_contents('http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q='.urlencode($q).'&langpair='.urlencode($sl).'|'.urlencode($tl));
$a=json_decode($t,true);
echo json_encode($a['responseStatus']!=200?array():array($q,array($a['responseData']['translatedText'])));

It will return google translate using OpenSearch formatting.
Then, you should open search.ini (in profile folder) and find there your Google Translate's section. Add to this section those two lines:
Suggest Protocol=JSON
Suggest URL=http://localhost/gsearch.php?q={SearchTerm}&tl=ru (or another your URL)

Restart Opera. That's all)