# $full_url=$QUERY_STRING ; $vars = array(); $hot_mess=$QUERY_STRING ; $pairs = array() ; $pairs = split('AMPERSAND', $hot_mess) ; foreach ($pairs as $pair) { list($variable, $value) = split('EQUALS', $pair) ; array_push($vars,"$variable=$value") ; } #foreach($_GET as $variable=>$value) { # array_push($vars,"$variable=$value") ; #} $base_url = 'http://api.smugmug.com/hack/feed.mg?' ; $full_url = $base_url.join("&",$vars) ; # print "
$full_url" ; if ($full_url != '') { $ch=curl_init($full_url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $dump = curl_exec($ch) ; curl_close($ch) ; $xml = new SimpleXMLElement($dump); $images = array(); $captions = array(); $albumtitle = $xml->channel['title'] ; if (preg_match("/^.+?'s/", $albumtitle)) { $username = preg_replace("/^(.+?'s).+/", "$1", $albumtitle) ; } foreach ($xml->channel->item as $item) { if ($item->link != '') { $media = $item->children('http://search.yahoo.com/mrss/'); $attrs = $media->group->content[2]->attributes() ; $url = $attrs['url'] ; $url = preg_replace('/http:.*\//', '', $url) ; $title = $item->title ; if (preg_match("/$username photo/", $title)) { $title = '' ; } array_push($images,$url) ; array_push($captions,$title) ; } } print '
You are missing an RSS feed.
" ; } ?>