<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>Dave Dash</title>
 <link href="http://davedash.com/tag/facebook/atom.xml" rel="self"/>
 <link href="http://davedash.com/tag/facebook"/>
 <updated>2012-04-07T22:42:44-07:00</updated>
 <id>http://davedash.com/</id>
 <author>
   <name>Dave Dash</name>
   <email>dd+atom1@davedash.com</email>
 </author>

 
 <entry>
   <title>California FAQ</title>
   <link href="http://davedash.com/2007/10/17/california-faq/"/>
   <updated>2007-10-17T00:00:00-07:00</updated>
   <id>http://davedash.com/2007/10/17/california-faq</id>
   <content type="html">&lt;p&gt;Katie and I are &quot;officially&quot; moving to California.  A lot of people have been asking questions about this, so I'll try to create a FAQ:&lt;/p&gt;

&lt;dl&gt;
&lt;dt&gt;Why are you moving?&lt;/dt&gt;
&lt;dd&gt;
&lt;dl&gt;
&lt;dt&gt;Short answer:&lt;/dt&gt; 
&lt;dd&gt;I got a job at Yahoo!/Delicious&lt;/dd&gt;
&lt;dt&gt;Long answer:&lt;/dt&gt;
&lt;dd&gt;
I work on the symfony project a framework that makes building quality web sites easier.  I will be contributing to this project in a way that is beneficial to Yahoo!.  Furthermore, Katie and I are looking for an adventure.  Moving out of our home in Minneapolis and into a new part of the country will be a big adjustment for us.
&lt;/dd&gt;
&lt;/dl&gt;
&lt;dt&gt;Where in California are you moving?&lt;/dt&gt;
&lt;dd&gt;We are moving to the San Francisco Bay area.  We will find a place when we arrive.  We will likely be in Mountain View or if we can find some place affordable, the City of San Francisco.
&lt;/dd&gt;

&lt;dt&gt;When are you moving?&lt;/dt&gt;
&lt;dd&gt;We are moving in early November.  I start my job in mid-November.&lt;/dd&gt;

&lt;dt&gt;That's really soon?&lt;/dt&gt;
&lt;dd&gt;Yes!  I know!&lt;/dd&gt;

&lt;dt&gt;What will you do with your house?&lt;/dt&gt;
&lt;dd&gt;We own a duplex, we'll rent out the half we live in.  We're also finishing up our attic as I type.  Initially our good friends Marc and Sadie will live here.

&lt;/dd&gt;

&lt;dt&gt;What about your cats?&lt;/dt&gt;
&lt;dd&gt;We are not sure.  They will eventually join us in California, but we are not sure if they will come with us right away in November, or later.
&lt;/dd&gt;

&lt;dt&gt;You're going to have a going away party?&lt;/dt&gt;
&lt;dd&gt;Of course, just email me&lt;/dd&gt;

&lt;dt&gt;What about your car/bikes?&lt;/dt&gt;

&lt;dd&gt;
Car is being shipped to CA.  We bike a lot and intend to do so in California, so we'll be moving our bikes as well.
&lt;/dd&gt;

&lt;dt&gt;Are you excited?&lt;/dt&gt;
&lt;dd&gt;Yes.&lt;/dd&gt;


&lt;dt&gt;What is Katie going to do?&lt;/dt&gt;
&lt;dd&gt;
We will be getting an apartment that has a pool.  I can only imagine she will spend her days making daiquiris sitting by the pool.
&lt;/dd&gt;

&lt;/dl&gt;

</content>
 </entry>
 
 <entry>
   <title>Facebook Markup Language: the Dashboard and Action links</title>
   <link href="http://davedash.com/2007/07/25/facebook-markup-language-the-dashboard-and-action-links/"/>
   <updated>2007-07-25T00:00:00-07:00</updated>
   <id>http://davedash.com/2007/07/25/facebook-markup-language-the-dashboard-and-action-links</id>
   <content type="html">&lt;p&gt;[tags]facebook, fbml, apps, reviewsby.us, symfony, sfFacebookPlatformPlugin, plugins[/tags]&lt;/p&gt;

&lt;p&gt;Facebook has the concept of the dashboard:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://developers.facebook.com/images/fbml_dashboard.gif&quot; alt=&quot;dashboard&quot; /&gt;&lt;/p&gt;

&lt;p&gt;In case the documentation isn't clear, these are where the top buttons for your app go.&lt;/p&gt;

&lt;p&gt;I created the FBMLHelper to help you write links from symfony to facebook.&lt;/p&gt;

&lt;p&gt;The dashboard itself is easy to create:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;fb:dashboard&amp;gt;
&amp;lt;/fb:dashboard&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The links are fairly simple, but if you use &lt;a href=&quot;http://symfony-project.com/&quot;&gt;symfony&lt;/a&gt;...  we like helpers...&lt;/p&gt;

