Page 1 of 1

Search Internet (done for now)

Posted: 03 Apr 2012 11:38
by abc0502
Hi,
I made a search tool that search specific websites "dostips, filehippo, softpedia, the piret bay"
it work just fine but i wanted to modify it to add more websites and search two or three of them in the same time but the trick is to get the result of both in one html file
so is it possible to output the search result to my own html page?
here is my code:

Code: Select all

@echo off
setlocal
cls
:loop
color 0b
mode 80,25
title Search Tool
::====================================================================
echo:
echo:
echo:
echo:        ................................................................
echo:        ::'######::'########::::'###::::'########:::'######::'##::::'##:
echo:        :'##... ##: ##.....::::'## ##::: ##.... ##:'##... ##: ##:::: ##:
echo:        ::##:::..:: ##::::::::'##:. ##:: ##:::: ##: ##:::..:: ##:::: ##:
echo:        :. ######:: ######:::'##:::. ##: ########:: ##::::::: #########:
echo:        ::..... ##: ##...:::: #########: ##.. ##::: ##::::::: ##.... ##:
echo:        :'##::: ##: ##::::::: ##.... ##: ##::. ##:: ##::: ##: ##:::: ##:
echo:        :. ######:: ########: ##:::: ##: ##:::. ##:. ######:: ##:::: ##:
echo:        ::......:::........::..:::::..::..:::::..:::......:::..:::::..::
echo:                  ::'########::'#######:::'#######::'##:
echo:                  ::... ##..:: ##.... ##:'##.... ##: ##:
echo:                      : ##:::: ##:::: ##: ##:::: ##: ##:
echo:                      : ##:::: ##:::: ##: ##:::: ##: ##:
echo:                      : ##:::: ##:::: ##: ##:::: ##: ##:
echo:                      : ##:::: ##:::: ##: ##:::: ##: ##:
echo:                      : ##::::. #######::. #######:: ########:
echo:                      :..::::::.......::::.......:::........::
echo:
echo:
echo:
::======================================================================
ping localhost -n 3 >nul
cls
echo.
echo.
echo.
echo.
echo                             ======================
echo                             =     Search List    =
echo                             ======================
echo.
echo.
echo                            1) Softpedia
echo                            2) Dos Tips
echo                            3) File Hippo
echo                            4) The Pirates Bay "Torrent"
echo                            5) Exit
echo.
echo Choose Website :
set /p "cho=>"
if %cho%==5 goto EOF
echo.
Echo Search Topic:
set /p "cho2=>>"
set cho2=%cho2%
if %cho%==1 start "firefox" "http://www.google.com.eg/search?q=site:softpedia.com+%cho2%"
if %cho%==2 start "firefox" "http://www.google.com.eg/search?q=site:dostips.com+%cho2%"
if %cho%==3 start "firefox" "http://www.google.com.eg/search?q=site:filehippo.com+%cho2%"
if %cho%==4 start "firefox" "http://thepiratebay.se/search/%cho2%"
cls
goto loop
:EOF

help appreciated

Re: Search Internet

Posted: 03 Apr 2012 18:17
by foxidrive
Just an idea:

Use Wget to get the google html etc amd set the filenames using a switch

wget -switchesHere "http://www.google.com.eg/search?q=site:softpedia.com+%cho2%"
wget -switchesHere "http://www.google.com.eg/search?q=site:filehippo.com+%cho2%"

and copy the resulting html files together and then display them in firefox etc.

copy softpedia.htm + filehippo.htm total.htm

start "" total.htm

Re: Search Internet

Posted: 04 Apr 2012 10:11
by Mohammad_Dos
I have firefox and opera but my default web browser is opera. when i try this:

Code: Select all

if %cho%==1 start "firefox" "http://www.google.com.eg/search?q=site:softpedia.com+%cho2%"

it does not use firefox to open this page and opera would do that

Re: Search Internet

Posted: 04 Apr 2012 13:43
by Squashman
Mohammad_Dos wrote:I have firefox and opera but my default web browser is opera. when i try this:

Code: Select all

if %cho%==1 start "firefox" "http://www.google.com.eg/search?q=site:softpedia.com+%cho2%"

it does not use firefox to open this page and opera would do that

If you read the documentation for the START command you will notice that it interprets the first set of quotes as the TITLE of the window.

So you need to do this.

Code: Select all

start "" "firefox" "http://www.google.com"

Re: Search Internet

Posted: 04 Apr 2012 13:59
by Ed Dyreen
edit 04 Apr 2012 17:59
Squashman wrote:If you read the documentation for the START command you will notice that it interprets the first set of quotes as the TITLE of the window.

So you need to do this.

Code: Select all

start "" "firefox" "http://www.google.com"

or

Code: Select all

start firefox.exe http://www.google.com
start default browser.

Code: Select all

start http:
start http://www.google.com
start explorer http://www.google.com
Script to search google - problem with multiple quotations
http://www.dostips.com/forum/viewtopic.php?f=3&t=2869&start=0

@abc0502, if you don't like wget, http://www.autoitscript.com/site/autoit/

Code: Select all

_IENavigate ( $object, 'about:blank' )
_IENavigate ( $object, 'http://login.live.com' )

Re: Search Internet

Posted: 04 Apr 2012 15:48
by abc0502
@foxidrive i tried wget it's agreat tool but i couldn't get it done, i found a vbscript that download html pages i will try it

@Mohammad_Dos, Squashman & EdDyreen
i didn't notice that "firefox" is just a title i have firefox only as my defualt so it was openning
and nice post Ed sugested this empty quotes is a nice trick and also %%22
thanks all i will try with the vb script and post the result
and Ed i didn't understand the code you posted and the webpage u posted it is not working

Re: Search Internet

Posted: 04 Apr 2012 17:11
by Ed Dyreen
'
Sorry, I edit above post, try it now :oops:

Re: Search Internet

Posted: 04 Apr 2012 17:18
by abc0502
Thanks Ed Very helpful tool :)