How do I put a custom news feed on my site?

Discussion in 'Web Design and Development' started by stringtheorist, May 3, 2008.

  1. macrumors regular

    Apr 1, 2008
    I want a news column on my site (tailored to my site's interest group obviously) fed automatically from third party sources (ie. I won't be writing it myself). Many years ago I had a site with such a script on it that fed relevant news headlines to my frontpage. I can no longer find a similar product on the Web, although I know there's something called RSS which seems rather complicated to write. Is this what I need?
  2. macrumors 6502a

    Apr 7, 2006
    The RSS is something written by the third party site, you just need something to parse it.
  3. thread starter macrumors regular

    Apr 1, 2008
    How do I do that, and how do I find the content I need?
  4. Moderator emeritus


    Aug 16, 2005
    You'll just have to search for news sources. It all just depends on the type of news you're looking for. There's parsers for RSS written in various languages, whether you want to parse with JavaScript or PHP (among others).

    Parse RSS with PHP.

    Parse RSS with JavaScript.
  5. macrumors 6502a


    Sep 27, 2005
    Quebec, Canada
    I suggest you use CaRp. Google it and you will find it. It works perfectly and is very customizable with a table (or div) and CSS.
  6. thread starter macrumors regular

    Apr 1, 2008
    Thanks for the suggestion. I am trying to install CaRp right now but I have run into a problem and I can't see any contact details for support from the author. Maybe you could help?

    I am getting this error when I try access carpsetup.php from my webserver:

    "Checking your server's PHP function support...
    Warning: fsockopen() [function.fsockopen]: unable to connect to (Connection refused) in /home/fhlinux148/c/ on line 98

    This is what the read_me file has to say:
    "If you see a message about unsupported functions, that means that your web host has turned off support for functions which are necessary for CaRP to function. In that case, you will either need to contact your web host to see if they will re-enable those functions for you or install CaRP on a different server."

    So I contacted my webhost, and they say this:
    "It looks as though the database username and/or password is correct that you have provided in the script - it doesnt match the database,
    try changing the database password and updating the password in the script to correspond"

    Since I have not input any password at any stage (to my knowledge) I am at a loss as to how to proceed...:?

    Thanks in advance.
  7. thread starter macrumors regular

    Apr 1, 2008
    OK, just had this further correspondence from my webhost:

    "If you haven't created a databse then this is probably the reason.

    If the server doesn't support the fuctions you require then you would need a dedicated server not a shared server. We cannot help you with the scripting, however, if you are on a Linux server you should be able to use most funtions.

    Unfrotuantely we cannot help you much on this issue so will leave it up to your developer to resolve this issue. If he says the the server you are using does not support the functions he is trying to use then either the contents need to be changed or you need a dedicated server.

    Please also make sure you have enabled scripting on the domain as it is not set as default."

    Any thoughts...?
  8. macrumors member

    Apr 30, 2006
    I don't use CaRp so I can't offer any suggestions with that, but I use Zend framework to pull a RSS feed from google news and then with some JavaScript display it as a scrolling ticker on my site.

    You can check it out at:

    Also, if you decide to go this route I can offer more help and some example code if needed. :D
  9. macrumors 6502a


    Sep 27, 2005
    Quebec, Canada
    Are you on an apache server?

    I use CaRp with the folder cache, I don't use any database whatsoever.

    Since you still are at the setup process, try what I did:

    Put the files at the root of your website and than run carpsetup.php by opening

    Then, move it back to wherever you want it (preferably not accessable to the public) and tell carp where you put it when parsing RSS (you will see this after you installed, it's all explained).

    Sorry for lousy english, I have difficulties explaining stuff like that since I'm french.

    If this doesn't work, ask again and I'll try to help you. Don't abandon, CaRp sure is weird to install and make work but once it's installed, it's IMO the best RSS parsing script available. It's so customizable.

  10. thread starter macrumors regular

    Apr 1, 2008
    OK, omitting the directory '/carp/' in the address bar (otherwise I get an error), I now get this in carpsetup:

    Checking your server's PHP function support...
    Warning: fsockopen() [function.fsockopen]: unable to connect to (Connection refused) in /home/fhlinux148/c/ on line 98

    Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/fhlinux148/c/ on line 99

    Warning: fsockopen() [function.fsockopen]: unable to connect to (Unknown error) in /home/fhlinux148/c/ on line 99
    IMPORTANT: The test of the "fsockopen" function, which CaRP uses to access feeds, failed. If a warning message appears above, it describes the nature of the problem. Otherwise, your server or host firewall configuration is blocking it. Under either of the following conditions, you may still be able to use CaRP on this server (scroll down to the bottom of the page to continue):
    You only need to display feeds that are hosted in static files (ie. not generated on the fly by scripts) on your server.
    This server is configured to refuse TCP/IP connections from itself and either:
    is not currently connected to the internet, or
    is blocked by a firewall from opening connections to other websites (in which case, you'll need to get your web host to open the firewall for CaRP before you'll be able to access remote feeds).
    If neither of those is the case, CaRP will not work on this server.
  11. macrumors 6502a


    Sep 27, 2005
    Quebec, Canada
    Hmm, your problem seems server-wise. I can't help you with that but try the official CaRp forums. The owner/programmer that created the script answers to pretty much all the questions people have within 2 days.

    I hope you can fix your problem

Share This Page