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.

Adding an RSS/XML feed

Discussion in 'Programming' started by schlottke, Apr 13, 2004.

  1. #1
    If I wanted to have a blank page that simply brought this link into it:

    http://newstrove.com/cgi-bin/RSS.XM...ults=100&publisher_rank=0&quality_filter=BEST

    <?php
    //this is your newsfeed , you can use any rss file here
    $xmlfile = fopen("http://newstrove.com/cgi-bin/RSS.XML?search=college+wrestling&title=wrestling%20news&max_results=100&publisher_rank=0&quality_filter=BEST", "r");
    //if file doesnt exist , quit
    if(!$xmlfile)die("cannot open the xml file");
    //read in 40000 bytes of the $xmlfile
    $readfile = fread($xmlfile ,40000);
    //search for the
    $searchfile = eregi("<item>(.*)</item>", $readfile ,$arrayreg);
    $filechunks = explode("<item>", $arrayreg[0]);
    $count = count($filechunks);
    //build our table
    echo "<table border='1'>";
    //display our heading
    echo "<th colspan='2'>latest news</th>";
    for($i=1 ; $i<=$count-1 ;$i++)
    {
    ereg("<title>(.*)</title>",$filechunks[$i], $title);
    ereg("<link>(.*)</link>",$filechunks[$i], $links);
    echo "<tr><td>";
    //display all the titles
    echo $title[1];
    echo "</td><td>";
    //display all the links
    echo "<a href ='$links[1]'\>$links[1]</a>";
    echo "</td></tr>";
    }
    echo "</table>";
    ?>

    Would this be the best way to do it?
    SEMrush
     
    schlottke, Apr 13, 2004 IP
    SEMrush
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,284
    Likes Received:
    2,600
    Best Answers:
    460
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    No formatting or anything?

    - Shawn
     
    digitalpoint, Apr 13, 2004 IP
  3. schlottke

    schlottke Peon

    Messages:
    2,185
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It is loading about 75 articles and takes forever to load right now.. I can't seem to find a way for it to speed up, my question was just if this was the quickest way to get from point A (XML) to point b (html)
     
    schlottke, Apr 13, 2004 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,284
    Likes Received:
    2,600
    Best Answers:
    460
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    Well an RSS feed you would want to save to a file once every so often (like every 30 minutes or something). Otherwise it will be slow and put a strain on the server you are getting it from.

    - Shawn
     
    digitalpoint, Apr 13, 2004 IP
  5. rhastman

    rhastman Peon

    Messages:
    10
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Is there a way in ASP to automate that? (saving the RSS feed results into an HTML page)

    Thanks
     
    rhastman, Apr 13, 2004 IP
  6. rfuess

    rfuess Guest

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You could use an XSL style sheet in ASP (or ASP.Net) to translate it. There would be a simpler script to call the translation onto the feed.

    If this interests you, let me know and I will work out an initial XSL and the ASP script. (I should get a reply to this, or email me at ) I will put the reply here.

    If you are interested in asp, which flavor do you prefer, the older VB asp, or ASP.net? If ASP.net, do you prefer VB.Net or C#?
     
    rfuess, Jun 15, 2004 IP
  7. rfuess

    rfuess Guest

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Saving the file is a viable option, especially if you plan on storing it later for archive or auditing purposes. If you don't need any of the old ones, you could also have an XML web service that is cached every 30 minutes or so get the data. (I could do that if you like ASP.Net)

    That way you wouldn't have to clean up old files on the server, not that it takes much coding to do so.

    Lots of ways to skin the cat.

    Tell me what you want.
     
    rfuess, Jun 15, 2004 IP
  8. Nitin M

    Nitin M White/Gray/Black Hat

    Messages:
    640
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #8
    You may already be aware, but in case not ... a warning on RSS feeds...

    They really suck the PR out of the page you are putting it on. Make sure you think it really is of great value to your web visitors because it drains PR and can drain traffic away as well.

    I have seen people put RSS feeds on their homepage and their PR, SERPS, and Page Views all take a nasty beating.

    Sometime people think "cool - easy free content to make my site look bigger", but the price you pay for it is HUGE. Just food for thought.
     
    Nitin M, Jun 18, 2004 IP
  9. Atlanta Realtor

    Atlanta Realtor Peon

    Messages:
    78
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Why has this site done so well with it then www.atlantanation.com/
     
    Atlanta Realtor, Jun 20, 2004 IP
  10. Nitin M

    Nitin M White/Gray/Black Hat

    Messages:
    640
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #10
    What is going on with the XXXXnation.com sites is a whole different ball of wax.

    You know it is likely hundreds of sites, right?

    www . cherokeenation.net
    www . cobbonline.com
    www . cincynation.com
    www . dallasnation.com
    www . floridanation.com

    The list just keeps going, and going, and going.

    The reasons for their "success" have nothing to do with the RSS feed. That is just a convenient and easy way to make the site look like it actually has content.

    On a "real" website, esp. when put on the homepage, you are funnelling huge amounts of PR out to the destination links.

    There are several network sites we are competing with and the "nation" sites, and the areaguides are the most obtrusive. Search on "Find a Realtor" dislpaying 100 at a time and results 80-1000 are 90% from these sites. Of course, their main targets are <city name> real estate, <state> realtor, etc.

    Do us all a favor and fill out a google report on them all --- hopefully with enough reports, google will take action!

    <EDIT>
    Now, based on what is happening with the forums pages ranking so high and because we know blogs always have high SERPs, I will say it is entirely possible that site freshness not only impacts how frequently the google spider visits, but potentially it also gives added weight to SERP's.

    <sigh> Yet more testing to do.
     
    Nitin M, Jun 20, 2004 IP
  11. whiterabbit

    whiterabbit Guest

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Last year I found a fabulous asp script from sofotex that works with just about any rss feed, unfortunately, I can't post the url or the code here (not til' I've made another few posts)

    I've got it sitting on a site, so pm me for its (highly secret;)location)

    Server Requirements:
    XMLDOM
    FSO
    Folder write permission (anonymous) for storing the cached xml
    ASP 2 or greater

    It won't work without all of the above!

    Tony
     
    whiterabbit, Jun 22, 2004 IP
  12. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,284
    Likes Received:
    2,600
    Best Answers:
    460
    Trophy Points:
    710
    Digital Goods:
    29
    #12
    There actually is not anything preventing you from posting code or the URL.
     
    digitalpoint, Jun 22, 2004 IP
  13. whiterabbit

    whiterabbit Guest

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    The following errors occurred when this message was submitted:
    1. Live links and signatures are not available until you have 10 total posts.


    Tony
     
    whiterabbit, Jun 22, 2004 IP
  14. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,284
    Likes Received:
    2,600
    Best Answers:
    460
    Trophy Points:
    710
    Digital Goods:
    29
    #14
    You can use links, just not live links (ones that are clickable).
     
    digitalpoint, Jun 22, 2004 IP
  15. Geir

    Geir Berserker

    Messages:
    208
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Even if you just type in the URL, it will become a live link. However, once you get the warning you can delete the tags around the URL and submit the post, and the URL will be posted (but not clickable).

    :) Geir
     
    Geir, Jun 22, 2004 IP
  16. whiterabbit

    whiterabbit Guest

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    OK, Thanks, still getting my head around vBulletin

    Server Requirements:
    XMLDOM
    FSO
    ASP 2 or greater
    Anonymous write permission on one folder to store the xml file

    http://www.exogenetic.com/newsfeed.htm

    The code isn't mine, I just use it mercilessly :D

    Any problems and I'll do my best to help

    Tony
     
    whiterabbit, Jun 22, 2004 IP
  17. TwisterMc

    TwisterMc Mac Guru

    Messages:
    972
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #17
    So did anyone figure out an easy way to add an RSS feed? What I want to do is pull the top 5 posts off my bloger.com blog and show them on my home page as headline links. Shouldn't be that hard... or is it?
     
    TwisterMc, Jul 7, 2004 IP
  18. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,284
    Likes Received:
    2,600
    Best Answers:
    460
    Trophy Points:
    710
    Digital Goods:
    29
    #18
    I think Blogger has an option to build an RSS feed automatically, doesn't it?
     
    digitalpoint, Jul 7, 2004 IP
  19. TwisterMc

    TwisterMc Mac Guru

    Messages:
    972
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #19
    Yep got that. now how do i get the top 5 on my home page? :)
     
    TwisterMc, Jul 7, 2004 IP
  20. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,284
    Likes Received:
    2,600
    Best Answers:
    460
    Trophy Points:
    710
    Digital Goods:
    29
    #20
    Well you would need to do a little coding... check hotscripts.com for lots of RSS feed readers/formatters.
     
    digitalpoint, Jul 7, 2004 IP