Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Pulling Information from Another Site
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

mafifi
Junior Member

USA
308 Posts

Posted - 02 August 2001 :  19:31:37  Show Profile  Send mafifi an ICQ Message
OK folks. The following is a ColdFusion Code that pulls information from one page and posts it into another. How can you do that in ASP? Please do not get confused with CF stuff in the code. It stands for ColdFusion
quote:

<html>
<head>
<title>xxxxxxxxxxxxxxx</title>

<table border="0">
<tr>
<td>
<CFHTTP URL="http://www.your_site.com/sample/default.html" METHOD="GET">
</CFHTTP>
<CFSET Count=FindNoCase("</font>",CFHTTP.FILECONTENT)+7>
<CFSET Count2=FindNoCase("</body>",CFHTTP.FILECONTENT)>
<CFSET COUNT2 = count2-count>
<CFSET Page=Mid(CFHTTP.FILECONTENT, count, COUNT2)>

<CFOUTPUT>
#Page#
</CFOUTPUT>



Thanks,

Mo

mafifi
Junior Member

USA
308 Posts

Posted - 06 August 2001 :  20:22:03  Show Profile  Send mafifi an ICQ Message
Here is what it means. Is there any similar code in ASP.

quote:

The first cfset <cfset count=
Looks for the first instance of the tag </font> in the html of the file you got. Then it returns the position value of that tag plus 7. So it finds the position directly after the first </font> tag.
The second cfset <cfset count2=
is the same, but it looks for the </body> tag.
And finally the <cfset page=
returns the number of characters between the end of the </font> tag and the </body> tag.





Thanks,

Mo
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 06 August 2001 :  21:30:01  Show Profile
You would need to have an ASP Component such as ASPTear installed to do that.
Go to Top of Page

mrWize
deleted

119 Posts

Posted - 07 August 2001 :  02:34:11  Show Profile
He, He ... no, You don+t need a component installed, just MS-XML

<%
Set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objHTTP.Open "GET", "http://www.domain-to-get.com/", False
objHTTP.Send
strHTML=objHTTP.responseText
Set objHTTP = Nothing
%>

In the variable strHTML is the page/url you requested stored.

cya,
PatrikB



Edited by - mrwize on 07 August 2001 02:34:50
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 07 August 2001 :  11:13:50  Show Profile
MSXML IS a component, and won't exist on servers without IE5+ installed.


======
Doug G
======
Go to Top of Page

Martha2Mary
Junior Member

New Zealand
250 Posts

Posted - 07 August 2001 :  16:34:05  Show Profile  Visit Martha2Mary's Homepage  Send Martha2Mary an AOL message  Send Martha2Mary an ICQ Message  Send Martha2Mary a Yahoo! Message
quote:

He, He ... no, You don+t need a component installed, just MS-XML

<%
Set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objHTTP.Open "GET", "http://www.domain-to-get.com/", False
objHTTP.Send
strHTML=objHTTP.responseText
Set objHTTP = Nothing
%>

In the variable strHTML is the page/url you requested stored.




This is something that I also wanted to implement on my website, but I had difficulties as the page I wanted to 'get' was one that redirected the User depending on the date, which was determined via Javascript on the 'get' page. Sooooo, I don't suppose you would know how I can modify the code above to allow for this, do you? Many thanks!

*If Knowledge is Power, and Power Corrupts, what hope is there for Mankind *
Go to Top of Page

mrWize
deleted

119 Posts

Posted - 07 August 2001 :  17:32:38  Show Profile
No, I don´t ...

If You can get the javascript function You can also decide wich page to get.

quote:

MSXML IS a component, and won't exist on servers without IE5+ installed.



So is ASP, ADODB, SERVER, REQUEST, RESPONSE too.

What I ment is that not a third-party component has to be used

cya,
PatrikB a.k.a mrwize - http://www.mrwize.nu
Go to Top of Page

mafifi
Junior Member

USA
308 Posts

Posted - 08 August 2001 :  12:56:21  Show Profile  Send mafifi an ICQ Message
mrWize,

I installed IE 5.5 on my server and used your code as provided except that I put the correct URL but no results are coming back. Any ideas where I went wrong.
quote:

<%
Set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objHTTP.Open "GET", "http://MY_SYSTEM/article1.html", False
objHTTP.Send
strHTML=objHTTP.responseText
Set objHTTP = Nothing
%>






