Introduction: Chumby RSS Reader
Chumbies are are awesome. RSS feeds are awesome. Why not combine the two? No, the double awesomeness won't hurt anyone, really. The reason is that flash is hard for the unexperienced. Here is a simple way to do it with an already-written program.
I will model it with Instructables, and you should be ready to adjust it according to your needs!
Thanks ewilhelm for the photos!
I will model it with Instructables, and you should be ready to adjust it according to your needs!
Thanks ewilhelm for the photos!
Step 1: Make Sure You Can Compile Flash!
If you have a Flash developer IDE (I.E. Flash MX), NOT JUST A FLASH PLAYER, then you are all set. If not, look around. If you are a student, the school may have it, someone around work may have it.
If not, I'm sure a group of flash-makers will form in the comments and will be happy to do it for you.
NOTE: My photos were taken on Flash Pro 8, so it may look slightly different than what you are using, but the basic principles are the same.
If not, I'm sure a group of flash-makers will form in the comments and will be happy to do it for you.
NOTE: My photos were taken on Flash Pro 8, so it may look slightly different than what you are using, but the basic principles are the same.
Step 2: Add Some Code!
I grabbed the reader that was on the Chumby Wiki, and there was a problem with it. It read the images from the "media:content" tag, instead of finding the image in the description.
To get around that, I added some code.
Under Actions:Frame 1, wayyy at the bottom, there will be a function "load movie"
Replace that, and everything below it with this:
To get around that, I added some code.
Under Actions:Frame 1, wayyy at the bottom, there will be a function "load movie"
Replace that, and everything below it with this:
function GetImage(des){ var del:Array ; del = des.split('<img src="'); des = del[1]; var img:Array; //If the image tag usually comes width and hieght tages, change // '"/>' to 'width="' or 'hieght="' if the hieght comes first. img = des.split('"/>'); var image:String; image = img[0]; return(image);}function GetDes(ddd){ //Same varibles, I guess I'm lazy :-) BUT IT WORKS! thing = ddd.toString(); var del1:Array; del1 = thing.split('.jpg"/>'); var des2:String; des2 = del1[1]; var img1:Array; img1 = des2.split("<br/>"); var image1:String; image1 = img1[0]; return(image1);}proxy1._visible = false;function loadItem(item) { g_currentItem = item; // // fill in the text fields from the RSS item // title.text = item.firstValueOfType('title'); var descripti:String; //descripti is the unprocessed description. descripti = item.firstValueOfType('description'); description.text = GetDes(descripti); author.text = "by "+item.firstValueOfType('author'); dateStr.text = "updated "+item.firstValueOfType('pubDate'); var descrip:String; descrip = item.firstValueOfType('description'); var url:String; url = GetImage(descrip); proxy.unloadMovie(); attachMovie('proxy','proxy',1,{_x:proxy1._x,_y:proxy1._y,url:makeURL(url)})
Step 3: Some More Code
Now we need to add the following code to resize your image.
This needs to go under the actions for the instance "proxy1", not the frame 1 actions for the symbol "proxy"
(In my image, there are some differences, noted w/ photonotes)
changed code to be more efficient!
onClipEvent(data){ if (this._width!=80) this._width = 80; if (this._height!=60) this_height = 60;}
This needs to go under the actions for the instance "proxy1", not the frame 1 actions for the symbol "proxy"
(In my image, there are some differences, noted w/ photonotes)
changed code to be more efficient!
Step 4: Let's Get Started!
First, we need to pick our RSS feed. Find the link to it, and the copy-and-paste the link into the following line.
Next, take the base url (i.e: https://www.instructables.com/ from https://www.instructables.com/tag/type:instructable/rss.xml) and add "crossdomain.xml" to the end of it. (So it would be https://www.instructables.com/crossdomain.xml).
Type that in the Address Bar of your browser. If you get a page that says something like :
You are good. If you get an error message, complain to the webmaster of the site, and say that they should add it so that flash files can access their content. Give the example of an flash RSS reader. If you want to read up on it, go here (Who'd know there would be a whole site on the matter???)
Next, take the base url (i.e: https://www.instructables.com/ from https://www.instructables.com/tag/type:instructable/rss.xml) and add "crossdomain.xml" to the end of it. (So it would be https://www.instructables.com/crossdomain.xml).
Type that in the Address Bar of your browser. If you get a page that says something like :
<cross-domain-policy><allow-access-from domain="*"/></cross-domain-policy>
You are good. If you get an error message, complain to the webmaster of the site, and say that they should add it so that flash files can access their content. Give the example of an flash RSS reader. If you want to read up on it, go here (Who'd know there would be a whole site on the matter???)
Step 5: Check the Feed
Open up the RSS feed in your browser, and save it to a disk. Now open it up with Notepad or an equivalent.
Check it out, the main thing we are concerned about is the images.
If inside the description tag looks something like this:
You're set. Mainly, just look for the <img> tag at the beginning, because the current code cuts off everything after it.
If not, please point out a site that puts it in the middle or end, and I will gladly make an upgrade.
Check it out, the main thing we are concerned about is the images.
If inside the description tag looks something like this:
<description><![CDATA[<img src="http://blahplace.com/image.jpg"/> DESCRIPTION]]></description>
You're set. Mainly, just look for the <img> tag at the beginning, because the current code cuts off everything after it.
If not, please point out a site that puts it in the middle or end, and I will gladly make an upgrade.
Step 6: Publish and Upload!
Now, you can play around with the images if you want, but DO NOT delete the gray box! However, its best to change it to a 80x60 square outline.
I added the Instructables logo, its a nice touch!
Then you can move the textboxes around, resizing them to take advantage of the space.
When you are done, hit control+Enter (on Windows) to preview your movie, make sure it works. If it says that there was some security error just ignore it.
Now on the Chumby site, you can upload the widget, and then add it to your widget mix. If you want, you can verify it will work on the Virtual Chumby.
And shortly, it will be on your Chumby! Congratulations!
I added the Instructables logo, its a nice touch!
Then you can move the textboxes around, resizing them to take advantage of the space.
When you are done, hit control+Enter (on Windows) to preview your movie, make sure it works. If it says that there was some security error just ignore it.
Now on the Chumby site, you can upload the widget, and then add it to your widget mix. If you want, you can verify it will work on the Virtual Chumby.
And shortly, it will be on your Chumby! Congratulations!