mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-30 04:01:47 +00:00
Add deviantART rss feed example
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user