<?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>.larre &#187; integration</title>
	<atom:link href="http://www.larre.com/tag/integration/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.larre.com</link>
	<description>technology, innovation and media</description>
	<lastBuildDate>Sat, 12 Nov 2011 20:23:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>The Facebook integration in Spotify has some weaknesses</title>
		<link>http://www.larre.com/2010/05/08/the-facebook-integration-in-spotify-has-some-weaknesses/</link>
		<comments>http://www.larre.com/2010/05/08/the-facebook-integration-in-spotify-has-some-weaknesses/#comments</comments>
		<pubDate>Sat, 08 May 2010 22:53:10 +0000</pubDate>
		<dc:creator>larre</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[facebook login]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[social]]></category>
		<category><![CDATA[spotify]]></category>

		<guid isPermaLink="false">http://www.larre.com/?p=595</guid>
		<description><![CDATA[On the 27th of April 2010 Spotify announced &#8220;Spotify &#8211; the next generation&#8220;. They started rolling out Spotify version 0.4.3 which included the largest feature upgrade since the launch in 2008. In this blog post I look more into the social features that they launched. The features are according to the Spotify blog post: &#8220;..centered on a fully editable Spotify music profile, with the ability to publish playlists, top artists and top tracks for public view. Discovering these profiles is simple as we’ve connected with Facebook so that you can instantly add your friends’ profiles&#8220;. This is cool. I tried it out, but I was surprised about their implementation of the Facebook integration. in this blog post I´ll describe what I think is some weakness with this implementation, and would love to get some dialog/comments from you. Maybe it´s only me that thinks it´s a problem? &#160; Connecting to Facebook The first thing is to connect to Facebook. In the new Spotify you´ve got a profile located in the right column. The profile typically consists of your playlists (that is published) and your top artists and top tracks. All your friends on Facebook will be able to see this as [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://static.larre.com/blog/wp-content/uploads/2010/05/spotify-logo.png"><img class="alignleft size-full wp-image-672" title="spotify-logo" src="http://static.larre.com/blog/wp-content/uploads/2010/05/spotify-logo.png" alt="Spotify" width="76" height="76" /></a>On the 27th of April 2010 Spotify announced &#8220;<a href="http://www.spotify.com/no/blog/archives/2010/04/27/the-next-generation/">Spotify &#8211; the next generation</a>&#8220;. They started rolling out Spotify version 0.4.3 which included the largest feature upgrade since the launch in 2008.  In this blog post I look more into the social features that they launched. The features are according to the Spotify blog post:</p>
<p>&#8220;..<em>centered on a fully editable Spotify music profile, with the ability to publish playlists, top artists and top tracks for public view. Discovering these profiles is simple as we’ve connected with Fa</em><em>cebook so that you can instantly add your friends’ profiles</em>&#8220;.</p>
<p>This is cool. I tried it out, but I was surprised about their implementation of the Facebook integration. in this blog post I´ll describe what I think is some weakness with this implementation, and would love to get some dialog/comments from you. Maybe it´s only me that thinks it´s a problem?</p>
<p>&nbsp;</p>
<h4><strong>Connecting to Facebook</strong></h4>
<p>The first thing is to connect to Facebook. In the new Spotify you´ve got a profile located in the right column. The profile typically consists of your playlists (that is published) and your top artists and top tracks. All your friends on Facebook will be able to see this as default (but is possible to change). There are two ways to log into Facebook from Spotify. You may use the menu at your profile at the top right. Or you may choose to click on the bottom right button asking you to import your friends.</p>
<p>Choosing to connect to Facebook will prompt you to log in to your Facebook account (E-mail and Password). This is done through a new window inside Spotify. After you log in to your account on Facebook, you will have the following options:<br />
<a href="http://static.larre.com/blog/wp-content/uploads/2010/05/spotify-access-to-facebook2.png"><img class="alignnone size-full wp-image-686" title="spotify-access-to-facebook" src="http://static.larre.com/blog/wp-content/uploads/2010/05/spotify-access-to-facebook2.png" alt="" width="600" height="320" /></a></p>
<p>What Spotify asks for is the following (to be able to connect Spotify to Facebook you must accept this )</p>
<ul>
<li>access to your information on Facebook (name, picture, list of friends etc)</li>
<li>access to your wall (for posting of messages etc )</li>
<li>acces to your news feed</li>
<li>offline acces to your account (when you are not using Spotify)</li>
</ul>
<h4><strong>Spotify takes full control over your wall</strong></h4>
<p>What happens when you accept? Well, go to Facebook and look at your profile. Spotify automatically posts to your wall that you have  just activated Facebook for Spotify making it easier to find friends&#8217; Spotify playlists. This is done without asking me. In my opinion this is a weakness with Spotify´s integration with Facebook. Spotify takes away my control over my own wall on Facebook. What they should have done, was to alert me that they where about to post to my wall, and let me choose not to do so if I did not want that information out. Another issue with this, is that everytime you disconnect Facebook from Spotify and connect again, this information is posted to your wall. Kind of make me feel like a big time spammer actually. Here is how it looks like:<br />
<a href="http://static.larre.com/blog/wp-content/uploads/2010/05/spotify-profile-wall.png"><img class="alignnone size-full wp-image-690" title="spotify-profile-wall" src="http://static.larre.com/blog/wp-content/uploads/2010/05/spotify-profile-wall.png" alt="" width="536" height="143" /></a></p>
<p>When connected to Spotify my friends on Facebook that has also connected their account to Spotify appears in a list. Now you are able to dive into each of them and look at their profiles and information as described above. I found a published playlist from one of my friends and subscribed to it. What do you think is happening now? Well, let´s go over to my Facebook profile again. On my wall a new post from Spoitify has appeared. The action of subsribing to a playlist is announced on my wall. Again this is done without any warning or information. If you really work with your friends playlist, subsrcribe to many of them, I bet you will get a bit frustrated when looking at your Facebook wall seeing all your actions there.</p>
<p>For each action I should have been prompted with a question letting me decide to post or not. Here is how this post on my wall looks like:<br />
<a href="http://static.larre.com/blog/wp-content/uploads/2010/05/spotify-subscribed-wall.png"><img class="alignnone size-full wp-image-693" title="spotify-subscribed-wall" src="http://static.larre.com/blog/wp-content/uploads/2010/05/spotify-subscribed-wall.png" alt="" width="564" height="138" /></a></p>
<p>&nbsp;</p>
<h4><strong>Working with the settings</strong></h4>
<p>Since Spotify have no functionality that let us have control over what is actually posted to the wall &#8211; playing the &#8220;all or nothing&#8221; game, I have chosen to restrict Spotify´s access to my profile. You may do this in two ways. The easiest one is to just to disable the postings to Facebook inside the profile settings in Spotify. The other option is to go to your Facebook account, choosing Spotify from the application settings, and uncheck the Spotify´s ability to access your wall.</p>
<p>I really hope Spotify develops the functionality that let me choose from action to action what I will post on my wall. The implementation today is not user-friendly as far as I see this, but of course from Spotify´s view of it, it is a sneaky way to go viral on Facebook.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.larre.com/2010/05/08/the-facebook-integration-in-spotify-has-some-weaknesses/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Building a Facebook Application in 15 minutes</title>
		<link>http://www.larre.com/2007/10/10/building-a-facebook-application-in-15-minutes/</link>
		<comments>http://www.larre.com/2007/10/10/building-a-facebook-application-in-15-minutes/#comments</comments>
		<pubDate>Wed, 10 Oct 2007 09:29:07 +0000</pubDate>
		<dc:creator>larre</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jsp]]></category>
		<category><![CDATA[platform]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://larre.wordpress.com/2007/10/10/building-a-facebook-application-in-15-minutes/</guid>
		<description><![CDATA[So, after fowa and 90k+ developers in mind, I just had to go ahead and implement a Facebook application. Here is the code and how I implemented it. See also: Reflections after having implemented Facebook Connect and Google Friend Connect on my blog First of all my goal was to use an existing web application, write a facebook integration module that communicates with the Facebook APIs, extracting some information/data and presenting them inside the existing web application. The web application I used is based on a j2ee framework (jsp, java). The architecture is much like Struts The first thing to do was to get the Developer Application to my existing Facebook account. Then I had to download the Client Library. I choosed the Java Library since my development environment was Java. When I extracted the Client Library, only the source files where included. So what I had to do first (besides looking into the source code), was to compile the java-files. I actually wrote an ant-task for this purpose, but a more easier way is just to use javac without using ant-framework. The next step was to take the output from the compile process and put it into an archived [...]]]></description>
			<content:encoded><![CDATA[<p>So, after <a href="http://www.larre.com/2007/10/09/future-of-web-apps/">fowa</a> and 90k+ developers in mind, I just had to go ahead and implement a Facebook application. Here is the code and how I implemented it.</p>
<p><strong>See also: <a href="http://www.larre.com/2008/12/18/reflections-after-having-implemented-facebook-connect-and-google-friend-connect-on-my-blog/">Reflections after having implemented Facebook Connect and Google Friend Connect on my blog</a></strong></p>
<p>First of all my goal was to use an existing web application, write a facebook integration module that communicates with the Facebook APIs, extracting some information/data and presenting them inside the existing web application. The web application I used is based on a j2ee framework (jsp, java). The architecture is much like <a href="http://struts.apache.org">Struts</a> The first thing to do was to <a href="http://developers.facebook.com/get_started.php">get the Developer Application</a> to my existing Facebook account. Then I had to download the <a href="http://developers.facebook.com/resources.php">Client Library</a>. I choosed the Java Library since my development environment was Java. When I extracted the Client Library, only the source files where included. So what I had to do first (besides looking into the source code), was to compile the java-files. I actually wrote an ant-task for this purpose, but a more easier way is just to use javac without using ant-framework. The next step was to take the output from the compile process and put it into an archived file (.jar). This is not necessary but I like to do it this way and the facebook.jar file I now had is easily dropped into my existing web application library. In my Facebook profile I had to create (set up) a new application. This is done by clicking the developer application that was installed earlier. Its some steps including getting a key (API key and secret key) that I used in my java-code but this process is straight forward. [% oiopub-banner-4-right %]</p>
<p align="left">Ok, now lets start the coding process. Here is the java code controlling the session and authentication:</p>
<p align="left"><em>String apiKey = &#8220;something&#8221;;<br />
String secretKey = &#8220;something&#8221;; </em></p>
<p align="left"><em>FacebookRestClient frc = null;<br />
HttpSession session = request.getSession();<br />
String sessionKey = (String) session.getAttribute(&#8220;facebookSession&#8221;);<br />
String token = request.getParameter(&#8220;auth_token&#8221;);</em></p>
<p align="left"><em>try {</em></p>
<p align="left"><em>if (sessionKey != null &amp;&amp; sessionKey.length() &gt; 0) {</em></p>
<p align="left"><em>frc = new FacebookRestClient(apiKey, secretKey, sessionKey);<br />
this.doTheThing(request, response, frc);<br />
} else if (token != null) {<br />
frc = new FacebookRestClient(apiKey, secretKey);<br />
session.setAttribute(&#8220;facebookSession&#8221;, sessionKey);<br />
sessionKey = frc.auth_getSession(token);<br />
session.setAttribute(&#8220;facebookSession&#8221;, sessionKey);<br />
this.doTheThing(request, response, frc);<br />
</em></p>
<p align="left"><em>} else {<br />
response.sendRedirect(&#8220;http://www.facebook.com/login.php?api_key=&#8221; + apiKey + &#8220;&amp;v=1.0&#8243;);<br />
}<br />
} catch (FacebookException fe) {<br />
} catch (IOException ioe) {<br />
&#8230;</em></p>
<p align="left">The <em>doTheThing</em> method is extracting the information and looks like this:</p>
<p align="left"><em>int myid = frc.users_getLoggedInUser();<br />
EnumSet&lt;ProfileField&gt; fields = EnumSet.of(com.facebook.api.ProfileField.NAME, com.facebook.api.ProfileField.PIC, com.facebook.api.ProfileField.PIC_BIG, com.facebook.api.ProfileField.PIC_SMALL);<br />
Collection&lt;Integer&gt; users = new ArrayList();<br />
users.add(myid);</em></p>
<p><em>// Get my information<br />
Document d = frc.users_getInfo(users, fields);<br />
String myname = d.getElementsByTagName(&#8220;name&#8221;).item(0).getTextContent();<br />
String mypicture = d.getElementsByTagName(&#8220;pic&#8221;).item(0).getTextContent();</em></p>
<p><em>// Get my friends id<br />
Document d2 = frc.friends_get();<br />
String s = d2.toString();<br />
NodeList userIDNodes = d2.getElementsByTagName(&#8220;uid&#8221;);<br />
int fcount = userIDNodes.getLength();</em></p>
<p><em>Collection&lt;Integer&gt; friends = new ArrayList&lt;Integer&gt;();<br />
for (int i = 0; i &lt; fcount; i++) {<br />
Node node = userIDNodes.item(i);<br />
String idText = node.getTextContent();<br />
Integer id = Integer.valueOf(idText);<br />
friends.add(id);<br />
}</em></p>
<p><em>List l = new ArrayList();<br />
Map m = new HashMap();<br />
Document d3 = frc.users_getInfo(friends, fields);</em></p>
<p>// Get my friends information<br />
for (int j = 0; j &lt; fcount; j++) {<br />
String name2 = d3.getElementsByTagName(&#8220;name&#8221;).item(j).getTextContent();<br />
String picture2 = d3.getElementsByTagName(&#8220;pic&#8221;).item(j).getTextContent();<br />
String picture3 = d3.getElementsByTagName(&#8220;pic_small&#8221;).item(j).getTextContent();<br />
String picture4 = d3.getElementsByTagName(&#8220;pic_big&#8221;).item(j).getTextContent();</p>
<p><em>m.put(&#8220;name&#8221;, name2);<br />
m.put(&#8220;picture&#8221;, picture2);<br />
m.put(&#8220;picture_small&#8221;, picture3);<br />
m.put(&#8220;picture_big&#8221;, picture4);</em></p>
<p><em>l .add(m);<br />
m = new HashMap();</em></p>
<p><em>}<br />
request.setAttribute(&#8220;friends&#8221;, l);<br />
request.setAttribute(&#8220;myname&#8221;, myname);<br />
request.setAttribute(&#8220;mypicture&#8221;, mypicture);<br />
request.setAttribute(&#8220;numFriends&#8221;, new Integer(fcount));</em></p>
<p align="left">
<p align="left">So all the information from Facebook is now added to the request and can be displayed in a JSP. The code above is not very elegant and is not optimized(!). Its just a pice of code done after half an hour of work and my goal was to implement an integration module for testing purpose.</p>
<p>Hope this blog post can help others looking for hints when getting started with Facebook application development/integration</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-9866489500407536";
/* 468x60, opprettet 05.05.10 */
google_ad_slot = "1189263368";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larre.com/2007/10/10/building-a-facebook-application-in-15-minutes/feed/</wfw:commentRss>
		<slash:comments>42</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 2/9 queries in 0.011 seconds using disk: basic
Object Caching 398/405 objects using disk: basic
Content Delivery Network via Amazon Web Services: CloudFront: static.larre.com

Served from: www.larre.com @ 2012-02-04 21:58:14 -->
