Search Internet (done for now)

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Search Internet (done for now)

#1 Post by abc0502 » 03 Apr 2012 11:38

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
Last edited by abc0502 on 09 Apr 2012 10:31, edited 1 time in total.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Search Internet

#2 Post by foxidrive » 03 Apr 2012 18:17

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

Mohammad_Dos
Posts: 84
Joined: 08 Sep 2010 10:25
Location: Iran,Kashan
Contact:

Re: Search Internet

#3 Post by Mohammad_Dos » 04 Apr 2012 10:11

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

Squashman
Expert
Posts: 4479
Joined: 23 Dec 2011 13:59

Re: Search Internet

#4 Post by Squashman » 04 Apr 2012 13:43

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"

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: Search Internet

#5 Post by Ed Dyreen » 04 Apr 2012 13:59

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' )

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: Search Internet

#6 Post by abc0502 » 04 Apr 2012 15:48

@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

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: Search Internet

#7 Post by Ed Dyreen » 04 Apr 2012 17:11

'
Sorry, I edit above post, try it now :oops:

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: Search Internet

#8 Post by abc0502 » 04 Apr 2012 17:18

Thanks Ed Very helpful tool :)

Post Reply