From: srikanth on 26 May 2010 13:36 Hi All, I need some help to develop a script which needs to open a browser with speicifed URL and get the response back. Right now I am using xdg-open 'http://www.google.com'. Here i am using xdg-open because of they need to open in my default set browser. Here I want to specify all the URLs in a text file. My script should need to fetch the url from that input file and open in a browser and get back the result. Ex: If the site loads perfectly then it should say 'OK'. If the site show Error 404 then it should specify Error 404 etc.. It would be thanks ful if any one can please help me out from this problem. Thanks in advance.
From: srikanth on 26 May 2010 14:09 On May 26, 10:36 pm, srikanth <srikanth0...(a)gmail.com> wrote: > Hi All, > I need some help to develop a script which needs to open a browser > with speicifed URL and get the response back. > Right now I am using xdg-open 'http://www.google.com'. Here i am using > xdg-open because of they need to open in my default set browser. > Here I want to specify all the URLs in a text file. My script should > need to fetch the url from that input file and open in a browser and > get back the result. > Ex: If the site loads perfectly then it should say 'OK'. If the site > show Error 404 then it should specify Error 404 etc.. > It would be thanks ful if any one can please help me out from this > problem. > > Thanks in advance. Any alternate suggestions will also help me a lot.
From: Bit Twister on 26 May 2010 14:24 On Wed, 26 May 2010 11:09:45 -0700 (PDT), srikanth wrote: >> Here I want to specify all the URLs in a text file. My script should >> need to fetch the url from that input file and open in a browser and >> get back the result. > > Any alternate suggestions will also help me a lot. I use wget or html2text depending on what I want to retrieve. Other apps for fetching web site contents, curl, axel, aria2
From: Allodoxaphobia on 26 May 2010 22:44 On Wed, 26 May 2010 18:24:14 +0000 (UTC), Bit Twister wrote: > On Wed, 26 May 2010 11:09:45 -0700 (PDT), srikanth wrote: > >>> Here I want to specify all the URLs in a text file. My script should >>> need to fetch the url from that input file and open in a browser and >>> get back the result. >> >> Any alternate suggestions will also help me a lot. > > I use wget or html2text depending on what I want to retrieve. > Other apps for fetching web site contents, curl, axel, aria2 And, `lynx --dump --nolist http://example.com/` Jonesy -- Marvin L Jones | jonz | W3DHJ | linux 38.24N 104.55W | @ config.com | Jonesy | OS/2 * Killfiling google & XXXXbanter.com: jonz.net/ng.htm
From: bsh on 26 May 2010 22:55
srikanth <srikanth0...(a)gmail.com> wrote: > I need some help to develop a script which needs to open a browser > with speicifed URL and get the response back. > Right now I am using xdg-open 'http://www.google.com'. Here i am using > xdg-open because of they need to open in my default set browser. > Here I want to specify all the URLs in a text file. My script should > need to fetch the url from that input file and open in a browser and > get back the result. > Ex: If the site loads perfectly then it should say 'OK'. If the site > show Error 404 then it should specify Error 404 etc.. > It would be thanks ful if any one can please help me out from this > problem. Here are what scripts used to be applicable for the common desire to remotely control the only available Web browser, netscape(1). netsc.sh: "control netscape" http://software.dreissig.net get-runnning-netscape: "print info about URLS netscape(1) windows" http://cgd.sdf-eu.org/a/scripts/xutils/get-runnning-netscape netscape.ksh: "netscape(1) frontend" ftp://ftp.frontec.se/pub/cde/bin/Netscape ftp://ftp.frontec.se/pub/cde/bin/netscape-open netscape.sh: "netscape(1) frontend" http://www.an-netz.de/html-news/freshmeat/archiv/2000-Jun-14/59.html pnetcat.py http://stromberg.dnsalias.org/~dstromberg/pnetcat.html And finally, to your point: google.ksh: "perform google.com query: utilizes mozilla(1)" http://www.xs4all.nl/~gerardvw/HOME/ksh_settings/functions/google Of course, there is always the fallback of network access, netcat, and all of its familiar descendents in interpreted languages, including shellscript: netcat.c: "NETwork CAT" http://netcat.sf.net/ netcat.pl: "simple netcat(1) clone" http://www.xs4all.nl/~gerardvw/HOME/bin/netcat.pl netpipe.c: http://www.blaess.fr/christophe/logiciels/src/netpipe.html netcat: http://mirbsd.bsdadvocaccy.org/cvs.cgi/src/usr.bin/nc netpipes.c: "make TCP/IP streams usable in shell scripts" http://sources.isc.org/network/utils/netpipes/netpipes4.1-export.txt ftp://ftp.purplefrog.com/pub/netpipes/ http://www.cryptography.org/ socat.: "enhanced netcat(1)" http://www.dest-unreach.org/socat/ Ncat.: "compact/portable/enhanced netcat(1) clone" http://sf.net/projects/nmap-ncat/ nc_small.c: "mini-netcat" http://www.xs4all.nl/~gerardvw/HOME/src/nc_small.c netcat.c: "netcat(1) clone" http://aplawrence.com/KevinSmith/netcat/netcat.c netcat.c: "GNU netcat(1)" http://sf.net/projects/netcat/ netcat.pl: "netcat(1) clone" http://backpan.perl.org/authors/id/G/GR/GRAHJENK/netcat.pl netcat.pl: "netcat(1) clone" http://www.xs4all.nl/~gerardvw/HOME/bin/netcat.pl cryptcat.: "netcat(1) with encryption" http://farm9.org/Cryptcat/ nettee.: "NETwork TEE: derived-from dolly" http://saf.bio.caltech.edu/nettee.html "sock.c": "network sockets" ftp://atrey.karlin.mff.cuni.cz/pub/local/mj/net/sock-1.1.tar.gz Of which there are quite a few, as you can see... but since you mention shell, DGK and GSF wrote hurl, an ultra-portable do-it-anyway-you-can netcat(1): hurl.{sh,ksh93}: "copy URL to stdout" <AST-INIT>/src/cmd/INIT/hurl.sh # that is, within ksh93(1) dist package http://public.research.att.com/~gsf/man/man1/hurl.html The following scripts are not checked for accessibility. > Thanks in advance. You're welcome! =Brian |