/    Sign up×
Community /Pin to ProfileBookmark

Retrieving news headlines from an external RSS fille

I’ve made a little ticker for my site and now I want to make it access the BBC headlines from:

http://www.bbc.co.uk/syndication/feeds/news/ukfs_news/world/rss091.xml

Unfortunately, I don’t know how to embed the text from this page into my site. How?

I appreciate any help I can get.

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliSep 27.2003 — rss files are XML files,you will need to read the XML file,parse the contents and display them.

The RSS files have a the following format

<item><!-- represents one item of data, below is the rest of the contents//-->

<title>Tite of hte item</title>

<description>Description of the conent</description>

<link>URL:</link>

</title>

The best option will be to use server side language to open the rss file and process it and then diplay it in a page....
Copy linkTweet thisAlerts:
@alisdairiauthorSep 27.2003 — I was hoping I wouldn't have to. My php is limited, but I guess I will do it that way. I was jsut being lazy. Would this work to access the file before parsing?

$filename = "http://www.bbc.co.uk/syndication/feeds/news/ukfs_news/world/rss091.xml" ;

$fp = fopen ($filename , 'rb' );

$filevalue = fread ($fp , filesize ($filename ));

fclose ($fp );

echo $filevalue ;

??
Copy linkTweet thisAlerts:
@Khalid_AliSep 27.2003 — it should....I am not way too familiar with php ,but I know that it has some mecahnism to read XML files as well,I am sure you will be better off using that for RSS files.
Copy linkTweet thisAlerts:
@XMLMania_comSep 27.2003 — ROFL - You can't just open an XML file in PHP and expect it to be parsed...

Try: http://uk2.php.net/manual/en/ref.xml.php for PHP's XML functions.

And there are many RSS parsers at http://www.hotscripts.com

  • - Martin
  • Copy linkTweet thisAlerts:
    @Khalid_AliSep 27.2003 — [i]Originally posted by XMLMania.com [/i]

    [B]ROFL

    - Martin [/B]
    [/QUOTE]


    I beg your pardon, what did I miss that was so funny...
    ×

    Success!

    Help @alisdairi spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.6,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...