Sponsored Content
Top Forums UNIX for Advanced & Expert Users script to open the specified url in a browser from a text file Post 302133374 by cbkihong on Thursday 23rd of August 2007 06:09:20 AM
Old 08-23-2007
I believe the practice of this forum is not to encourage excessive spoon feeding, instead, to give you pointers for you to explore on your own, to give you an opportunity to learn.

The HEAD HTTP method is frequently used instead of GET to get the headers without downloading the message body. That seems to fit what you want. But you can use GET if you like.

Look at this for example:
http://search.cpan.org/~gaas/libwww-...808/lib/LWP.pm

I think it should be enough to get you going about the HTTP part. For the file writing part, you should read some Perl documentation for file I/O for further information.

Please try to assemble something on your own first and post for advice before asking for more code given. Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Displaying text file in browser - perl

I am having issue dispalying text file in browser using perl. Here is my code: #!/usr/bin/perl print "content-type: text/html \n\n"; open (FH , "access.log") || die "Blah $!"; while (<FH>) { print $_ ; } I have correct permissions and everything. The weired thing is when I... (1 Reply)
Discussion started by: Dabheeruz
1 Replies

2. Shell Programming and Scripting

Displaying text file in browser - perl

Don't know why this didn't get posted before but... I am having issues displaying a log file in the browser using perl and I can't get it to display at all, All i get is WHITE (blank page). I have proper permissions in my cgi-bin directory and everywhere else. So I know that's NOT the issue. ... (3 Replies)
Discussion started by: Dabheeruz
3 Replies

3. UNIX for Dummies Questions & Answers

open windows's .url file in unix

In windows, I can create a shortcut for websites. It's a .url file. the content of the file is like: How can I open it, the .url file, in firefox or google chrome in Unix(or just ubuntu)? (2 Replies)
Discussion started by: hz_i3
2 Replies

4. Shell Programming and Scripting

Text substitution & getting file name from url

hi, sorry if this seems trivial. i have a file url.txt which consists of a list of urls (it was supposed to be my wget -i file). however, since the server from which i am trying to download uses redirect, wget dows not remeber the filename of ther original url will save to a file name which is... (3 Replies)
Discussion started by: texttoolong
3 Replies

5. Shell Programming and Scripting

How to find invalid URL in a text file using shell script?

How to find and remove invalid URLs in a text file using shell script? (1 Reply)
Discussion started by: vel4ever
1 Replies

6. Shell Programming and Scripting

Hit multiple URL from a text file and store result in other test file

Hi, I have a problem where i have to hit multiple URL that are stored in a text file (input.txt) and save their output in different text file (output.txt) somewhat like : cat input.txt http://192.168.21.20:8080/PPUPS/international?NUmber=917875446856... (3 Replies)
Discussion started by: mukulverma2408
3 Replies

7. HP-UX

Browser to check URL in hpux.

Hello Expert, I want to test the url in hp-ux, so it is possible via putty ?? Also have xmanager on the same system. (5 Replies)
Discussion started by: purushottamaher
5 Replies

8. Shell Programming and Scripting

Extracting the column containing URL from a text file

I have the file like this: Timestamp URL Text 1331635241000 http://example.com Peoples footage at www.test.com,http://example4.com 1331635231000 http://example1.net crack the nuts http://example6.com 1331635280000 http://example2.net ... (0 Replies)
Discussion started by: csim_mohan
0 Replies

9. Shell Programming and Scripting

Extracting the column containing URL from a text file

I have the file like this: Timestamp URL Text 1331635241000 http://example.com Peoples footage at www.test.com,http://example4.com 1331635231000 http://example1.net crack the nuts http://example6.com 1331635280000 http://example2.net ... (0 Replies)
Discussion started by: csim_mohan
0 Replies

10. Shell Programming and Scripting

Extracting the column containing URL from a text file

I have the file like this: Timestamp URL Text 1331635241000 http://example.com Peoples footage at www.test.com,http://example4.com 1331635231000 http://example1.net crack the nuts http://example6.com 1331635280000 http://example2.net ... (3 Replies)
Discussion started by: csim_mohan
3 Replies
Test::Mock::HTTP::Request(3pm)				User Contributed Perl Documentation			    Test::Mock::HTTP::Request(3pm)

NAME
Test::Mock::HTTP::Request - Mocks HTTP::Request SYNOPSIS
Make HTTP::Request to make testing easier. See Test::Mock::LWP manpage for more details. This class uses Test::MockObject, so refer to it's documentation as well. AUTHOR
Luke Closs, "<test-mock-lwp at 5thplane.com>" BUGS
Please report any bugs or feature requests through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Mock-LWP>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. SUPPORT
You can find documentation for this module with the perldoc command. perldoc Test::Mock::LWP You can also look for information at: * AnnoCPAN: Annotated CPAN documentation <http://annocpan.org/dist/Test-Mock-LWP> * CPAN Ratings <http://cpanratings.perl.org/d/Test-Mock-LWP> * RT: CPAN's request tracker <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Mock-LWP> * Search CPAN <http://search.cpan.org/dist/Test-Mock-LWP> ACKNOWLEDGEMENTS
COPYRIGHT &; LICENSE Copyright 2006 Luke Closs, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.8.8 2007-01-25 Test::Mock::HTTP::Request(3pm)
All times are GMT -4. The time now is 10:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy