Print Page | Close Window

MSNBC or another site news.....

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=349
Printed Date: 29 March 2026 at 3:39am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: MSNBC or another site news.....
Posted By: skyworld
Subject: MSNBC or another site news.....
Date Posted: 20 February 2003 at 8:59am
is there a script out or code snippet for getting news from another site to put on yours? It would be cool to have world news on my site with out having to keep updating every 10 minutes...



Replies:
Posted By: Mart
Date Posted: 20 February 2003 at 10:27am

You could use the xmlhttp componant if you tell me which site I will help you make a script.



Posted By: faubo
Date Posted: 20 February 2003 at 1:51pm

Search the word RSS in google,

and take a look in this site:

http://www.newsisfree.com - www.newsisfree.com

I will implement a RSS on my news and events based on my asp db as soon as I get some extra time

 



-------------
http://www.conhecerparaconservar.org - I don't know how to make you click here


Posted By: skyworld
Date Posted: 20 February 2003 at 4:27pm

from msnbc.com

TOP NEWS STORIES
http://msnbc.com/news/874197.asp?0cv=CB10 -
• ‘Many hurdles’ after teen’s transplant
http://msnbc.com/news/850567.asp?0cv=CB10 -
• N. Korean plane intrudes into South
http://msnbc.com/news/875068.asp?0cv=CB10 -
• U.S. trade deficit hit record in 2002
 
thats whats there right now ...


Posted By: MorningZ
Date Posted: 20 February 2003 at 4:59pm
man o man....

theres a word to apply here: "babysteps"

you want to have something like this and don't even know about "Request.QueryString" ?

yikes... i hope all this stuff is for fun.....

neverless for that reality check.. the following code will grab what you want

<%@ Language=VBScript %>
<% Response.Expires = -1 %>
<% Response.Buffer = True %>
<%
StartDomain = "http://www.msnbc.com/"
StartPage = "news/default.asp?cp1=1"
StartURL = StartDomain & StartPage

Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")
xml.Open "GET", StartURL, False
xml.Send
strHTML = xml.ResponseText
Set xml = Nothing
Dim objRegExp, objMatch, objMatches
Set objRegExp = New RegExp

objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<a href=(.*?)\.asp\?0cv=CB10>(.*?)</a>"
Set objMatches = objRegExp.Execute(strHTML)

Response.Write("<font size=""1"" face=""verdana"">")
For Each objMatch in objMatches
     thisLink = Replace(objMatch, "<a href=", "<a href=" & StartDomain & "news/" )
     Response.Write( thisLink )
Next
Response.Write("</font>")
Set objMatch = Nothing
Set objRegExp = Nothing
%>


-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: skyworld
Date Posted: 20 February 2003 at 5:13pm
 

Server object error 'ASP 0177 : 800401f3'

Server.CreateObject Failed

/index.asp, line 9

Invalid class string



Posted By: MorningZ
Date Posted: 20 February 2003 at 5:38pm
you're on your own bucko... the code works 100% ( http://www.morningz.com/test/grab_msn.asp - as shown )

perhaps you dont have the latest XML components installed on whatever you use for a web server

-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: WebWiz-Bruce
Date Posted: 20 February 2003 at 5:44pm

The error does mean that the compoent is not installed on the web server.

The MSXML component insatll with Internet Explorer 5 and above, get you web host to update there server, or they may have removed the component for security reasons as there are some security issues with the XMLHTTP component.



-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: skyworld
Date Posted: 20 February 2003 at 6:33pm

Is there another way to do it because my uncle might not have it on his server then if it has security issues........



my uncle is hosting my site with his server...



Posted By: MorningZ
Date Posted: 12 March 2003 at 9:10am
i know this is an old thread, but for anyone that was interested in pulling (or providing) "news feeds", check out http://www.4guysfromrolla.com/webtech/031303-1.shtml - this 4guys article that was posted today...

good stuff

-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: Bunce
Date Posted: 12 March 2003 at 3:30pm

Ahh, so thats the RSS stuff that the guy from this site ( http://www.coveryourasp.com - http://www.coveryourasp.com ) was going on about a few years ago. http://asprss.com/ - http://asprss.com/

Cool.



-------------
There have been many, many posts made throughout the world...
This was one of them.


Posted By: jack
Date Posted: 21 April 2003 at 12:54pm
Great script, just wan't handling the red subheadings placed in the middle. I changed it up a bit to just exclude these, code below.

edit to remove red subheadings.

objRegExp.Pattern = "<a href=(.*?)\.asp\?0cv=CB10>(.*?)</a>"

Change this line to look like:

objRegExp.Pattern = "<a href=(.*?)\.asp\?0cv=CB10><div class=csd>(.*?)</a>"

-jack


Posted By: jack
Date Posted: 22 April 2003 at 11:39am
I made a cnn one too if anyone is interested.

credit goes to morningz for original code though, of course. I simply modified it to use cnn instead of msnbc.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net