Files
php-curl-class/examples/deviant_art_rss.php
T
2015-10-23 22:18:16 -07:00

22 lines
657 B
PHP

<?php
require __DIR__ . '/vendor/autoload.php';
use \Curl\Curl;
$curl = new Curl();
$curl->get('http://backend.deviantart.com/rss.xml', array(
'q' => 'boost:popular in:photography/people/fashion',
'type' => 'deviation',
));
foreach ($curl->response->channel->item as $entry) {
$thumbnails = $entry->children('http://search.yahoo.com/mrss/')->thumbnail;
foreach ($thumbnails as $thumbnail) {
$img = $thumbnail->attributes();
echo
'<a href="' . $entry->link . '">' .
'<img alt="" src="' . $img->url . '" height="' . $img->height . '" width="' . $img->width . '" />' .
'</a>';
}
}