<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://developer.myspace.com/Community/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>JavaScript/HTML - Container</title><link>http://developer.myspace.com/Community/forums/23.aspx</link><description>Discuss the OpenSocial container interface for MySpace.</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 20910.1126)</generator><item><title>Re: Example: PHP show friends page</title><link>http://developer.myspace.com/Community/forums/thread/37231.aspx</link><pubDate>Wed, 11 Mar 2009 03:12:46 GMT</pubDate><guid isPermaLink="false">8e485011-333f-425c-b84a-1febdb8bfab0:37231</guid><dc:creator>Mehedi Hasan</dc:creator><slash:comments>0</slash:comments><comments>http://developer.myspace.com/Community/forums/thread/37231.aspx</comments><wfw:commentRss>http://developer.myspace.com/Community/forums/commentrss.aspx?SectionID=23&amp;PostID=37231</wfw:commentRss><description>&lt;p&gt;
Hi
I found this tutorial is not working for me. wht should I do? Please help me &lt;/p&gt;</description></item><item><title>Re: Example: PHP show friends page</title><link>http://developer.myspace.com/Community/forums/thread/33556.aspx</link><pubDate>Sat, 10 Jan 2009 01:32:29 GMT</pubDate><guid isPermaLink="false">8e485011-333f-425c-b84a-1febdb8bfab0:33556</guid><dc:creator>Thomas</dc:creator><slash:comments>0</slash:comments><comments>http://developer.myspace.com/Community/forums/thread/33556.aspx</comments><wfw:commentRss>http://developer.myspace.com/Community/forums/commentrss.aspx?SectionID=23&amp;PostID=33556</wfw:commentRss><description>&lt;p class="MsoNormal"&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Community/Themes/default/images/icon-quote.gif"&gt; &lt;strong&gt;Daniel:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;lt;?php&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $user = $_GET[&amp;quot;id&amp;quot;];&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; require_once(&amp;#39;Space.php&amp;#39;);&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; $key = &amp;#39;&lt;span style="font-weight:bold;"&gt;XXXXXXXXXXXXXXXXXXXXXXXX&lt;/span&gt;&amp;#39;;&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; $secret = &amp;#39;&lt;span style="font-weight:bold;"&gt;XXXXXXXXXXXXXXXXXXXXXXXXX&lt;/span&gt;&amp;#39;;&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; $s = new Space($key,$secret);&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; $hProfile = $s-&amp;gt;profile($user);&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; foreach($hProfile as $k =&amp;gt; $value){&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo &amp;quot;&amp;lt;BR&amp;gt;&amp;lt;strong&amp;gt;&amp;quot;.$k.&amp;quot;&amp;lt;/strong&amp;gt;:&amp;quot;.$value;&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Wow!&amp;nbsp; This is so insecure...&amp;nbsp; All this requires is someone to know the myspaceid of another user of your app, and placing it on the end of your apps url &amp;nbsp; http://someurl.com?id=xxxxxxxx&amp;nbsp; and bang!&amp;nbsp; They are authenticated into your app. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Example: PHP show friends page</title><link>http://developer.myspace.com/Community/forums/thread/33449.aspx</link><pubDate>Thu, 08 Jan 2009 21:41:51 GMT</pubDate><guid isPermaLink="false">8e485011-333f-425c-b84a-1febdb8bfab0:33449</guid><dc:creator>Chad Russell</dc:creator><slash:comments>0</slash:comments><comments>http://developer.myspace.com/Community/forums/thread/33449.aspx</comments><wfw:commentRss>http://developer.myspace.com/Community/forums/commentrss.aspx?SectionID=23&amp;PostID=33449</wfw:commentRss><description>&lt;p&gt;The alert function is blocked, try outputting something to a div, e.g.: &lt;/p&gt;&lt;p&gt;&amp;lt;div id=&amp;quot;output&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;script&amp;gt;&lt;/p&gt;&lt;p&gt;document.getElementById(&amp;quot;output&amp;quot;).innerHTML = &amp;quot;hello world&amp;quot;;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;lt;/script&amp;gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Example: PHP show friends page</title><link>http://developer.myspace.com/Community/forums/thread/33096.aspx</link><pubDate>Sun, 04 Jan 2009 21:34:01 GMT</pubDate><guid isPermaLink="false">8e485011-333f-425c-b84a-1febdb8bfab0:33096</guid><dc:creator>JackTard</dc:creator><slash:comments>0</slash:comments><comments>http://developer.myspace.com/Community/forums/thread/33096.aspx</comments><wfw:commentRss>http://developer.myspace.com/Community/forums/commentrss.aspx?SectionID=23&amp;PostID=33096</wfw:commentRss><description>&lt;p&gt;App Source worked, now it doesn&amp;#39;t. What did I do... ??&lt;/p&gt;&lt;p&gt;I had
the MySpace App source listed here, with the JavaScript working. now it
seems I can&amp;#39;t get something as simple as a js Alert(); function to
display consistantly. It does seem it will work Off and On, but I don&amp;#39;t
know what I&amp;#39;m doing at this point.&amp;nbsp;&lt;/p&gt;&lt;p&gt;Here&amp;#39;s what I&amp;#39;m doing, from
this page http://developer.myspace.com/Apps.mvc, I click &amp;quot;Edit Source.&amp;quot;
Under the &amp;quot;Canvas Surface&amp;quot; I put in something as simple as, &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;lt;script language=&amp;quot;javascript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
alert(&amp;#39;This is what an alert message looks like.&amp;#39;);&amp;lt;/script&amp;gt;&amp;nbsp; &lt;/p&gt;Click
the &amp;quot;Save Application Souce&amp;quot; and click the &amp;quot;View Development Version&amp;quot;
but no luck! I see no alert. If I do something as simple as an
&amp;lt;iframe src=&amp;quot;&amp;quot;&amp;gt; to pull up an external page it works fine. What
am I doing wrong here?? Your help would be greatly appreciated.</description></item><item><title>Re: Example: PHP show friends page</title><link>http://developer.myspace.com/Community/forums/thread/32922.aspx</link><pubDate>Fri, 02 Jan 2009 11:58:08 GMT</pubDate><guid isPermaLink="false">8e485011-333f-425c-b84a-1febdb8bfab0:32922</guid><dc:creator>JackTard</dc:creator><slash:comments>0</slash:comments><comments>http://developer.myspace.com/Community/forums/thread/32922.aspx</comments><wfw:commentRss>http://developer.myspace.com/Community/forums/commentrss.aspx?SectionID=23&amp;PostID=32922</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;finally!&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks, you get one of the two spots in my big credit thanks! you&amp;#39;re awesome!!! &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Example: PHP show friends page</title><link>http://developer.myspace.com/Community/forums/thread/6269.aspx</link><pubDate>Sun, 30 Mar 2008 09:46:30 GMT</pubDate><guid isPermaLink="false">8e485011-333f-425c-b84a-1febdb8bfab0:6269</guid><dc:creator>Jeremy</dc:creator><slash:comments>0</slash:comments><comments>http://developer.myspace.com/Community/forums/thread/6269.aspx</comments><wfw:commentRss>http://developer.myspace.com/Community/forums/commentrss.aspx?SectionID=23&amp;PostID=6269</wfw:commentRss><description>&lt;p&gt;Whoops. That&amp;#39;s what I get for not actually reading through the code.&lt;/p&gt;
&lt;p&gt;In that case you&amp;#39;re absolutely right - no checking is done. That code is nice, but to be honest, it&amp;#39;s not the best way to handle this situation. Two alternatives would be use an External IFrame-type canvas, which does the appending automatically (and does it at the&amp;nbsp;relay, where it&amp;#39;s signed, so there&amp;#39;s no way to fake an Id) or to use an HTML-response makeRequest instead of an IFrame.&amp;nbsp;The PHP file will return an HTML page, and you&amp;#39;d just dump&amp;nbsp;that response into the innerHTML of a div.&amp;nbsp;If you sign the makeRequest, it&amp;#39;ll have the owner and viewer ids appended automatically - you can&amp;#39;t hack them in through the javascript. To prevent a spoof to your sever, you can also sign the request and check OAuth at your end.&lt;/p&gt;
&lt;p&gt;The method above, like I said, is workable, but it doesn&amp;#39;t implement any security features. Sorry about saying that.&lt;/p&gt;</description></item><item><title>Re: Example: PHP show friends page</title><link>http://developer.myspace.com/Community/forums/thread/6264.aspx</link><pubDate>Sun, 30 Mar 2008 02:09:43 GMT</pubDate><guid isPermaLink="false">8e485011-333f-425c-b84a-1febdb8bfab0:6264</guid><dc:creator>Daniiiiiel™</dc:creator><slash:comments>0</slash:comments><comments>http://developer.myspace.com/Community/forums/thread/6264.aspx</comments><wfw:commentRss>http://developer.myspace.com/Community/forums/commentrss.aspx?SectionID=23&amp;PostID=6264</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Community/Themes/default/images/icon-quote.gif"&gt; &lt;strong&gt;Jeremy:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;
&lt;p&gt;And to the second question -- because the Ids are included in the basestring when the Signature is created, for someone to change them, they&amp;#39;d have to be able to produce a valid oauth_signature with the new values. To do &lt;i&gt;that&lt;/i&gt; they&amp;#39;d need your App&amp;#39;s security key.&lt;/p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;
&lt;p&gt;I think he meant this line:&lt;/p&gt;
&lt;pre&gt; document.getElementById(&amp;#39;frame&amp;#39;).src = &amp;quot;http://XXXXXXX/file.php?id=&amp;quot;+ viewerName;&lt;/pre&gt;
&lt;p&gt;What&amp;#39;s to stop someone going to eg. file.php?id=[some user with a private profile that has the app installed] to view a private user&amp;#39;s friends list? Or is there something I&amp;#39;m missing, some checking done?&lt;/p&gt;</description></item><item><title>Re: Example: PHP show friends page</title><link>http://developer.myspace.com/Community/forums/thread/6040.aspx</link><pubDate>Thu, 27 Mar 2008 18:51:19 GMT</pubDate><guid isPermaLink="false">8e485011-333f-425c-b84a-1febdb8bfab0:6040</guid><dc:creator>Simone</dc:creator><slash:comments>0</slash:comments><comments>http://developer.myspace.com/Community/forums/thread/6040.aspx</comments><wfw:commentRss>http://developer.myspace.com/Community/forums/commentrss.aspx?SectionID=23&amp;PostID=6040</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Community/Themes/default/images/icon-quote.gif"&gt; &lt;strong&gt;Daniel:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/p&gt;&lt;p style="font-style:italic;" class="MsoNormal"&gt;function dataLoadCallback(dataResponse) {&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;if (dataResponse.hadError())
{&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;alert(“Error”);&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;} else {&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;var viewerData = dataResponse.get(opensocial.DataRequest.PersonId.VIEWER).getData();&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;var viewerName = viewerData.getField(opensocial.Person.Field.ID);&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;document.getElementById(&amp;#39;frame&amp;#39;).src
= &amp;quot;http://&lt;span style="font-weight:bold;"&gt;XXXXXXX/file.php&lt;/span&gt;?id=&amp;quot;+ viewerName;&lt;/p&gt;



&lt;p style="font-style:italic;" class="MsoNormal"&gt;&amp;nbsp;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;}&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;}&lt;/p&gt;&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Daniel,&lt;/p&gt;&lt;p&gt;Thanks for the share agaiain , but I&amp;#39;m facing problem with this everytime I paste this code on my Canvas source it Either shows error as follows:&lt;/p&gt;&lt;p&gt;&lt;b&gt;1.Your source contains errors. Please correct and try again. &lt;/b&gt;&lt;/p&gt;&lt;table class="caja_table" id="canvas_caja_table" style="display:block;" cellpadding="10" cellspacing="10"&gt;

&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Message&lt;/th&gt;
&lt;th&gt;Line&lt;/th&gt;
&lt;th&gt;Column&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INVALID_IDENTIFIER&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Or 2. Just Iframe tag is shown on the canvas page of the application.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Formerly, as far as I knw, It&amp;#39;d worked once for me:&lt;/p&gt;&lt;p&gt;my Application is ready at :&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.unique-group.org/MYSPACEAPPS/NICKNAMES/" title="My Demo Application" target="_blank"&gt;http://www.unique-group.org/MYSPACEAPPS/NICKNAMES/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;There in application,I&amp;#39;ve provided the user_id param manually, but now what I want to do is pass user_id as something like&amp;nbsp; /index.php?user_id=viewer_id .But it is not getting.I&amp;#39;m stuck here.Please help me with.&lt;/p&gt;&lt;p&gt;thx,&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Example: PHP show friends page</title><link>http://developer.myspace.com/Community/forums/thread/5862.aspx</link><pubDate>Wed, 26 Mar 2008 16:58:10 GMT</pubDate><guid isPermaLink="false">8e485011-333f-425c-b84a-1febdb8bfab0:5862</guid><dc:creator>BlahBlah</dc:creator><slash:comments>0</slash:comments><comments>http://developer.myspace.com/Community/forums/thread/5862.aspx</comments><wfw:commentRss>http://developer.myspace.com/Community/forums/commentrss.aspx?SectionID=23&amp;PostID=5862</wfw:commentRss><description>&lt;p&gt;&amp;nbsp; Regarding the 20 friend limit, i seem to recall messing around with this a little while back.&amp;nbsp; All u need is a couple more parameters when calling the friends function..&lt;/p&gt;&lt;p&gt;Instead of..&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-style:italic;"&gt;$hFriends = $s-&amp;gt;friends($user);&lt;/span&gt; &lt;/p&gt;&lt;p&gt;use(where $friend_limit is your max number of friends u want returned)..&lt;/p&gt;&lt;p&gt;&lt;span style="font-style:italic;"&gt;$hFriends = $s-&amp;gt;friends($user,NULL,$friend_limit);&lt;/span&gt; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;i seem to remember there was a bug in the space.php that i had to change to get this to work.. i dont know if the client library has been corrected yet or which bit i had to change, so ill copy the whole friends function...&lt;/p&gt;&lt;p&gt;&lt;i&gt;public function friends($iUser,$page = null,$page_size = null,$list = null) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sQuery = &amp;#39;users/&amp;#39;.$iUser.&amp;#39;/friends&amp;#39;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $hParams = array();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( $page !== null ) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $hParams[&amp;#39;page&amp;#39;] = $page;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( $page_size !== null ) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $hParams[&amp;#39;page_size&amp;#39;] = $page_size;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( $list !== null ) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $hParams[&amp;#39;list&amp;#39;] = $list;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $this-&amp;gt;do_request($sQuery,$hParams);&lt;br /&gt;&amp;nbsp; }&lt;/i&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;hope this helps,&lt;/p&gt;&lt;p&gt;Paul&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Example: PHP show friends page</title><link>http://developer.myspace.com/Community/forums/thread/4579.aspx</link><pubDate>Fri, 14 Mar 2008 22:55:18 GMT</pubDate><guid isPermaLink="false">8e485011-333f-425c-b84a-1febdb8bfab0:4579</guid><dc:creator>Jeremy</dc:creator><slash:comments>0</slash:comments><comments>http://developer.myspace.com/Community/forums/thread/4579.aspx</comments><wfw:commentRss>http://developer.myspace.com/Community/forums/commentrss.aspx?SectionID=23&amp;PostID=4579</wfw:commentRss><description>&lt;p&gt;I don&amp;#39;t know much about the internal workings of the PHP Client Library, but I think, as of right now, you can only grab 20 friends at a time with it. I imagine at some point someone will fix that and put the fixed version up.&lt;/p&gt;
&lt;p&gt;And to the second question -- because the Ids are included in the basestring when the Signature is created, for someone to change them, they&amp;#39;d have to be able to produce a valid oauth_signature with the new values. To do &lt;i&gt;that&lt;/i&gt; they&amp;#39;d need your App&amp;#39;s security key.&lt;/p&gt;</description></item><item><title>Re: Example: PHP show friends page</title><link>http://developer.myspace.com/Community/forums/thread/4491.aspx</link><pubDate>Fri, 14 Mar 2008 17:21:57 GMT</pubDate><guid isPermaLink="false">8e485011-333f-425c-b84a-1febdb8bfab0:4491</guid><dc:creator>Shopit</dc:creator><slash:comments>0</slash:comments><comments>http://developer.myspace.com/Community/forums/thread/4491.aspx</comments><wfw:commentRss>http://developer.myspace.com/Community/forums/commentrss.aspx?SectionID=23&amp;PostID=4491</wfw:commentRss><description>What about the security risk of passing in a user id which can be passed in by anyone.&amp;nbsp; Do you do any kind of checking to verify that?&lt;br /&gt;</description></item><item><title>Re: Example: PHP show friends page</title><link>http://developer.myspace.com/Community/forums/thread/4298.aspx</link><pubDate>Fri, 14 Mar 2008 03:17:22 GMT</pubDate><guid isPermaLink="false">8e485011-333f-425c-b84a-1febdb8bfab0:4298</guid><dc:creator>jon.who</dc:creator><slash:comments>0</slash:comments><comments>http://developer.myspace.com/Community/forums/thread/4298.aspx</comments><wfw:commentRss>http://developer.myspace.com/Community/forums/commentrss.aspx?SectionID=23&amp;PostID=4298</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;This only shows the first 20 friends. How do I show all the friends?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Example: PHP show friends page</title><link>http://developer.myspace.com/Community/forums/thread/4149.aspx</link><pubDate>Thu, 13 Mar 2008 20:35:49 GMT</pubDate><guid isPermaLink="false">8e485011-333f-425c-b84a-1febdb8bfab0:4149</guid><dc:creator>J9</dc:creator><slash:comments>0</slash:comments><comments>http://developer.myspace.com/Community/forums/thread/4149.aspx</comments><wfw:commentRss>http://developer.myspace.com/Community/forums/commentrss.aspx?SectionID=23&amp;PostID=4149</wfw:commentRss><description>&lt;p&gt;Thanks for sharing!&lt;/p&gt;</description></item><item><title>Example: PHP show friends page</title><link>http://developer.myspace.com/Community/forums/thread/2088.aspx</link><pubDate>Wed, 27 Feb 2008 19:14:22 GMT</pubDate><guid isPermaLink="false">8e485011-333f-425c-b84a-1febdb8bfab0:2088</guid><dc:creator>Daniel</dc:creator><slash:comments>0</slash:comments><comments>http://developer.myspace.com/Community/forums/thread/2088.aspx</comments><wfw:commentRss>http://developer.myspace.com/Community/forums/commentrss.aspx?SectionID=23&amp;PostID=2088</wfw:commentRss><description>&lt;span&gt;&lt;/span&gt;So this is for all the Newbie out there.

&lt;p class="MsoNormal"&gt;I’m a Facebook app developer and only today I success on building
my first PHP Open Social app.&lt;/p&gt;

&lt;p class="MsoNormal"&gt;I will share it with you so all the newbies will get a good
start and the experts can comment my way and help me improve my knowledge on MySpace
Open Social.&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;This example set an Iframe on the canvas, get the user ID
using JS and load PHP page with the user ID (as parameter). In the PHP page I
use the PHP Client Library (&lt;a href="http://developer.myspace.com/Community/forums/t/157.aspx"&gt;http://developer.myspace.com/Community/forums/t/157.aspx&lt;/a&gt;)
to show the user parameters and his friends. &lt;/p&gt;

&lt;p style="text-decoration:underline;" class="MsoNormal"&gt;App Source:&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&amp;lt;iframe id=&amp;quot;frame&amp;quot; width=&amp;quot;800&amp;quot; height=&amp;quot;500&amp;quot;
frameborder=&amp;quot;0&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&amp;lt;BR&amp;gt;&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&amp;lt;div id=&amp;#39;message&amp;#39; style=&amp;#39;margin: 4px&amp;#39;&amp;gt;&amp;lt;/div&amp;gt;&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&amp;lt;script type=&amp;#39;text/javascript&amp;#39;&amp;gt;&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;function init() {&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;MYOS_TRACE = true;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;var os = opensocial.Container.get();&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;var dataReqObj = os.newDataRequest();&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;var viewerReq = os.newFetchPersonRequest(opensocial.DataRequest.PersonId.VIEWER);&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;dataReqObj.add(viewerReq);&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;dataReqObj.send(dataLoadCallback);&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;}&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;function dataLoadCallback(dataResponse) {&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;if (dataResponse.hadError())
{&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;alert(“Error”);&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;} else {&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;var viewerData = dataResponse.get(opensocial.DataRequest.PersonId.VIEWER).getData();&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;var viewerName = viewerData.getField(opensocial.Person.Field.ID);&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;document.getElementById(&amp;#39;frame&amp;#39;).src
= &amp;quot;http://&lt;span style="font-weight:bold;"&gt;XXXXXXX/file.php&lt;/span&gt;?id=&amp;quot;+ viewerName;&lt;/p&gt;



&lt;p style="font-style:italic;" class="MsoNormal"&gt;&amp;nbsp;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;}&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;}&lt;/p&gt;



&lt;p style="font-style:italic;" class="MsoNormal"&gt;&amp;nbsp;&lt;br /&gt;init();&lt;/p&gt;

&lt;p style="font-style:italic;" class="MsoNormal"&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;



&lt;p style="text-decoration:underline;" class="MsoNormal"&gt;&amp;nbsp;The PHP page:&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-style:italic;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;lt;meta http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=utf-8&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;lt;title&amp;gt;Untitled Document&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;lt;?php&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $user = $_GET[&amp;quot;id&amp;quot;];&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; require_once(&amp;#39;Space.php&amp;#39;);&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; $key = &amp;#39;&lt;span style="font-weight:bold;"&gt;XXXXXXXXXXXXXXXXXXXXXXXX&lt;/span&gt;&amp;#39;;&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; $secret = &amp;#39;&lt;span style="font-weight:bold;"&gt;XXXXXXXXXXXXXXXXXXXXXXXXX&lt;/span&gt;&amp;#39;;&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; $s = new Space($key,$secret);&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; $hProfile = $s-&amp;gt;profile($user);&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; foreach($hProfile as $k =&amp;gt; $value){&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo &amp;quot;&amp;lt;BR&amp;gt;&amp;lt;strong&amp;gt;&amp;quot;.$k.&amp;quot;&amp;lt;/strong&amp;gt;:&amp;quot;.$value;&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; echo &amp;quot;&amp;lt;hr&amp;gt;Friend list&amp;quot;;&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; $hFriends = $s-&amp;gt;friends($user);&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; foreach($hFriends[&amp;quot;friends&amp;quot;] as $friend){&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo &amp;quot;&amp;lt;BR&amp;gt;&amp;lt;u&amp;gt;Frend&amp;lt;/u&amp;gt;&amp;quot;;&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach($friend as $k =&amp;gt; $value){&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo &amp;quot;&amp;lt;BR&amp;gt;&amp;lt;strong&amp;gt;&amp;quot;.$k.&amp;quot;&amp;lt;/strong&amp;gt;:&amp;quot;.$value;&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;?&amp;gt;&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br style="font-style:italic;" /&gt;&lt;span style="font-style:italic;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I’m not secure if Iframe is the best way and hopping to get
comments from &lt;span style="font-size:10pt;font-family:Tahoma;"&gt;others.&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;Regards,&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span style="font-size:10pt;font-family:Tahoma;"&gt;Daniel&lt;/span&gt;&lt;/p&gt;</description></item></channel></rss>