&lt;p&gt;So the &lt;code&gt;FBMLHelper&lt;/code&gt; has an &lt;code&gt;fb_action&lt;/code&gt; method which is similar to &lt;code&gt;link_to&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php echo fb_action('My Dining', '@homepage') ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Will actually render as:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;a href=&quot;http://apps.facebook.com/reviewsbyus/&quot;&amp;gt;My Dining&amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Provided the &lt;code&gt;app_facebook_canvas_url&lt;/code&gt; is set to your canvas url (for example, our's is http://apps.facebook.com/reviewsbyus/).&lt;/p&gt;

&lt;p&gt;This helper takes care of routing and rewriting the URL to something that will work within Facebook's canvas.&lt;/p&gt;

&lt;p&gt;... so start writing some apps.  This plugin will be developed further and I'll try to publish tutorials whenever possible.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>The Namesake</title>
   <link href="http://davedash.com/2007/03/24/the-namesake/"/>
   <updated>2007-03-24T00:00:00-07:00</updated>
   <id>http://davedash.com/2007/03/24/the-namesake</id>
   <content type="html">&lt;p&gt;Like a good second generation Desi I saw &lt;a href=&quot;http://www.foxsearchlight.com/thenamesake/&quot;&gt;The Namesake&lt;/a&gt; after recently completing the novel.  Both are very good and I recommend reading the book and watching the movie, although not necessarily in that order.&lt;/p&gt;

&lt;p&gt;The following should not spoil the movie much, but are some criticisms that Katie and I had.&lt;/p&gt;

&lt;!--more--&gt;


&lt;ul&gt;
&lt;li&gt;The numbers don't add up.  The ages mentioned in the movie do not make sense (i.e. the mother (Ashima) being nearly 45 and talking to her son (Gogol) who is at least 10 years older than her when she got married just doesn't make much sense.&lt;/li&gt;
&lt;li&gt;In the movie he graduates in 1996, but his graduation gift is dated as June 1995.&lt;/li&gt;
&lt;li&gt;When Gogol is flying to India the first time, they have some placements of the &lt;a href=&quot;http://upload.wikimedia.org/wikipedia/en/thumb/3/3f/ImmediatePastNWALogo.png/150px-ImmediatePastNWALogo.png&quot;&gt;Northwest Airline logo&lt;/a&gt;, you know... back when it was Northwest Orient Airlines and the logo looked more like this: &lt;br/&gt;&lt;img src=&quot;http://upload.wikimedia.org/wikipedia/en/thumb/7/7d/Old_Northwest_Airlines_logo.jpg/75px-Old_Northwest_Airlines_logo.jpg&quot; alt=&quot;Northwest Orient Airlines&quot; /&gt;&lt;/li&gt;
&lt;li&gt;Of course, it also seemed that a lot of parts of this movie would be hard to understand without reading the book (or for that matter having a vague understanding of Bengali).&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The movie however, was very good overall.  The book is much better, as books tend to be, because they convey things that movies cannot.  It really struck a chord with me, making me want to be with my family more, and reflect on my life (albeit my life is not nearly as bittersweet as Gogol's).&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Make Adium show your Facebook status</title>
   <link href="http://davedash.com/2007/02/03/make-adium-show-your-facebook-status/"/>
   <updated>2007-02-03T00:00:00-08:00</updated>
   <id>http://davedash.com/2007/02/03/make-adium-show-your-facebook-status</id>
   <content type="html">&lt;p&gt;By using a simple &lt;acronym title=&quot;Really Simple Syndication&quot;&gt;RSS&lt;/acronym&gt; feed, you can have Adium report your Facebook status.&lt;/p&gt;

&lt;p&gt;I am a late-adopter to social networks.  I participated in LiveJournal years after many of my friends started using it.  I finally got into Facebook months after it was &quot;openned up.&quot;  I like this strategy because I can immediately find my friends on the network and add them and amass 100s in a few short days.&lt;/p&gt;

&lt;p&gt;Facebook is nice for its simple and clean interface.  Even the features are fairly simple.  I like the status feature... for no good reason.  It's a simple AJAX status update that updates your status on the site.  What I don't like to do is repeat myself.  I wanted Adium to repeat what Facebook said.&lt;/p&gt;

&lt;!-- more --&gt;


&lt;p&gt;My first inkling was to use the Facebook &lt;acronym title=&quot;Application Programming Interface&quot;&gt;API&lt;/acronym&gt;, but that seemed less appealing since it would involve authentication.  I almost gave up and then discovered that in Facebook you can go to &quot;My Profile&quot; and under &quot;Status&quot; go to &quot;See All&quot; and there's an RSS link to your status messages.  Awesome.  All I needed to do is grab the first one.&lt;/p&gt;

&lt;p&gt;I decided this looked like a task for &lt;a href=&quot;http://us3.php.net/simplexml/&quot;&gt;Simple XML&lt;/a&gt; which can take an XML string and turn it into a PHP object.&lt;/p&gt;

&lt;p&gt;The first step of course was to fetch the &lt;acronym title=&quot;Really Simple Syndication&quot;&gt;RSS&lt;/acronym&gt; feed into a string.  &lt;code&gt;file_get_contents&lt;/code&gt; made the most sense, but Facebook does a browser check even for getting RSS feeds.  I'm not fond of browser sniffing, but its easy to work around if you use &lt;a href=&quot;http://www.php.net/curl&quot;&gt;cURL&lt;/a&gt;.&lt;/p&gt;

&lt;div&gt;&lt;textarea name=&quot;code&quot; class=&quot;php&quot;&gt;
&amp;lt;?php
    $url = &quot;http://mynework.facebook.com/feeds/status.php?replace=with&amp;your=own&amp;feed=url&quot;;

    // setup curl
    $ch = curl_init();
    curl_setopt ($ch, CURLOPT_URL, $url);
    curl_setopt ($ch, CURLOPT_HEADER, 0);

    //spoof Firefox
    curl_setopt($ch, CURLOPT_USERAGENT, &quot;Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.1) Gecko/20061223 Firefox/2.0.0.1&quot;);

    // begin output buffering
    ob_start();
    curl_exec ($ch);
    curl_close ($ch);
    // save buffer to string
    $xmlstr = ob_get_contents();

    ob_end_clean();

    // convert string to xml object
    $xml = new SimpleXMLElement($xmlstr);

    // status messages start with 'Dave is...' 
    // I just want everything after my name
    echo str_replace('Dave ', null,$xml-&gt;channel-&gt;item-&gt;title);

