Непосредственно откройте три лучших результата Google из адресной строки в Chrome

709
danijar

Недавно мой друг заметил, что я часто открываю первые несколько результатов Google во вкладках, не глядя на них в первую очередь. Теперь я хотел бы напрямую открыть лучшие результаты Google из адресной строки. Я знаю, что в настройках можно добавить собственные поисковые системы в панель. Тем не менее, как я могу сделать так, чтобы Chrome открывал сразу несколько вкладок при использовании такой поисковой системы?

0

1 ответ на вопрос

0
Wilhelm Erasmus

You could perhaps run a webserver in the background which takes the query and passes it to a google "i'm feeling lucky" link. Opening more than one tab would obviously require you visting the website in chrome and explicitly allowing popups. To open the top 3(not only the first) search result, you will probably have to get the source code of the page(probably possible with either wget or links) and extract the search results from it. To only look for search results and avoid opening, say the gmail link, you may wish to filter out everything until the second hit of your search criteria.

Code for this would look something like this:

wget http://google.com/?q=$query -O $query.html l=grep -n $query | head -c 1 head -cv $l echo $source | grep '<a href=' for i in $l1 $l2 $l3; do google-chrome-unstable $i ;done 

Note that my code is probably broken and I have no idea how to get the script to run without using command line, but maybe you could do it using a web2py server with the python system.os command.

Hope it helps

Похожие вопросы