View Single Post
06-03-2012, 11:17 AM
#3
Ant is offline Ant
Status: Member
Join date: Apr 2005
Location: England
Expertise:
Software:
 
Posts: 209
iTrader: 5 / 100%
 

Ant is on a distinguished road

  Old

Something like this should bring a list of latest macbooks, but whether that is how the site works I don't know - they might have some sort of reseller account which maybe offers a better api.

PHP Code:
<?php

    $url 
'http://www.ebay.co.uk/sch/rss/?_nkw=Macbook&rt=nc&_catref=1&_rss=1&_sacat=175672';

    
$session curl_init($url);
    
curl_setopt($sessionCURLOPT_RETURNTRANSFERtrue);
    
$data curl_exec($session);
    
curl_close($session);

    
$xml_data = new SimpleXMLElement($data);

    foreach (
$xml_data->channel->item as $item)
    {
        echo 
$item->title '<br>'
            
$item->link '<br>'
            
$item->description '<br>'
            
$item->pubDate '<br><br>';
    }