&lt;/textarea&gt;&lt;/div&gt;


&lt;p&gt;Excellent... this does exactly what I want - but it's slow.  Like any good script, we should use caching if it makes sense.  Obviously we don't want to overload the servers at Facebook (or for that matter any place that serves up &lt;acronym title=&quot;Real Simple Syndication&quot;&gt;RSS&lt;/acronym&gt; feeds) so we implement &lt;acronym title=&quot;PHP Extension and Application Repository&quot;&gt;PEAR&lt;/acronym&gt;'s &lt;a href=&quot;http://pear.php.net/package/Cache_Lite&quot;&gt;Cache_Lite&lt;/a&gt; package.  We'll tell it to cache results for 15 minutes.  The code changes are marked with &lt;code&gt;//+++&lt;/code&gt; at the end of each new line:&lt;/p&gt;

&lt;div&gt;&lt;textarea name=&quot;code&quot; class=&quot;php&quot;&gt;
&amp;lt;?php

    require_once('Cache/Lite.php'); //+++
    
    $url = &quot;http://mynework.facebook.com/feeds/status.php?replace=with&amp;your=own&amp;feed=url&quot;;

    $options = array('cacheDir' =&gt; '/tmp/', 'lifeTime' =&gt; 600); //+++

    $Cache_Lite = new Cache_Lite($options); //+++

    $data = null; //+++
    // attempt to load the data from cache,  //+++
    // otherwise load it anew from RSS //+++
    if (!($data = $Cache_Lite-&gt;get($id))) { //+++
    // setup curl
        $ch = curl_init();
        curl_setopt ($ch, CURLOPT_URL, $url);
        curl_setopt ($ch, CURLOPT_HEADER, 0);

        //spoof Firefox
        curl_setopt($ch, CURLOPT_USERAGENT, &quot;Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.1) Gecko/20061223 Firefox/2.0.0.1&quot;);

        // begin output buffering
        ob_start();
        curl_exec ($ch);
        curl_close ($ch);
        // save buffer to string
        $xmlstr = ob_get_contents();

        ob_end_clean();

        // convert string to xml object
        $xml = new SimpleXMLElement($xmlstr);

        // status messages start with 'Dave is...' 
        // I just want everything after my name
        $data = str_replace('Dave ', null,$xml-&gt;channel-&gt;item-&gt;title); // +++

        $Cache_Lite-&gt;save($data); //+++

    } //+++

    echo $data; //+++
    
&lt;/textarea&gt;&lt;/div&gt;


&lt;p&gt;That's it on the PHP side.  On the Adium side you'll need to use the &lt;a href=&quot;http://www.adiumxtras.com/index.php?a=xtras&amp;amp;xtra_id=1255&quot;&gt;exec AdiumXtra&lt;/a&gt;.  It'll allow you to set your status to something like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/exec {/usr/local/php5/bin/php /usr/local/bin/facebook.php}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Enjoy.&lt;/p&gt;
</content>
 </entry>
 

</feed>

