How to get data from other websites

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
saarshad
Forum Newbie
Posts: 1
Joined: Fri Aug 29, 2008 6:02 am

How to get data from other websites

Post by saarshad »

Hello everyone,

Does anyone know how to get data from another website, i.e. getting latest sport news from bbc and publish on mysite. I have looked around and found a php method called cURL. Does anyone have examples on how to filter the data that cURL returns.

Also is there other ways of doing this.

Your help would be greatly appreciated.

Thanks

Sid.
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Re: How to get data from other websites

Post by Oren »

If all your are looking for is a small part of the info on the site, like BBC sports news, I bet they have them in RSS format or something like that.
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

Re: How to get data from other websites

Post by panic! »

try these links and come back if you still need help:

http://en.wikipedia.org/wiki/RSS_(file_format)

http://www.ibm.com/developerworks/libra ... index.html

http://rssphp.net/

using RSS PHP this should get you started:

Code: Select all

 
<?php
 
    $rss = new rss_php;
 
    $rss->load('http://newsrss.bbc.co.uk/rss/sportonline_uk_edition/football/rss.xml');
 
    $items = $rss->getItems(); #returns all rss items
        
?> 
 
Post Reply