MySpace Dev. 5: Importing RSS via Flash
Well, it’s been a while. At this point, everything else on your profile should be complete: we’ve built an entirely custom profile using the div overlay method and brought back audio using the open-source XSPF audio player. In fact, we could easily stop here and call it quits. After all, it’s been a lot of work, hasn’t it?
Some of us, however, just aren’t satisfied; MySpace is the biggest blog network, and although the majority of us have blogs (or other people’s blogs) somewhere, it was previously impossible to tie the MySpace blogs to our ones elsewhere (and, in fact, it still is.)
At first, I just considered copying hyalineskies entries into MySpace, but extracting that content and placing it on the div overlay would have required a lot of CSS z-index trickery that is subsceptible to cross-browser failure. I decided that it would make more sense to automate the process, and to do so, I would have to write a bit of Flash code to access the hyalineskies RSS feed. The problem in doing so was that I didn’t know Flash (and I truly mean not one bit of it.)
I attempted to find an off-the-shelf solution, but nothing worked the way that I wanted my RSS reader to. I finally gave in and opened my copy of Flash 8. Five and a half hours of tutorials, Flash references, and crappy ActionScript later, I had build a .swf to read in the <description> of the RSS feed. I’m not going to go into the specifics of building the Flash application  that would take a four-part tutorial of its own  but I have released its code in the final MySpace Hack Pack at the bottom of this page. However, it is important to configure your server (and your MySpace profile) properly.
Preparing WordPress for Flash access
No matter what blog software you’re using, you will need to give the Flash application explicit permission to read the RSS feed from your server. Flash, unlike RSS readers, first searches the root directory of a domain (in this case, hyalineskies.com) for an XML file named crossdomain.xml. If crossdomain.xml doesn’t exist, then Flash will kill itself and not load the feed. It’s an interesting (read: seemingly kind of stupid) default security option. Make a file named crossdomain.xml on your root directory and copy/paste this XML construct:
<cross-domain-policy>
<allow-access-from domain=”*.myspace.com” />
</cross-domain-policy>
For most default blog installations on your server, this should be good enough  that means this should work with just about any RSS feed on the server with crossdomain.xml in its root directory. Unfortunately those running Steve Smith’s WordPress FeedBurner Plugin will run into some trouble: your Flash RSS reader will get redirected to FeedBurner, where Flash will then search for crossdomain.xml (which doesn’t exist on FeedBurner’s root. Plus, your Flash reader would taint your FeedBurner statistics anyway, something which I’m not particularly fond of.) If you’re good with Apache and mod_rewrite, you may be able to edit FeedBurner’s code in your blog directory’s .htaccess. I personally couldn’t find a RewriteCond that worked (Flash sends the browser’s user agent as its own,) so I found an easier hack for us running FeedBurner: duplicate WordPress’s RSS generator.
From the server shell or your FTP client, duplicate wp-rss2.php and rename the duplicate to something random, such as xyzzy_flashrss2.php. Calling this PHP file will function the same as calling the original wp-rss2.php, where FeedBurner gets its feed, yet the user won’t stumble upon this duplicate file. I spent at least an extra hour trying to hack around FeedBurner to get this to work properly, and this is the easiest solution (although, like the rest of this reader, lacks quite a lot of elegance.)
Building the <embed> tag
Now that we have cross-domain XML restrictions freed up on our own server, it’s time to add the .swf <embed> tag into the MySpace profile. Upload your swf to your server. Your <embed> tag should be in this format:
(where your_uri is the URI to your blog, your_flash.swf is the name of the RSS reader swf on your server, and uri_to_rss.php is the URI to your RSS feed / RSS generator page.)
Note that the GET query string (everything after the ? in the URL) is necessary for the Flash application to find and read your RSS file. Preview your <embed> in MySpace, and you should see your feed fade into place (see my profile page for an example.) If it doesn’t work, check your URIs and make sure you’ve followed all the applicable steps. (If you made edits to the code, make sure that you’ve looked over that, too; you can debug XML from remote sites without cross-domain restrictions if you set your computer’s Flash Player options properly.)
Once everything works, you’re done. You’ve built a custom profile from scratch and effectively redesigned MySpace to fit your own style. You have unrestricted music and your own blog posts. You have the freedom to link anywhere. It feels good, doesn’t it?
If you’re stuck, or if you need a base to start from, I’m releasing all of my code in a MySpace Hack Pack below, under a Creative Commons by-nc-sa licence. I’ve cut all of the images so you can’t just upload my profile to your own page without some heavy tweaking.
Since MySpacers seem to be a somewhat illiterate mass at times, I’ll say it here and delete comments or e-mails asking for help in the “hey, do this for me for free” way. Support for this is at my sole discretion, only via e-mail to eston@hyalineskies.com. If you post here saying you’re stuck, I will delete your comment. If you have improvements to the codebase (come on Flash coders, step up here!) or your own hackes, please do leave them as comments so I can take a look at them. Also, if you use these tricks and build something that has some design sensibility, add me as a friend on MySpace and I may showcase you as a good use of this tutorial. For now, however, it’s time to build. Show those MySpace “designers” what design really is.
Article Abstract
Posted 14 July 2006. Approx. 1,090 words.
We finish up the MySpace redesign with a Flash-based RSS reader badge.
Download Information
Download MySpace Hack Pack 1.0
A complete div overlay development template for MySpace, including a music player and RSS reader.
From Our Sponsors
Comments
Comments RSS Feed for “this post”
Dick, I’m definitely loving the fact that you guys are going to add the crossdomain.xml file to your site. This will add a lot more support for FeedBurner feeds within Flash, and FeedBurner’s statistics tools are great for monitoring feeds in general. I can see packages like TotalStats PRO helping out a lot if people are building the feeds further into their sites.
Thanks for posting this. It works great!
Damn, you beat me to it! Ahh well, good work man!
Great job on all of this if i was not one to always redo my profile and “design” everytime I felt like it i would be really interested in placing something like this on my site, however, I am not much of a blogger and one of my other myspace profiles i designed to be a blog area so until i start up elsewhere this wont be of much help yet it was very informative i applaud you
Hey Eston, everything looks great with the code, but I havent gotten it to work. I have also checked your myspace site and it doesnt appear to be working their either. Whats going on ? Did MySpace change something ?
Rob, mine was down because I had forgotten to transfer my crossdomain.xml and RSS feed to the server. Most likely either you aren’t setting up your crossdomain.xml or RSS feed URI properly in your embed tag. If you want, shoot me an e-mail with your XML file, your XML file location, and the embed tag you’ve written.
Do you have any suggestions/reccommendations for someone using Blogger?
Miek (or Mike), I think your best bet when using Blogger to get an RSS Flash reader to work would be to build a PHP script on a server you have control over (so you can place crossdomain.xml) that extracts the blogger feed. It could be really simple and use cURL. If you’re really interested in getting the reader working with Blogger, I could build this little PHP script — it’s only a few lines at most. It would require you to have access to some server space (and a server’s root directory) somewhere.
Just found your tutorial today and will try it at some point. As for RSS/Flash…this offers a lot of options for making a good MySpace Comments system. Just use a WordPress Post/Comments and a PHP/RSS script that is a feed of just that post’s comments. can be the comment and the author name/ID…
I too made an rss feed for my mySpace. Check it out at http://www.myspace.com/craighateseverything
I had a look at your actionscript in the mySpace hack pack. Nice. I liked the function that gets any node that you pass it. Not bad for 5 hours of flash!
Think I might have to try the div overlay for my myspace. Looks super nice.
I am a novice. I did all the above and it works great. One thing I was wondering though..do you know where there is a guide to configure the flash file..as I want it to include dates and last 5 posts.
I’m stuck.
This is a great idea. I was trying to combine this with a friends feed from Feed43 (per 5ThirtyOne) to pull my friends list into a div overlay, but MySpace has now disabled linking from Flash files (with Flash 9 and). Of course, this means you can’t link to your entire blog post from inside Flash. More info at Mashable.
Hey there
Nice tutorial. But I’ve got a problem with the link.
It doesn’t work in Internet Explorer.
Any workarounds ?
greetings
ruffy
This is a great tool. I can’t wait to hack it now. If you use blogger, run it through feedburner and tweak it to RSS.
Wow - I wish I knew what the hell this means… lol. I have been trying to find a working RSS reader to put up on a rather large group page on Myspace - 25,000 members - I can’t offer money, but I can offer promotion. If someone can get as RSS reader to work on a Myspace group - let me know and you can put a banner to your business portofolio up there with the reader. I know lots of people want RSS readers so if someone can make it happen - Lots of others will be interested.
Please email me at
x.heretic@gmail.com if interested
Well thank you very much for those procious researches. It is very usefull and I havn’t find such a good tut on google about this topic ever. Very highend !!
Thanks again, Alex from France
By the would you know how to connect .xml imgages file that runs with a flash .swf on Myspace.
My server will not allow me to use PHP code to download information from another server, I’ve had this trouble for a long time — any recomendations, other than switching servers?
Great! Great! Great!
This is the only Way to get a RSS Feed on MySpace. After a little modification my RSS Feeder on MySpace is looking like this: (two entries and smooth scroller ;) )
http://www.myspace.com/solverat
Thx a lot, men!
Excellent - this works brilliantly… took me ages to find something that would do the trick. Thanks so much!
I’ve got it running at http://myspace.com/tomkerswill but I’m going to have a look at the code and use it to display an events feed too.
Cheers!
Tom
Is it possible to make this work on a myspace page hosting the .swf reader on a free host like fileden.com??? I can’t seem to get this working on my page and when I enter the code and save it myspace seems to change or add things to the code as if it doesn’t like it.
Also the RSS feed for a myspace blog. How do I find that to enter into the embed tag?
Yet another hack:
I can still see your buddies if I minimize my screen and scroll over. because it simply is an overlay and you are not hiding whats underneath…
FIX:
put this in your interests:
table table, table table table table, table table{background-color:transparent;width:300px;border:0px;}
div, table, tr, td, th{background-color:transparent;text-align:left;border:0px;}
a.navbar, font, .whitetext12, .btext, .orangetext15, .redbtext, .redtext, .blacktext12, .lightbluetext8, strong, .blacktext10, .nametext, div b font font, div font font u, table table table table, table table table table td.text, td.text td.text table, table.contacttable {display:none;}
div table form tr td,td.text table,a.text, table div font a, table div div,{visibility:hidden;display:none}
td.text table table {display:inline; visibility:visible;}
embed{position:absolute;top:0px;left:0px;display:block;width:0px; height:0;}
table tbody td table tbody tr td.text table {visibility:hidden;}
table tbody td table tbody tr td.text table table, table tbody td table tbody tr td.text table table tbody td.text {visibility:visible;}
Thanks for the tut! But when I copy the embed code into the Myspace code, it strips out the rssFeed variable eg. it ends up like:
http://foo.com/rssReader.swf?rssFeed=”
Any ideas? Thanks again for the tut
I’ll give it a go..
Mr. Eston,
This work is extremely useful and to share it with us deserves a medal of precious metal - should I own one to give.
My query:
I can see the reader working well on your profile and on that of (for example) http://myspace.com/tomkerswill
My simple thought was to get the reader working with the same code but different feed info.
To that end I had a look at the source code for Tom Kerswill’s page, duplicated the relevant bit and tried it with the different feeds:
http://seachd.typepad.com/blog/rss.xml
and more interestingly with this feed [a "dapper" feed created from a (test) myspace group forum] with the idea of feeding info from a myspace group forum into my myspace profile:
Both feeds create standard RSS 2 files, but for some reason I get the (now dreaded) “Feed currently unavailable” message.
Is the reader sensitive to the exact nature of the feeds (RSS1 vs RSS2 vs ATOM?)
OR
Am I an idiot (in which case could you advise me as to what kind of idiot I might be)
With kindest regards,
Simon Miller
Writer-Director
Seachd: The Inaccessible Pinnacle
A film in Scottish Gaelic
The variety of idiot that I am remains unknown. However I have some more information on my previous query.
If I pass either one of these through feedburner and feed the feedburner feed to your rssReader then it works.
I believe this has solved feed problems.
Since dapper allows me to create feeds of information from virtually any part of my MySpace (although it needs improvement), I’m going to try and create a set of flash widgets to sit on other sites as well as providing a summary of MySpace Forum activity on my own MySpace profile. Sound good?
What kind of idiot was I?
With kind regards,
Simon Miller
P.S. Have a look at http://www.seachd.com/poster - a flash-based design your own poster application. Nice?
OK, so here’s the code:
Go to the forum | Start a new topic
You get the idea with the duplication of your original code to add another feed and show addition content from both feeds.
It works fine in firefox, but no information from feeds makes it to screen in safari and explorer. Have you experienced anything like this before?
With kind regards,
Simon Miller
Ok, I got this to work with both Blogger and Feedburner.
You need to use the RSS link to your blog, which is:
http://YOURBLOG.blogspot.com/feeds/posts/default?alt=rss
Stick that in feedburner, make a new feed and then put it in your myspace - which actually changes the whole code to this:
Yeah, a little different. But it works. Except for the really annoying “View Entry” and “View Comment”
I think those might be embedded in the Flash itself, but it won’t open in Windows Flash MX 2004.
Has anyone edited the Flash File yet?
Eston,
I have tried the code you use on your own myspace page on my own page and got the rather unexpected “stolen profle” message. Assume just a bit of fun, since am actually using the hack pack files, editing the flash and trying to improve…
Here’s what I have discovered (and Chris’ll be interested in this).
* I’ve created feeds using dapper from a myspace forum
* I’ve then put them through feedburner
* I’ve managed to get two different feeds working into one flash file (needed more rss fields than dapper can create in one feed)
* I’ve edited your nice flash and created a mocked-up myspace forum to take the feed
HERE’S THE PROBLEM
* For some reason the feeds get into the flash fine in firefox, but they don’t in safari and explorer (Chris - do you have any problems like this?)
HOWEVER
* Your feed http://hyalineskies.com/wp-rss2flash.php works fine on all browsers.
WHAT IS THE DIFFERENCE BETWEEN THESE FEEDS:
http://feeds.feedburner.com/MySpaceSeachdForum
http://feeds.feedburner.com/SeachdMySpaceForumPosts
AND YOUR FEED?
And why would they work on firefox and not the other browsers?
Any clues?
Chris - yes I’ve been making new flash stuff, getting more blog/feed entries and actually combining two feeds in the same doc. All works fine - but not on myspace across all browsers….
With kind regards,
Simon
Interestingly, when a test the code directly out of dreamweaver I actually do get the feed into the read in safari as well as firefox, but NOT in explorer.
See http://www.seachd.com/test.html
You should see the example working in firefox and safari, but not in explorer.
This is killing me - any ideas?
With kind regards,
Simon Miller
I had the same problem! At first, I solved it by adding ?alt=rss to the end of the feed, but then that stopped working… but now xml works again! I have no idea why.
So you basically need to add that to the end of your link in myspace.
http://feeds.feedburner.com/SeachdMySpaceForumPosts?format=xml
http://feeds.feedburner.com/MySpaceSeachdForum?format=xml
That should work in IE. I don’t know about Safari.
Hey Eston, I’m having trouble with the RSS reader reading my “tags” of wordpress. Do you know of a way to fix that?
@igor: dude, be happy that it works!
I was hoping to find a tutorial somewhere on how to get your existing myspace blog section into a flash layout. I also I want to know how to get that new “mood” update into flash. This is my top priority…the icing on the cake would be to get all my other info dynamically into flash like lovemyflash.com does it but I can always put this content in myself since I rarely update that. If anyone has any info about this please email me at prpoisonx@yahoo.com
Nice tutorial by the way but maybe I missed something I thought it was about importing your myspace blog into flash through RSS somehow? Thanks anyway apparently it’s useful for 3rd party blogs.
Hello, I have been looking for a way to get my Netflix RSS feed onto my MySpace page, and hope to modify your code to get this done. If you have heard of anyone that has accomplished this, I would be eternally grateful for a push in the right direction.
I love to concept of this post. Easy to use and implement. I was looking for an RSS feed for my MySpace profile. Thanks for this hack!
Eston you are everything we’ve hoped for!
you are very impressive.
maraming salamat. <3
Write Your Own Comment
To preserve legitimate discussion, please use your real name and email address.
Your email address will not be published. Derogatory comments will be deleted.
External Discussion
Displaying the only trackback.
RSS Feed an MySpace auf…
Ich hasse MySpace. Aber natürlich muss man dabei sein. Seit ein paar Tagen versuche ich ein Flash RSS Feeder auf Myspace zu quetschen, welcher…
This is very cool. You will delighted (or possibly saddened) to learn that we are going to be adding the crossdomain.xml file to FeedBurner root so that we can remove some of the friction for this kind of thing and do some flash-y stuff of our own down the road. I think you are actually at the forefront of people doing a lot of interesting things with flash and feeds, especially in social media platforms like MySpace. Very cool. Great job.