script to output curl result as html


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting script to output curl result as html
# 1  
Old 07-09-2009
script to output curl result as html

hi,

new to scripting and would like to know how can I have a script which will curl a few URLs and have the results such as the URLs being curled, dns lookup time, connection time, total time, etc save in a html format in a form of table with column and rows.

thank you.
# 2  
Old 07-10-2009
I think we need an explanation of what is meant by "curl" in the question?
# 3  
Old 07-11-2009
Quote:
Originally Posted by TonyFullerMalv
I think we need an explanation of what is meant by "curl" in the question?
hi, by curl I mean using the program curl.....that is to say, I have a shell script which run the command curl with some option that will display the dns lookup time, connection time, total time, etc.....pls advise how can I have these results format into a html file in a form of table with column and rows......thank you....
# 4  
Old 07-17-2009
can anyone pls help.....basically what I want is a script whereby I run the command curl -s -w '%{time_namelookup} %{time_connect} %{time_total}\n' -k -L http://www.website.com -o /dev/dull and the result to be display into a html file in a form of table with column and rows like the following example......thank you....

+++++++++++++++++++++++++++++++++++++++++++++++++++++
+URL +lookuptime +time_connect +time_toal +
+++++++++++++++++++++++++++++++++++++++++++++++++++++
+www.xxx +0.02 +0.05 +0.2 +
+++++++++++++++++++++++++++++++++++++++++++++++++++++
+www.yyy +0.04 +0.09 +1.2 +
+++++++++++++++++++++++++++++++++++++++++++++++++++++
# 5  
Old 08-25-2009
Sorry for not replying sooner, here is something a bit like what you were after:
Code:
$ cat ./curl.ksh
URL=$1
if [ -z "${URL}" ]; then
  echo "Usage: $0 URL"
  exit 99
fi
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "+URL +lookuptime +time_connect +time_toal +"
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo -n "$1 +"
curl -s -w '%{time_namelookup} %{time_connect} %{time_total}\n' -k -L $1 -o /dev/dull  | sed -e 's/ / + /g'
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
$

Here is a sample run:
Code:
$ ./curl.ksh
Usage: ./curl.ksh URL
$ ./curl.ksh http://news.bbc.co.uk
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+URL +lookuptime +time_connect +time_toal +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
http://news.bbc.co.uk +0.040 + 0.077 + 0.136
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Curl and write custom result to file

I have the following script, for i in $(cat MyWebApps); do curl -u manager:tH1s1s4f3k3p4ssw0Rd http://10.10.10.10:7529/manager/jmxproxy/"?get=Catalina:type=Manager,context=/$i,host=localhost&att=activeSessions"; done Which gives me an output like this OK - Attribute get... (12 Replies)
Discussion started by: charli1
12 Replies

2. Shell Programming and Scripting

Convert shell script output txt file to html table

My concnern related to the post -Convert shell script output txt file to html table, in this how to print the heading as color. awk 'BEGIN{print "<table>"} {print "<tr>";for(i=1;i<=NF;i++)print "<td>" $i"</td>";print "</tr>"} END{print "</table>"}' <filename> (8 Replies)
Discussion started by: sarajobmai
8 Replies

3. Shell Programming and Scripting

Script to generate HTML output format listing like orasnap

Hi, Is there any UNIX scripts out there that generates a listing output of some sort similar to OraSnap At the moment, I have a script that I run on multiple servers that has multiple databases and just querying the database sizes of those databases. It generates a text files that contains... (0 Replies)
Discussion started by: newbie_01
0 Replies

4. Shell Programming and Scripting

Script To Generate HTML output

Hello All, I need help here with a script. I have a script here which generates a html output with set of commands and is working fine. Now i want to add a new command/function which would run on all the remote blades and output should be included in this html file. Here is the script ... (2 Replies)
Discussion started by: Siddheshk
2 Replies

5. Shell Programming and Scripting

Grabbin a html code from a page (Var = Curl)

Hi there. Im not very good on shell yet. This line, will print me YES or NO in console. Its the HTML code returned from the website, simply YES or NO curl -L "http://www.thewebsite.net/auth/log.jsp?user=$user&sessionId=$sid&serverId=$hash" How could i save this into a variable, so i... (1 Reply)
Discussion started by: Ziden
1 Replies

6. Shell Programming and Scripting

shell script output in HTML or with table like results

Hello, Currently i have a ksh script which will disply the results in plain text format. I want to format the result in more readable format like Making bold headings and format with colors etc. Something like html or excel format and send that content as email. Please help me how i can do... (2 Replies)
Discussion started by: kotasateesh
2 Replies

7. Shell Programming and Scripting

Curl getting html tags

I am making a script in which i wana use curl to download a web page and check status.But problem is when i use curl in linux command line it downlaod htlm tags.How can we ignore these tage any idea. (2 Replies)
Discussion started by: aliahsan81
2 Replies

8. Shell Programming and Scripting

have a shell script done in pl/sql and want output in html

I have this shell script where I have both pl/sql and sql. But want to have a snigle output file where the result of each cursors are in HTML tables. I was able to do that on my old script but it was only sql scripts (no pl/sql). Can I do have such outputs now with my new script where I... (2 Replies)
Discussion started by: arobert
2 Replies

9. Shell Programming and Scripting

awk script to search an html file and output links

hello. i want to make an awk script to search an html file and output all the links (e.g .html, .htm, .jpg, .doc, .pdf, etc..) inside it. also, i want the links that will be output to be split into 3 groups (separated by an empty line), the first group with links to other webpages (.html .htm etc),... (8 Replies)
Discussion started by: kyris
8 Replies

10. Shell Programming and Scripting

save the HTML result

Hi all, I am displaying my result in HTML format using tables. I want to save the results in file in the same format along with the table only. How do i do that in perl? I have attached the table structure . I want to save like that itself . with regards (2 Replies)
Discussion started by: vanitham
2 Replies
Login or Register to Ask a Question