<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Life and Leisure. Tech and Toys. &#187; facebook</title>
	<atom:link href="http://blog.thaichaiguy.com/category/facebook/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.thaichaiguy.com</link>
	<description>A blog by a one-man gamer, programmer and hobbyist. Spreading views of life and leisure, tech and toys.</description>
	<lastBuildDate>Wed, 28 Jul 2010 00:40:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Facebook Ad &#8211; Just add boobs</title>
		<link>http://blog.thaichaiguy.com/1417/facebook-ad-just-add-boobs/</link>
		<comments>http://blog.thaichaiguy.com/1417/facebook-ad-just-add-boobs/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 20:30:01 +0000</pubDate>
		<dc:creator>thaichaiguy</dc:creator>
				<category><![CDATA[facebook]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://blog.thaichaiguy.com/?p=1417</guid>
		<description><![CDATA[
This cropped screen shot was captured on my Facebook homepage. I don&#8217;t know what the girl in the picture has to do with winning an Apple iPad but it certainly got my attention. I hate ads like this because the image has nothing to do with the ad itself, its just an easy way to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.thaichaiguy.com/wp-content/uploads/2010/02/facebook_ad.jpg"><img class="alignnone size-medium wp-image-1416" title="facebook_ad" src="http://blog.thaichaiguy.com/wp-content/uploads/2010/02/facebook_ad-187x300.jpg" alt="" width="187" height="300" /></a></p>
<p>This cropped screen shot was captured on my Facebook homepage. I don&#8217;t know what the girl in the picture has to do with winning an Apple iPad but it certainly got my attention. I hate ads like this because the image has nothing to do with the ad itself, its just an easy way to get clicks. Unfortunately I&#8217;m sure it has received a million clicks by now, further surrendering our internet civilization to sex in more and more ways. They say sex created the internet, but I believe the internet spread sex just the same.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thaichaiguy.com/1417/facebook-ad-just-add-boobs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>New Facebook Design Breaks Live Message</title>
		<link>http://blog.thaichaiguy.com/463/new-facebook-design-breaks-live-message/</link>
		<comments>http://blog.thaichaiguy.com/463/new-facebook-design-breaks-live-message/#comments</comments>
		<pubDate>Sun, 03 Aug 2008 21:54:37 +0000</pubDate>
		<dc:creator>thaichaiguy</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://blog.thaichaiguy.com/?p=463</guid>
		<description><![CDATA[It looks like the new Facebook Design breaks Live Messages. For some reason the Javascript Listener doesn&#8217;t recieve any messages when using the new Facebook design. Since Live Messages are technically still in beta I guess we can&#8217;t hold Facebook responsible for breaking our test apps. Hopefully nobody put enough faith into Facebook to release [...]]]></description>
			<content:encoded><![CDATA[<p>It looks like the new Facebook Design breaks Live Messages. For some reason the Javascript Listener doesn&#8217;t recieve any messages when using the new Facebook design. Since Live Messages are technically still in beta I guess we can&#8217;t hold Facebook responsible for breaking our test apps. Hopefully nobody put enough faith into Facebook to release a Production App using Live Messages.</p>
<p>Thanks for figuring it out Charles!</p>
<p><a href="http://blog.thaichaiguy.com/?p=406">Facebook Live Message API Tutorial</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thaichaiguy.com/463/new-facebook-design-breaks-live-message/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hasbro officially hands Scrabulous a lawsuit.</title>
		<link>http://blog.thaichaiguy.com/448/hasbro-officially-hands-scrabulous-a-lawsuit/</link>
		<comments>http://blog.thaichaiguy.com/448/hasbro-officially-hands-scrabulous-a-lawsuit/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 18:42:50 +0000</pubDate>
		<dc:creator>thaichaiguy</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[video game reviews]]></category>

		<guid isPermaLink="false">http://blog.thaichaiguy.com/?p=448</guid>
		<description><![CDATA[
Scrabulous has been dynamite since it landed on Facebook as the leading game application on the scene. Since then the application has garnered a different tone from Hasbro who own the rights the original Scrabble. Earlier this year it was said that Scrabulous would be forced to take down their application. Months have passed and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.thaichaiguy.com/wp-content/uploads/2008/07/screenshot.gif"><img class="alignnone size-thumbnail wp-image-447" title="scrabulous" src="http://blog.thaichaiguy.com/wp-content/uploads/2008/07/screenshot-150x150.gif" alt="" width="150" height="150" /></a></p>
<p>Scrabulous has been dynamite since it landed on Facebook as the leading game application on the scene. Since then the application has garnered a different tone from Hasbro who own the rights the original Scrabble. Earlier this year it was said that Scrabulous would be forced to take down their application. Months have passed and Scrabulous is still standing so Hasbro has issued a lawsuit against the creators of Scrabulous and have also released their own officially licensed Scrabble game on Facebook in a joint venture with Electronic Arts. Hasbro has also issued a statement to Facebook for them to pull the plug on the app.</p>
<p>This is why you make original games. Yea these guys got a lot of attention and will probably go on to better things but having a lawsuit on your hands can&#8217;t be any fun. On that note, I&#8217;ll be publishing images of my original game character in the near future.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thaichaiguy.com/448/hasbro-officially-hands-scrabulous-a-lawsuit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook LiveMessage API Tutorial</title>
		<link>http://blog.thaichaiguy.com/406/facebook-livemessages-from-experience/</link>
		<comments>http://blog.thaichaiguy.com/406/facebook-livemessages-from-experience/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 19:09:48 +0000</pubDate>
		<dc:creator>thaichaiguy</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://blog.thaichaiguy.com/?p=406</guid>
		<description><![CDATA[
While developing an application for Facebook I came across the LiveMessage feature which is currently still in beta. The only problem is that I couldn&#8217;t find much information on how people actually used the API version of it. LiveMessage seems like it could be a really useful function to leverage for real time applications, not [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.thaichaiguy.com/wp-content/uploads/2008/06/untitled.jpg"><img class="alignnone size-medium wp-image-410" title="facebooklivemessage" src="http://blog.thaichaiguy.com/wp-content/uploads/2008/06/untitled-300x89.jpg" alt="" width="300" height="89" /></a></p>
<p>While developing an application for Facebook I came across the LiveMessage feature which is currently still in beta. The only problem is that I couldn&#8217;t find much information on how people actually used the API version of it. LiveMessage seems like it could be a really useful function to leverage for real time applications, not just chatting.</p>
<p>I know javascript okay but working under the FBJS framework forces you to reference the <a href="http://wiki.developers.facebook.com/index.php/Main_Page">Facebook Documentation Wiki</a> more than I&#8217;d prefer. They also prevent you from employing any JS frameworks, like prototype.js, forcing you to use their proprietary functions.</p>
<p>In this chat example I used javascript, PHP, FB API and FBJS.</p>
<p>First, just like the <a href="http://wiki.developers.facebook.com/index.php/FBJS/Examples/LiveMessage">example</a> in the wiki we create a listener. Here I also use the add_message_line function used in the example.</p>
<pre>&lt;script type="text/javascript"&gt;
&lt;!--
var livemessage = new LiveMessage('test_event', function(data) {
	add_message_line(data.name +": " + data.msg);

	}
);
function add_message_line(line_text) {
	var new_line = document.createElement('div');
	new_line.setTextValue(line_text);
	document.getElementById('chat').appendChild(new_line);
}
//--&gt;
&lt;/script&gt;</pre>
<p>Then instead of using the send_message function in the wiki example I created my own function that does a POST to my own php file called chatTestSend.php which uses the facebook.livemessage.send() provided by the API. Doing it this way gave me a better understanding of what&#8217;s going on. I called this JS function sender(). Notice I used the FBJS Ajax object, you can read more about it <a href="http://wiki.developers.facebook.com/index.php/FBJS#AJAX">here</a>.</p>
<pre>&lt;script type="text/javascript"&gt;
&lt;!--
function sender(uid, message){
	var ajax = new Ajax();
	var queryParams = { "uid" : uid, "message" : message };
	ajax.responseType = Ajax.RAW;
	ajax.requireLogin = true;

	ajax.post("http://YOURDOMAIN/chatTestSend.php", queryParams);	

	ajax.ondone = function(data) {
		add_message_line("Me: " + message);
		document.getElementById('message').setValue('');
	}
	ajax.onerror = function(data) { add_message_line("Error"); };
}
//--&gt;
&lt;/script&gt;</pre>
<p>If you haven&#8217;t figured it out already this function is going to be called by an html form on the onSubmit event. The code below is similar to the example on the wiki. Combine the above javascripts with this file and call it something like chatTest.html.</p>
<pre>&lt;form action="#" method="post" onsubmit="sender(document.getElementById('chat_with').getValue(), document.getElementById('message').getValue()); return false;" &gt;
&lt;div id="chat"&gt;&lt;/div&gt;
Message:
&lt;input id="message" name="message" size="40" type="text" /&gt;
To (user id):
&lt;input id="chat_with" name="chat_with" type="text" /&gt;
&lt;input type="submit" /&gt;
&lt;/form&gt;</pre>
<p>And lastly, the php code of chatTestSend.php would do something like the following. Create the FB object and get the logged in user. Then, if the posts variables aren&#8217;t empty get the user&#8217;s name. Then call the method. Since there is no method in the php client lib use call_method. The only thing special about facebook.livemessage.send is that the message is sent using JSON. Luckily php 5 provides us with the json_encode() function. Pass an associative array into the json_encode function and you&#8217;re good to go.</p>
<pre>$this-&gt;facebook = new Facebook($this-&gt;FBAPIKEY, $this-&gt;FBSECRET);
$this-&gt;user = $this-&gt;facebook-&gt;require_add();

if(!empty($_POST) &amp;&amp; !empty($_POST["uid"]) &amp;&amp; !empty($_POST["message"]) ) {
	$data = $this-&gt;facebook-&gt;api_client-&gt;users_getInfo($this-&gt;user, array('first_name'));
	$result = $this-&gt;facebook-&gt;api_client-&gt;call_method("facebook.livemessage.send",
	      array("recipient"=&gt;$_POST["uid"], "event_name"=&gt;"test_event", "message"=&gt;json_encode(array("from"=&gt;$this-&gt;user, "msg"=&gt;$_POST["message"], "name"=&gt;$data[0]['first_name']) ) ) );
}</pre>
<p>So that&#8217;s about it. Open up chatTest.html and post to chatTestSend.php and send some messages to yourself. I concede that all of this probably won&#8217;t work right out of the box but with a little knowledge and tweaking you should be able to get it right. Drop me a comment if you need some help.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thaichaiguy.com/406/facebook-livemessages-from-experience/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Facebook API Timeout</title>
		<link>http://blog.thaichaiguy.com/335/facebook-api-timeout/</link>
		<comments>http://blog.thaichaiguy.com/335/facebook-api-timeout/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 17:22:33 +0000</pubDate>
		<dc:creator>thaichaiguy</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.blog.thaichaiguy.com/?p=335</guid>
		<description><![CDATA[Grrr. Well I spent more time on my Facebook App last night and it turns out the Facebook timeout and slow REST calls really make my application useless. If Facebook doesn&#8217;t receive a response from your server under 7 secs it&#8217;ll spit out an error saying the application has a few kinks. 7 secs is [...]]]></description>
			<content:encoded><![CDATA[<p>Grrr. Well I spent more time on my Facebook App last night and it turns out the Facebook timeout and slow REST calls really make my application useless. If Facebook doesn&#8217;t receive a response from your server under 7 secs it&#8217;ll spit out an error saying the application has a few kinks. 7 secs is actually generally longer than any website should take to respond but the problem is spawned from the Facebook API itself. The main problem is the slow Facebook REST calls that take a long time to respond if you call a few of them at once.</p>
<p>I&#8217;m trying to think of a way to do it with AJAX so the server responds immediately and then the REST calls are called through a web service. I&#8217;m not sure how it&#8217;s all going to work yet but I foresee a problem with passing the session. If anyone has done this or can point me in the direction of a tutorial it&#8217;d be greatly appreciated.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thaichaiguy.com/335/facebook-api-timeout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook API grumble</title>
		<link>http://blog.thaichaiguy.com/314/facebook-api-grumble/</link>
		<comments>http://blog.thaichaiguy.com/314/facebook-api-grumble/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 18:39:44 +0000</pubDate>
		<dc:creator>thaichaiguy</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.blog.thaichaiguy.com/?p=314</guid>
		<description><![CDATA[I thought I had a good idea for a Facebook application until I realized that the Facebook API doesn&#8217;t allow you to view &#8220;friends of friends&#8221;. I guess they are trying to uphold the privacy of their users but it&#8217;s pretty public information when I&#8217;m logged into their site. The funny thing is that I [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I had a good idea for a Facebook application until I realized that the Facebook API doesn&#8217;t allow you to view &#8220;friends of friends&#8221;. I guess they are trying to uphold the privacy of their users but it&#8217;s pretty public information when I&#8217;m logged into their site. The funny thing is that I didn&#8217;t even need to know the specific &#8220;friends of friends&#8221; rather the number of friends a user has. Without this feature my application is a little boring but I guess I&#8217;ll keep chugging away, there may be a diamond in the rough when all is said and done.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thaichaiguy.com/314/facebook-api-grumble/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Difficulties, CakePHP and the Facebook API</title>
		<link>http://blog.thaichaiguy.com/308/difficulties-cakephp-and-the-facebook-api/</link>
		<comments>http://blog.thaichaiguy.com/308/difficulties-cakephp-and-the-facebook-api/#comments</comments>
		<pubDate>Wed, 13 Feb 2008 18:53:58 +0000</pubDate>
		<dc:creator>thaichaiguy</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.blog.thaichaiguy.com/?p=308</guid>
		<description><![CDATA[Required knowledge: CakePHP, PHP, Facebook API
Trying to integrate CakePHP and the Facebook API has given me a headache for the past couple days. First off I didn&#8217;t know where to start besides dropping the Facebook php files into my vendors directory.
Luckily I found a very useful post here. It goes on to explain how to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Required knowledge</strong>: CakePHP, PHP, Facebook API</p>
<p>Trying to integrate CakePHP and the Facebook API has given me a headache for the past couple days. First off I didn&#8217;t know where to start besides dropping the <a href="http://developers.facebook.com/clientlibs/facebook-platform.tar.gz" target="_blank">Facebook php files</a> into my vendors directory.</p>
<p>Luckily I found a very useful post <a href="http://facebook-developer.net/2007/10/18/building-your-first-facebook-application-with-cakephp/" target="_blank">here</a>. It goes on to explain how to set up your app_controller.php and a sample Controller and View using Facebook&#8217;s FBML. If you&#8217;re looking to start a Facebook application in  CakePHP this is the place to start.</p>
<p>Later on I started having problems with posted data. Whenever I had a canvas page that handled posted data and then displayed something depending on what was posted I&#8217;d lose the post while redirecting. The following code for example:</p>
<pre>
function add(){
  $output = "";
  if(!empty($this-&gt;data) ){
    if($this-&gt;Team-&gt;save($this-&gt;data)){
      $output = "success";
    }
    else{
      $output = "error";
    }
  }
  $this-&gt;set("output", $output);
  $this-&gt;facebook-&gt;require_frame();
}</pre>
<p>This code would save the data but $output would still be blank. The reason being is that after the redirect during require_frame(), $this-&gt;data is lost. So instead of making pages like the one above I would do the following:</p>
<pre>
function add(){
  if(!empty($this-&gt;data) ){
    if($this-&gt;Team-&gt;save($this-&gt;data)){
      $this-&gt;redirect('/teams/success');
    }
    else{
      $this-&gt;redirect('/teams/invalid');
    }
  }
}</pre>
<p>This way I redirect completely without calling the require_frame() method until I am in either &#8220;/teams/success&#8221; or  &#8220;/teams/invalid&#8221;.</p>
<p>I&#8217;ll post more as I get further into it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thaichaiguy.com/308/difficulties-cakephp-and-the-facebook-api/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Facebook Marketplace Review: From Actual Experience</title>
		<link>http://blog.thaichaiguy.com/208/facebook-marketplace-review-from-actual-experience/</link>
		<comments>http://blog.thaichaiguy.com/208/facebook-marketplace-review-from-actual-experience/#comments</comments>
		<pubDate>Mon, 23 Jul 2007 18:20:00 +0000</pubDate>
		<dc:creator>thaichaiguy</dc:creator>
				<category><![CDATA[chillin]]></category>
		<category><![CDATA[facebook]]></category>

		<guid isPermaLink="false">http://www.blog.thaichaiguy.com/?p=208</guid>
		<description><![CDATA[Last week I posted a desk chair on Facebook Marketplace and Craigslist hoping to sell it for whatever price anyone would pay. I originally thought it could only sell for $15 but I wanted to see how much people would pay for it. I ended up setting the listing for &#8220;$30 or best offer&#8221;.
Facebook Marketplace [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I posted a desk chair on Facebook Marketplace and Craigslist hoping to sell it for whatever price anyone would pay. I originally thought it could only sell for $15 but I wanted to see how much people would pay for it. I ended up setting the listing for &#8220;$30 or best offer&#8221;.</p>
<p>Facebook Marketplace received immediate attention with 3 people sending me private messages and recording plenty of views. I like selling to fellow college kids and Facebook marketplace makes it easy. In the end the chair went for $30, more than I initially expected.</p>
<p>There are problems that both of these systems lack though. First of all, unlike ebay there is no rating system. How am I supposed to gain a reputation of being a good seller without a rating system. In the same way, how am I supposed to know if the people I am dealing with are good sellers/buyers that I can trust.</p>
<p>Secondly, there is no integrated bidding system. Most people on Craigslist and Facebook Marketplace place sales using &#8220;Or Best Offer&#8221;. This doesn&#8217;t mean it requires a bidding system but in my case I had 3 people outbidding each other. Without a bidding system in place I had to handle it on my own. I had to repeatedly inform the other buyers what the current bid was.</p>
<p>Now I&#8217;ll point out what these systems do have. Craigslist ensures that you are dealing with people in your area. This cuts out shipping which in turn decreases the length it takes to make a transaction and of course the money involved in shipping costs. Facebook Marketplace is copy of Craigslist with the integration of the Facebook networks. This way you know you&#8217;re only dealing with people from your school, work, city, etc. In the end all these systems could learn a little from each other.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thaichaiguy.com/208/facebook-marketplace-review-from-actual-experience/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
