Add deviantART rss feed example

This commit is contained in:
Zach Borboa
2014-04-13 21:09:50 -07:00
parent 3656fdfa62
commit c6352873a9
+21
View File
@@ -0,0 +1,21 @@
<?php
require '../src/Curl.class.php';
$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>';
break;
}
}