Trato de parser from Ebay:
Código PHP:
$url="http://svcs.ebay.com/MerchandisingService?OPERATION-NAME=getMostWatchedItems&SERVICE-NAME=MerchandisingService&SERVICE-VERSION=1.1.0&CONSUMER-ID=YOUR_API_ID&RESPONSE-DATA-FORMAT=XML&categoryId=397";
$resp = simplexml_load_file($url);
print_r($resp);
Código PHP:
SimpleXMLElement Object
(
[ack] => Success
[version] => 1.1.0
[timestamp] => 2009-08-27T21:59:56.080Z
[itemRecommendations] => SimpleXMLElement Object
(
[item] => Array
(
[0] => SimpleXMLElement Object
(
[itemId] => 280388078141
[title] => Vintage Atmos 2 LeCoultre Jaeger Mantel Clock
[viewItemURL] => http://cgi.ebay.com/Vintage-Atmos-2-LeCoultre-Jaeger-Mantel-Clock_W0QQitemZ280388078141QQcategoryZ13858QQcmdZViewItemQQ_trksidZm8QQ_trkparmsZalgo%3DMW%26its%3DC%26itu%3DUCC%26otn%3D8%26ps%3D50
[currentPrice] => 500.0
[globalId] => EBAY-US
[timeLeft] => P4DT2H8M48S
[subtitle] => EARLY CLOCK WITH LOW REGISTRATION NUMBER 1940s
[country] => US
[imageURL] => http://thumbs.ebaystatic.com/pict/280388078141_1.jpg
[shippingType] => Freight
)
Alguien tiene un minuto para decirme cómo.
Intento por ejemplo:
Código PHP:
$item = $resp->item;
$itemId = $item->itemId;
print $itemId;