
{"id":1218,"date":"2010-01-06T09:00:48","date_gmt":"2010-01-06T08:00:48","guid":{"rendered":"http:\/\/www.matthijskamstra.nl\/blog\/?p=1218"},"modified":"2010-07-17T15:35:53","modified_gmt":"2010-07-17T14:35:53","slug":"twitter-rss-reader-part-2","status":"publish","type":"post","link":"https:\/\/www.matthijskamstra.nl\/blog\/2010\/01\/06\/twitter-rss-reader-part-2\/","title":{"rendered":"Twitter RSS reader &#8211; part 2"},"content":{"rendered":"<div class='highlight'>This is a &#8220;must-read&#8221; update for <a href=\"http:\/\/www.matthijskamstra.nl\/blog\/index.php\/2009\/12\/30\/twitter-rss-reader-in-flash-as3\/\">twitter rss reader in flash as3<\/a>.<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.matthijskamstra.nl\/blog\/wp-content\/uploads\/error_flash_debugplayer.jpg\" alt=\"\" title=\"flash debugplayer error\" width=\"488\" height=\"223\" class=\"alignnone size-full wp-image-1221\" srcset=\"https:\/\/www.matthijskamstra.nl\/blog\/wp-content\/uploads\/error_flash_debugplayer.jpg 488w, https:\/\/www.matthijskamstra.nl\/blog\/wp-content\/uploads\/error_flash_debugplayer-300x137.jpg 300w\" sizes=\"auto, (max-width: 488px) 100vw, 488px\" \/><br \/>\n<em><a href=\"#dutch_error\">read here<\/a> the complete (dutch) error message<\/em><\/p>\n<p>Stupid, stupid, stupid, I already knew this: <strong><a href=\"http:\/\/www.macromedia.com\/devnet\/flash\/articles\/fplayer_security_03.html\">Flash cross-domain security<\/a><\/strong>.<br \/>\nWhich simple says that it&#8217;s not allowed to &#8220;get&#8221; anything from another website unless the server has a <a href=\"http:\/\/www.adobe.com\/devnet\/articles\/crossdomain_policy_file_spec.html\"><code>crossdomain.xml<\/code><\/a>.<br \/>\nThe nasty part is that, while you are testing in Flash IDE nothing goes wrong. So I only bumped into this when I put it on my server&#8230;<\/p>\n<p>So what to do?<\/p>\n<ol>\n<li>Ask Twitter to change there <code>crossdomain.xml<\/code> and add my domain&#8230;&#8230; (is this really an option?)<\/li>\n<li>Find something around the crossdomain security from Flash<\/li>\n<\/ol>\n<p>Luckily solution two is the easiest one: use a proxy to get the data we want.<br \/>\nBecause PHP doesn&#8217;t have the same restrictions as Flash has we will be using a proxy.php. <\/p>\n<p>This is how it works: Flash wants a <code>crossdomain.xml<\/code> if you &#8220;get&#8221; data from another server, but if you &#8220;get&#8221; data from the same server there is no problem. So we will be asking the <code>proxy.php<\/code> to &#8220;get&#8221; the xml\/rss and serve it to Flash.<\/p>\n<p>So instead of loading the data directly from Twitter<br \/>\n<code>http:\/\/twitter.com\/statuses\/user_timeline\/27657030.rss<\/code><br \/>\nWe will be using the proxy instead<br \/>\n<code>http:\/\/yoursite.com\/xml_proxy.php?url=http:\/\/twitter.com\/statuses\/user_timeline\/27657030.rss<\/code><\/p>\n<p>I didn&#8217;t write the proxy myself:<br \/>\nThe proxy that I used can be found here: <a href=\"http:\/\/xmlrpcflash.mattism.com\/proxy_info.php\">http:\/\/xmlrpcflash.mattism.com\/proxy_info.php<\/a> (it has some extra explanation about the subject )<br \/>\nThis proxy can be use for all sorts of xml, and any server.<\/p>\n<p>As always I&#8217;m reinventing the wheel: this group needed a specific solution but is nice to read more about it:<br \/>\n<a href=\"http:\/\/woveninteractive.net\/2009\/02\/twitter-in-flash-getting-past-the-securityerrorevent\/\">http:\/\/woveninteractive.net\/2009\/02\/twitter-in-flash-getting-past-the-securityerrorevent\/<\/a><br \/>\nThey wrote something similar, but a proxy more specific suited for twitter and the use of <a href=\"http:\/\/code.google.com\/p\/twitterscript\/source\/checkout\">twitterscript<\/a>.<\/p>\n<div class=\"update\"><strong>Update #1:<\/strong> I found another proxy.php (I really don&#8217;t think you need another, but choices are nice \ud83d\ude00 ).<br \/>\n<a href=\"http:\/\/www.abdulqabiz.com\/blog\/archives\/2007\/05\/31\/php-proxy-script-for-cross-domain-requests\/\">PHP Proxy Script for cross-domain requests<\/a>\n<\/div>\n<div id=\"dutch_error\">\nSorry for the dutch error&#8230; I have a dutch version of XP (not my choice)<br \/>\n<code><br \/>\nError #2044: Niet-afgehandelde securityError:. text=Error #2048: Schending van beveiligingssandbox: http:\/\/emceekay.nl\/paper\/flash\/twttr.swf kan geen gegevens laden van http:\/\/twitter.com\/statuses\/user_timeline\/27657030.rss.<br \/>\n\tat nl.emceekay.twttr::TwttrBase\/getFeed()<br \/>\n\tat nl.emceekay.twttr::TwttrMain()<br \/>\n<\/code>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This is a &#8220;must-read&#8221; update for twitter rss reader in flash as3. read here the complete (dutch) error message Stupid, stupid, stupid, I already knew this: Flash cross-domain security. Which simple says that it&#8217;s not allowed to &#8220;get&#8221; anything from another website unless the server has a crossdomain.xml. The nasty part is that, while you [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,3],"tags":[408,398,337,338],"class_list":["post-1218","post","type-post","status-publish","format-standard","hentry","category-as3","category-flash","tag-as3","tag-flash","tag-proxy","tag-proxy-php"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts\/1218","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/comments?post=1218"}],"version-history":[{"count":10,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts\/1218\/revisions"}],"predecessor-version":[{"id":1252,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts\/1218\/revisions\/1252"}],"wp:attachment":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/media?parent=1218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/categories?post=1218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/tags?post=1218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}