Solved

How do i return text through http without viewing the contents in a browser window?

Posted on 2006-11-13
10
850 Views
Last Modified: 2011-09-20
Hi,

Is it feasible to extract text from an http url without actually opening it in a browser?


For example,

http://%computername%:9495

In my environment, typing this address and port into IE 6 will display a status-report for a service / client running on that machine (for info, Tivoli Endpoint).

If we could 'pull' this information from a batch of machines in text-file format, we can create a VBScript file to query this information and produce a general report on the service-status for that client.

Any suggestions or advice would be greatly appreciated.

Regards.
0
Comment
Question by:Timmmo
10 Comments
 
LVL 28

Expert Comment

by:FishMonger
ID: 17931486
You didn't say which lanuage you want to use to do the file retrieval.  Here's a perl example that retieves this EE page and stores it in a file named Q_22058385.html.

#!/usr/bin/perl -w

use strict;
use LWP::Simple;

my $url = 'http://www.experts-exchange.com/Web/Web_Languages/Q_22058385.html';
getstore($url, 'Q_22058385.html');
0
 
LVL 28

Assisted Solution

by:FishMonger
FishMonger earned 250 total points
ID: 17931533
I left out the portion of looping through a list of url's because you weren't very clear on how that info is stored, looping over the contents of a file containing a of list of urls is very easy.
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 250 total points
ID: 17979471
Seems VBScript is the language of choice

http://www.google.com/search?q=vbscript+http+get
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 5

Expert Comment

by:mrneilbarton
ID: 18007730
An ASP example would be somethink like below:

<%
    url = "http://%computername%:9495
    set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")  

    xmlhttp.open "GET", url, false
    xmlhttp.send "" 
    thetxt = xmlhttp.responseText
%>

The above bit of script would  load it into the variable "thetxt" which you can publish into the page where ever you need it.
0
 

Author Comment

by:Timmmo
ID: 18020012
I chose mplungjan's answer because he correctly surmised Vbscript (although I did hint this was the language in the question). Secondly, mplungjan forced me to do some further investigation and the link was a good starting point.  Fishmonger also received points for the effort, although it was not exactly what I was looking for.

Thanks.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 18021085
1. My comment about vbscript was to FishMonger
2. I do not want a "C" grade for a comment. Either you could use the link or you could not. Great you solved the problem but a "C" grade is not acceptable to me.

I will ask for the question to be unaccepted so you can change the grade or leave my comment out of it.

Please look here: http://www.experts-exchange.com/help.jsp#hi73

Michel
0
 
LVL 28

Expert Comment

by:FishMonger
ID: 18021418
I agree with mplungjan, a “C” grade is unwarranted.  In this forum, a “C” grade is considered by most to be a “failing” grade.

My post showed how to retrieve a file from the web without opening the browser.  Your question gave no indication of which language you wanted for that portion of the problem.  Your hint at using Vbscript appeared to be for the processing and generating of a report from the file once it was retrieved.  Perl (Practical Extraction and Reporting Language) would be better suited for that processing, but I left that out because you wanted to go the Vbscript route for that portion.

You should have posted a follow up comment giving more details of what you wanted and why you were not satisfied with the proposed solutions.  Instead, you left us hanging for 2 weeks without posting anything.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 18028194
Thanks PashaMod
0
 
LVL 28

Expert Comment

by:FishMonger
ID: 18029410
The "B" grade is fine with me, thanks.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jquery validation by class 12 52
SP to delete duplicates 15 70
Problem to ToolkitScriptManager 2 60
Facebook React and SyntheticEvents 6 67
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question