1

I was using the google-desktop's service for ubuntu (the abandoned package). You can get Google-desktop search results on a webpage in the browser. I was wondering if there is a way to get that webpage using the wget command or any other way to get the page in the terminal.

The URL that shows on the location bar for google-Desktop search is :

localhost:33327/search?flags=8&hl=en_US&num=10&q=hemingway&start=0&s=JD1G1cWkjb88GSZ1EPB3LVgcSwo

This sample url for the search query hemingway shows on my computer.

japzone
  • 1,283
  • 9
  • 18

1 Answers1

2

It is possible to retrieve the pages via wget. The simplest approach would be to simply copy the URL Google Desktop produces and paste it into wget "URL HERE".

However, if your wish is to do this all from Terminal without having to search using Google Desktop first, that will rely on if Google Desktop has to generate the results before giving you the link or not, and if the port it uses stays the same.

If you can simply search for "PIE" in Google Desktop and then, and in the Webpage that it opens, modify the URL so it says "CAKE" instead of "PIE", and then returns results for "CAKE". If that works then you can simply copy the URL into Terminal and modify it for whatever results you want:

wget "http://localhost:33327/search?flags=8&hl=en_US&num=10&q=SEARCH+REQUEST+HERE&start=0&s=JD1G1cWkjb88GSZ1EPB3LVgcSwo"

That should work and you can feel free to use that in a Bash script or whatever.

However viewing the results of the search in the Terminal is another thing. You could simply use a Terminal Editor like nano to open the HTML file but then you'll be staring at the RAW HTML code and that isn't the easiest thing to look at for search results. It is possible to make a Script to scrape the Results into something legible in the Terminal but that will be a lot of effort tweaking things correctly and is beyond the scope of this question. If you want to use Google Desktop search then I recommend simply opening the Webpage in a Browser like it was designed to do.

japzone
  • 1,283
  • 9
  • 18
  • The google destop api works on some OSes. Also, I am not interested in google-desktop's google web search. Basically want I want is to be able to create an index of my own files to search. – UnadulteratedImagination Apr 21 '13 at 03:31
  • @UnadulteratedImagination So you're saying that you want to Index your own files to be searched locally? Is there any reason why the Unity Dash and Nautilus searches don't work for you? What exactly do you want to be able to search for in the files? – japzone Apr 21 '13 at 14:30
  • 1) Google-desktop-search is better than nautilus and Unity Dash 2) GDS searches inside pdf files. – UnadulteratedImagination Apr 22 '13 at 09:15
  • @UnadulteratedImagination Now that I understand your question I've redone my Answer. If you have any more details to add to your question, please let me know and also update your question to reflect the added details. – japzone Apr 23 '13 at 01:32
  • @UnadulteratedImagination Glad I could help – japzone Apr 23 '13 at 13:45