Thanks,

Mo

Edited by - mafifi on 08 August 2001 12:56:57
Go to Top of Page

Martha2Mary
Junior Member

New Zealand
250 Posts

Posted - 08 August 2001 :  16:47:10  Show Profile  Visit Martha2Mary's Homepage  Send Martha2Mary an AOL message  Send Martha2Mary an ICQ Message  Send Martha2Mary a Yahoo! Message
Try this code, which seems to work for me:

<%
Response.Buffer = True
Dim objXMLHTTP, xml
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "GET", "http://url_to_get_here", False
xml.Send
Response.Write xml.responseText
Set xml = Nothing
%>

Hope this helps.....

*If Knowledge is Power, and Power Corrupts, what hope is there for Mankind *
Go to Top of Page

mrWize
deleted

119 Posts

Posted - 09 August 2001 :  10:55:16  Show Profile

<%
Set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objHTTP.Open "GET", "http://MY_SYSTEM/article1.html", False
objHTTP.Send
strHTML=objHTTP.responseText
Set objHTTP = Nothing

Response.Write strHTML
%>


The whole page is stored in the variable - strHTML.
Just search through it, print it out or whatever You like to do whit the content.

cya,
PatrikB a.k.a mrWize


Go to Top of Page

Spoon
Average Member

Ireland
507 Posts

Posted - 09 August 2001 :  12:04:37  Show Profile  Visit Spoon's Homepage  Send Spoon an ICQ Message
It is possible to stream code from a file on another website.

Regards - Spoon

Begineer? Need help installing the forums? - www.aslickpage.com/snitz_help.html

www.ASlickPage.com - Private Messaging
Go to Top of Page

mafifi
Junior Member

USA
308 Posts

Posted - 10 August 2001 :  17:51:48  Show Profile  Send mafifi an ICQ Message
quote:
It is possible to stream code from a file on another website.

I'm not sure what you mean, could you please elaborate.

I tried the code by mrWize and Martha2Mary and it works fine, but can you return certain parts of the page and not the whole thing similar to the ColdFusion example?


Thanks,

Mo
Go to Top of Page

Martha2Mary
Junior Member

New Zealand
250 Posts

Posted - 10 August 2001 :  19:23:09  Show Profile  Visit Martha2Mary's Homepage  Send Martha2Mary an AOL message  Send Martha2Mary an ICQ Message  Send Martha2Mary a Yahoo! Message
Hi Mo,

Not sure if this will be of any help to you, but it looks like it goes into what you are looking for:

http://www.planet-source-code.com/xq/ASP/txtCodeId.6123/lngWId.4/qx/vb/scripts/ShowCode.htm

*If Knowledge is Power, and Power Corrupts, what hope is there for Mankind *
Go to Top of Page

mafifi
Junior Member

USA
308 Posts

Posted - 10 August 2001 :  20:02:11  Show Profile  Send mafifi an ICQ Message
quote:
Not sure if this will be of any help to you, but it looks like it goes into what you are looking for:

http://www.planet-source-code.com/xq/ASP/txtCodeId.6123/lngWId.4/qx/vb/scripts/ShowCode.htm



Thanks. That's exactly what I was looking for.

Thanks,

Mo
Go to Top of Page

mafifi
Junior Member

USA
308 Posts

Posted - 10 August 2001 :  21:03:18  Show Profile  Send mafifi an ICQ Message
What is

 Set inet = Server.CreateObject("InetCtls.Inet")


See this link http://www.planet-source-code.com/xq/ASP/txtCodeId.6123/lngWId.4/qx/vb/scripts/ShowCode.htm

Thanks,

Mo
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 10 August 2001 :  22:53:38  Show Profile
InetCtls.Inet is the Program ID for an ActiveX control "Microsoft Internet Transfer Control 6.0", found in the file MSInet.ocx

This control ships with Visual Basic, Visual FoxPro and Microsoft Office Developer, and is redistributable by developers.

There is no guarantee it will exist on a given web server, as far as I know the control isn't part of IIS/NT/2K.

You can find info on this control in the MSDN library at msdn.microsoft.com/library (I think this is the URL, MS recently redid their site).



======
Doug G
======
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.32 seconds. Powered By: Snitz Forums 2000 Version 3.4.07