Solved

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

Posted on 2006-11-13
10
828 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
Comment Utility
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
Comment Utility
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
Comment Utility
Seems VBScript is the language of choice

http://www.google.com/search?q=vbscript+http+get
0
 
LVL 5

Expert Comment

by:mrneilbarton
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:Timmmo
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks PashaMod
0
 
LVL 28

Expert Comment

by:FishMonger
Comment Utility
The "B" grade is fine with me, thanks.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now