• Nola1974

    (@nolageek)


    After searching for months, I found a script that you can run on your server to create a rss feed from your (or anyone’s) flickr favorites! I can’t seem to get it to work as a widget… I tried hacking the Flickrss widget and the rss widget and it’s clear I’m not going to get it to work.

    I think there’s a HUGE demand for this (look at the flickr forums for rss favorites)

    Anyone?
    Script can be found here:

    https://www.b3co.com/?c=blog&mode=entry&id=617

    <?
    if($_GET["user"] == ""){
    die("user is required");
    }
    $u = $_GET["user"];
    header("Content-type: application/xml");
    echo '<?xml version="1.0" encoding="iso-8859-1"?>';
    ?>
    <rss version="2.0"
    xmlns:dc="https://purl.org/dc/elements/1.1/"
    xmlns:sy="https://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="https://webns.net/mvcb/"
    xmlns:rdf="https://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="https://purl.org/rss/1.0/modules/content/">
    <channel>
    <language>es-mx</language>
    <title><?=$u?>'s favorite pictures</title>
    <link>https://flickr.com/<?=$u?>/favorites/</link>
    <description><?=$u?>'s favorite pictures from flickr, script by b3co.com</description>
    <pubDate><?=date("D, j M Y H:i:s")?> -0400</pubDate>
    <copyright>b3co.com</copyright>
    <managingEditor>[email protected]</managingEditor>
    <image>
    <title>b3co.com</title>
    <url>https://b3co.com/base/logos/b3_flickr.jpg</url>
    <link>https://b3co.com/</link>
    </image>

    <?
    $data = implode("",file("https://www.flickr.com/photos/$u/favorites&quot;));
    $regexp = "/<a href=\"/photos/(.*)/\" title=\"From (.+)\"><img src=\"(.*)\" border/i";
    preg_match_all($regexp, $data, $matches, PREG_SET_ORDER);
    for($i = 0; $i < count($matches); $i++){
    ?>
    <item>
    <title>Foto de <?=$matches[$i][2]?></title>
    <link>https://www.flickr.com/photos/&lt;?=$matches[$i][1]?>/</link>
    <content:encoded><![CDATA[<img src="<?=str_replace("_s.jpg","_m.jpg",$matches[$i][3])?>"/>]]></content:encoded>
    <pubDate><?=date("D, j M Y H:i:s")?> -0400</pubDate>
    <author><?=$matches[$i][2]?> @ flickr.com</author>
    </item>
    <?
    }
    ?>
    </channel>
    </rss>

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can someone write a widget for this Flickr rss script?’ is closed to new replies.