Skip to content

Commit c635287

Browse files
committed
Add deviantART rss feed example
1 parent 3656fdf commit c635287

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

examples/deviant_art_rss.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
require '../src/Curl.class.php';
3+
4+
5+
$curl = new Curl();
6+
$curl->get('http://backend.deviantart.com/rss.xml', array(
7+
'q' => 'boost:popular in:photography/people/fashion',
8+
'type' => 'deviation',
9+
));
10+
11+
foreach ($curl->response->channel->item as $entry) {
12+
$thumbnails = $entry->children('http://search.yahoo.com/mrss/')->thumbnail;
13+
foreach ($thumbnails as $thumbnail) {
14+
$img = $thumbnail->attributes();
15+
echo
16+
'<a href="' . $entry->link . '">' .
17+
'<img alt="" src="' . $img->url . '" height="' . $img->height . '" width="' . $img->width . '" />' .
18+
'</a>';
19+
break;
20+
}
21+
}

0 commit comments

Comments
 (0)