1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.
  2. Better Analytics for WordPress Get It Free

how to put RSS feed on html pages

Discussion in 'HTML & Website Design' started by westhaven, Apr 22, 2005.

  1. #1
    how to put RSS feed on html pages
    and how does it work
     
    westhaven, Apr 22, 2005 IP
  2. ServerUnion

    ServerUnion Peon

    Messages:
    3,615
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can place them using javascript, this will not be picked up by the search engines though. You may also add code to your .htaccess that will tell the server to parse HTML in the PHP engine.

    Good luck
     
    ServerUnion, Apr 22, 2005 IP
  3. noppid

    noppid gunnin' for the quota

    Messages:
    4,247
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #3
    Get Carp and use htaccess to parse php in the html file.
     
    noppid, Apr 22, 2005 IP
  4. DangerMouse

    DangerMouse Peon

    Messages:
    275
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    DangerMouse, Apr 22, 2005 IP
  5. noppid

    noppid gunnin' for the quota

    Messages:
    4,247
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #5

    I have said it before and I'll say it again. That app is crap and should not be used in any way shape or form.

    It is not RFC compliant and causes internet pollution.

    I'm sorry I'm so harsh, but RSS aggregators that are RFC compliant are a dime a dozen.

    Google RSS and get one of the dozens that are RFC compliant and run a proper website. In fact, get Carp.
     
    noppid, Apr 22, 2005 IP
  6. Diamondbacks

    Diamondbacks Peon

    Messages:
    107
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Can you elaborate?
     
    Diamondbacks, Apr 22, 2005 IP
  7. noppid

    noppid gunnin' for the quota

    Messages:
    4,247
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #7
    I have in many places. Just look up the RFC.

    RSS SHOULD cache at least one hour.

    RSS should NOT use open(), fopen() or, file_get_contents().

    Those are just two to start, however the most important.
     
    noppid, Apr 22, 2005 IP
  8. nfzgrld

    nfzgrld Peon

    Messages:
    524
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I've tried carp, and I have to say I was disapointed with the results. I ended up with little diamonds with questions marks in them where apostrphies should have been. I'm willing to accept that I scewed up somewhere, probably a unicode problem or something, but I couldn't figure out what was causing it. As far as I'm concerned it's about parsing a file. How you do it pretty much irrelevant to me. What's important is getting the results you want on the page.
     
    nfzgrld, Apr 22, 2005 IP
  9. DangerMouse

    DangerMouse Peon

    Messages:
    275
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Why does it matter whether it's RFC compliant? Come to that - what the f**k is RFC? (Request For Comments???) Why should I worry about it? Does it work? Yes. Is it easy to install? Yes. Anythign else? No. :p
     
    DangerMouse, Apr 22, 2005 IP
  10. noppid

    noppid gunnin' for the quota

    Messages:
    4,247
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #10

    Well you see, you have two problems here, first you admit you can't operate the program, you failed not carp. Carp is very powerful and works perfectly. I have taught more then one non-coder to use it.

    You're success can be measured by your effort, in this case you obviuosly made no effort to read the documentation. I'll admit it's hard to follow at first, but API's are that way.

    Secondly, you are dead wrong saying it's about parsing a file. That is the last step and is the least important.

    What is important is the communication between your server and the RSS feed server and the client connection.

    You are dead wrong and people like you that refuse to learn the right way to do something should go into another business because you make me look bad.
     
    noppid, Apr 22, 2005 IP
    SEbasic likes this.
  11. DangerMouse

    DangerMouse Peon

    Messages:
    275
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #11
    bollocks!

    you're success can only be measured by your success
     
    DangerMouse, Apr 22, 2005 IP
  12. noppid

    noppid gunnin' for the quota

    Messages:
    4,247
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #12
    Basically what the little app is, is a DDOS tool. It hits the RSS for every hit to your site. That's just wrong. PERIOD.


    So I just coded a little app too and it's going to pull a copy of your home page to my site just for the sake of doing it. I have no intention of using it, but it's public and I can pull it. You be be getting a hit for every hit I get that is useless because the data probably will not have changed.

    Talk to me in a month and see how cool that is if this RSS app is ok.
     
    noppid, Apr 22, 2005 IP
  13. noppid

    noppid gunnin' for the quota

    Messages:
    4,247
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #13
    Do you have anything to contribute at a professional coding level that is fact? I'm quoting public records that are verifable, however, you can look it up yourself.

    I'm not here to play cutzie with a smart ass that thinks he's articulate.

    Get a grip man, be a professional, not a sheep.
     
    noppid, Apr 22, 2005 IP
  14. DangerMouse

    DangerMouse Peon

    Messages:
    275
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #14
    I'm not here playing cutsie either nobbip... ;)

    Success can be measured in any number of ways - if you want to base your own on how hard you tried - go right ahead but don't expect to be rewarded unless you ended up with something good at the end of it. (not when you've left school at least)

    WTF? ok
     
    DangerMouse, Apr 22, 2005 IP
  15. westhaven

    westhaven Well-Known Member

    Messages:
    3,943
    Likes Received:
    453
    Best Answers:
    0
    Trophy Points:
    195
    #15
    i have seen the url u have given but where to put this code i mean how this is done see i don know much about Putting RSS in html files ..can you guide me

     
    westhaven, Apr 22, 2005 IP
  16. noppid

    noppid gunnin' for the quota

    Messages:
    4,247
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #16
    I mean, why the hell are we taking about how big my dick is?

    This is about doing something right or wrong is all. Let's not get off on a tangent. I really don't care if you like the answer, it's the truth. In fact I told a gentleman with a PHD the same exact thing yesterday and got no arguement from him what so ever. He admitted his program had to be removed because it was bringing his servers to thier knees.

    There is no need to re-invent the wheel. Free REAL RSS is a dime a dozen. Carp is not the only choice.

    RTFM before you play with other people's free services when they provide the privledge. If you don't, one day they will go away.

    How would that serve us?
     
    noppid, Apr 22, 2005 IP
  17. DangerMouse

    DangerMouse Peon

    Messages:
    275
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #17
    OK, sorry noppid I digress... Mind if I take this?

    If you've got PHP enabled / installed on your server... you can use YSF1's fine example ;)
    http://forums.digitalpoint.com/showthread.php?t=7354 - just stick this code into you html page where you want teh news to appear...

    If you don't (have PHP) you'll have to use a javascript... am looking for an example of this now...
    
    <script language="JavaScript">
    //////////////////////////////////////////////////
    //	<JavaScript RSS Reader>			//
    // 	(c) 2003 Premshree Pillai		//
    //	Written on: 07/06/03 (dd/mm/yy)		//
    //	http://www.qiksearch.com/		//
    //////////////////////////////////////////////////
    
    function readRSS(URI) {
    	if(window.ActiveXObject) {
    		var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    		xmlDoc.async=false;
    		while(xmlDoc.readyState!=4) document.write('Loading...');
    	}
    	else if(document.implementation&&document.implementation.createDocument)
    		xmlDoc=document.implementation.createDocument("","doc",null);
    	xmlDoc.load(URI);
    	items=xmlDoc;
    
    	function verify() {if(xmlDoc.readyState!=4) return false;}
    
    	function formatRSS() {
    		var items_count=items.getElementsByTagName('item').length;
    		var pubDate=new Array(), date=new Array, link=new Array(), title=new Array(), description=new Array(), guid=new Array();
    
    		for(var i=0; i<items_count; i++) {
    			if(items.getElementsByTagName('item')[i].getElementsByTagName('pubDate').length==1)
    				pubDate[i]=items.getElementsByTagName('item')[i].getElementsByTagName('pubDate')[0];
    			if(items.getElementsByTagName('item')[i].getElementsByTagName('dc:date').length==1)
    				date[i]=items.getElementsByTagName('item')[i].getElementsByTagName('dc:date')[0];
    			if(items.getElementsByTagName('item')[i].getElementsByTagName('link').length==1)
    				link[i]=items.getElementsByTagName('item')[i].getElementsByTagName('link')[0];
    			if(items.getElementsByTagName('item')[i].getElementsByTagName('guid').length==1)
    				guid[i]=items.getElementsByTagName('item')[i].getElementsByTagName('guid')[0];
    			if(items.getElementsByTagName('item')[i].getElementsByTagName('title').length==1)
    				title[i]=items.getElementsByTagName('item')[i].getElementsByTagName('title')[0];
    			if(items.getElementsByTagName('item')[i].getElementsByTagName('description').length==1)
    				description[i]=items.getElementsByTagName('item')[i].getElementsByTagName('description')[0];
    		}
    
    		if((description.length==0)&&(title.length==0)) return false;
    
    		document.write('<html><head><title>'+xmlDoc.getElementsByTagName('title')[0].firstChild.nodeValue+'</title></head><body>');
    		document.write('<span style="font-family:verdana,arial,helvetica; font-size:8pt">');
    		document.write('<center><a href="rss-reader.htm"><h3>[Go Back]</h3></a></center>');
    		document.write('<center><a href="'+xmlDoc.getElementsByTagName('link')[0].firstChild.nodeValue+'"><h2>'+xmlDoc.getElementsByTagName('description')[0].firstChild.nodeValue+'</h2></a></center>');
    		var ws=/\S/;
    
    		for(var i=0; i<items_count; i++) {
    			var pubDate_w, title_w, link_w;
    			pubDate_w=(pubDate.length>0)?pubDate[i].firstChild.nodeValue:"<i>Date NA</i>";
    			if(document.all)
    				title_w=(title.length>0)?title[i].text:"<i>Untitled</i>";
    			else
    				title_w=(title.length>0)?title[i].firstChild.nodeValue:"<i>Untitled</i>";
    
    			link_w=(link.length>0)?link[i].firstChild.nodeValue:"";
    			if(link.length==0) link_w=(guid.length>0)?guid[i].firstChild.nodeValue:"";
    			if(title.length>0) title_w=(!ws.test(title_w))?"<i>Untitled</i>":title_w;
    			if(pubDate.length==0) pubDate_w=(date.length>0)?date[i].firstChild.nodeValue:"<i>Date NA</i>";
    			document.write('<a href="'+link_w+'"><b>'+title_w+'</b></a> <b>['+pubDate_w+']</b><br>');
    			if(description.length>0)
    				document.write('<font size="-1">'+description[i].firstChild.nodeValue+'</font><hr noshade><br>');
    		}
    		document.write('</span></body></html>');
    	}
    
    	if(typeof(xmlDoc)!="undefined") {
    		if(window.ActiveXObject) formatRSS();
    		else xmlDoc.onload=formatRSS;
    	}
    }
    
    function checkString() {
    	var loc=document.location.href.split("?")
    	if(loc.length>1) {
    		URI=loc[1].split("=");
    		if(URI.length>1) {
    			var retURI="";
    			for(var i=1; i<URI.length; i++) retURI+=URI[i];
    			try {readRSS(unescape(retURI));}
    			catch(e) {}
    		}
    	}
    }
    </script>
    
    Code (markup):
     
    DangerMouse, Apr 22, 2005 IP
  18. noppid

    noppid gunnin' for the quota

    Messages:
    4,247
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #18

    This is a classic example of the blind leading the blind.

    You have no qulaifications to recomend this software and the author has no qualifcations to have written it.

    What a bunch of morons.
     
    noppid, Apr 22, 2005 IP
  19. DangerMouse

    DangerMouse Peon

    Messages:
    275
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #19
    I'm not... please take some time, calm down and re-read teh post
     
    DangerMouse, Apr 22, 2005 IP
  20. DangerMouse

    DangerMouse Peon

    Messages:
    275
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #20
    qulaifications i can do without (LOL)
     
    DangerMouse, Apr 22, 2005 IP