Skip to content

Custom Facebook RSS Widget

For a project we wanted to bring in outside links and display them in a box on the homepage.  Instead of building out a whole custom system to handle the link, I suggested posing them through Facebook.

So in order to be able to style the feed however we wanted I put together a simple Curl code in PHP to pull in the Facebook Page RSS feed (every page has a feed it’ll be formated like this => http://www.facebook.com/feeds/page.php?id=245091913103&format=rss20).

This will check if there’s a link inside the body of the status update and use that, but then default to the link to the status message in Facebook if that doesn’t exist.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, "http://www.facebook.com/feeds/page.php?id=245091913103&format=rss20");
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0);
        curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3");
        $xmlTwitter = curl_exec($curl);
        curl_close($curl);
 
        $xmlObjTwitter = simplexml_load_string($xmlTwitter);
        $tempCounter = 0;
 
        foreach ($xmlObjTwitter->channel->item as $item) {                    
            if ( $tempCounter < 9 ){
                preg_match('/(http|https|ftp)(.*?) (id|target)/i', $item->description, $matches);
                $matches[0] = str_replace('" id','',$matches[0]);
                echo '<li><a href="'.($matches[0] ? $matches[0] : $item->link).'" target="_blank">'.$item->title.'</a>
                <div>'.date('F jS, Y',strtotime($item->pubDate)).'</div></li>';
            }
 
            $tempCounter += 1;
        }
 
        echo '</ul>';
?>

Happy Pocky day!

As some of you may know 11/11 is the unofficial Pocky Day :3 So in order to celebrated what some have called the “Ultimate Pocky Day“, a.k.a. 11/11/11,  I am…eating Pocky :3 (but only the fancy kind!)

 

Inspiring photoshop templates

I stumbled upon a site “PSD Station” which blew me away with some really slick looking PSD templates 🙂  Looking though their archives I felt really inspired and I think it’s really handy to have some many nice looking designs and different versions of normal elements that are easy to take for granted.

I was mostly impressed with all the variations of signup forms they had.  There were some interesting variations that I have seen before but it really made me think about all the different ways you can present that information by seeing so many different samples in one place.

http://www.psdstation.com/

Please Start From the Beginning…

“Please start from the beginning” is a Podcast that interviews individuals about their jobs.  This podcast interviews individuals working with the web and goes through how they got to where they are today, what they do, and what their job title means.

It’s interesting to hear about how people got their start and what led up to where they are today 🙂  There may even be a few pearls of wisdom here and there throughout the interviews.

http://psftb.ryanhavoctaylor.com/