SwishTalk.com
 
#1   RSS News Feed Help  

Name: 
mwp
Status: Offline
Rank: Registered User
Posts: 26
Old 04-18-2005, 04:34 PM Reply With Quote


Hi folks,

I am trying to make a swishmax movie that will load an XML file of an RSS news feed. I've searched lots of other topics before you ask, and I've tried every single method they suggest but still no luck.

Can some kind chappie please have a look at THIS XML file from BBC News and try to suggest a script that I can use to load it into a dynamic text box?

I would really appreciate any help anyone could give - thanks very, very much!

mwp
               
 
View Public Profile Send a private message to mwp Find all posts by mwp Add mwp to Your Contacts
#2    
 
mobosof's Avatar

Name: 
mobosof
Status: Offline
Rank: Super Moderator
Posts: 15,970
Mood: wow warlock will...grrrr
Old 04-22-2005, 01:31 PM Reply With Quote


http://www.magicrss.com/syndicate/download.cgi
dont know if this helps..or how you can get it into max..you can embed the java into your html though?

http://www.feeddirect.com/cgi-local/...and=feeddirect

or here?
               

Last edited by mobosof; 04-22-2005 at 01:41 PM..
 
View Public Profile Send a private message to mobosof Visit mobosof's homepage! Find all posts by mobosof Add mobosof to Your Contacts
#3    
 
swish0r's Avatar

Name: 
swish0r
Status: Offline
Rank: Registered User
Posts: 231
Old 04-24-2005, 09:18 AM Reply With Quote


I didn't even try to load a .xml file into a text box, because I wasn't even able to load the .xml file into a sprite.

If anyone knows how to load the rss feed from joblo (xml) into a swishmax file, then please help me .

I think, it isn't possible to load an xml file from another domain into the movie, so I downloaded the xml file and tried to load it with:

onFrame (15) {
setLabel("start");
channel = new XML();
channel.load("rss.xml");
channel.ignoreWhite = true;
channel.onLoad=extractData;
}

but this didn't work.

But even if I could load it, I still would have to know how it is possible to load it from another domain. I know this can be done using a php file, but I don't know how.

If anyone has a working example, please share it. I've done a search and I've seen that there are other users with the same or a similar problem. The help/links provided there didn't help me to solve my problem.

Thank you and enjoy the remaining hours of the weekend !
               
 
View Public Profile Send a private message to swish0r Find all posts by swish0r Add swish0r to Your Contacts
#4   Similar problem some time ago  
 
gsb's Avatar

Name: 
gsb
Status: Offline
Rank: Registered User
Posts: 771
Mood: Always getting better.
Old 04-24-2005, 01:06 PM Reply With Quote


I too had some trouble with RSS news feeds and blogs and the cross-domain issues.

I opted for a php solution.
Swish would send the php script the desired news feed link.
It would get the file AND process the XML passing back to Swish a compatible HTML text file.

This works well except for some of the WAY-long links often passed in the XML feeds.
The flash player truncates long anchor tag HREF's, so caution.

gsb
               
 
View Public Profile Send a private message to gsb Find all posts by gsb Add gsb to Your Contacts
#5    
 
swish0r's Avatar

Name: 
swish0r
Status: Offline
Rank: Registered User
Posts: 231
Old 04-24-2005, 01:59 PM Reply With Quote


Hi gsb and thank you for the tips.
I did some research today and read about some php scripts which are able to convert rss feeds to html. The problem is, I don't know much about php, so it is really hard to work with the files I found.

My questions: Is there an existing php file which does what you were proposing ? If not, where can I get infos on how to create one ? Which commands should be put in there ?
After I have this php file, how do I get it to work and how can I import the generated content into my swishmax file ?
(My goal is: button ("news") -> click -> rss content is loaded into a sprite or text box).

P.s.: I also found one of your old posts in there you posted a link to an example file, but this link doesn't work anymore.
               
 
View Public Profile Send a private message to swish0r Find all posts by swish0r Add swish0r to Your Contacts
#6    
 
gsb's Avatar

Name: 
gsb
Status: Offline
Rank: Registered User
Posts: 771
Mood: Always getting better.
Old 04-24-2005, 02:44 PM Reply With Quote


"I also found one of your old posts in there you posted a link to an example file, but this link doesn't work anymore."

...yeah. My server was removed back in Nov. with all my links and code. Argh....

But I may find an old version for you at home - I'm at work just now.

gsb
               
 
View Public Profile Send a private message to gsb Find all posts by gsb Add gsb to Your Contacts
#7    
 
swish0r's Avatar

Name: 
swish0r
Status: Offline
Rank: Registered User
Posts: 231
Old 04-24-2005, 03:02 PM Reply With Quote


But I may find an old version for you at home - I'm at work just now.

Thank you for looking into it in advance and have a nice day - despite the work!

P.s.: I'm leaving for work now too .
               
 
View Public Profile Send a private message to swish0r Find all posts by swish0r Add swish0r to Your Contacts
#8    
 
gsb's Avatar

Name: 
gsb
Status: Offline
Rank: Registered User
Posts: 771
Mood: Always getting better.
Old 04-25-2005, 09:05 AM Reply With Quote


I think this was that example: .: NEWS FEED :. .: NEWS FEED Files Zipped - 12k :.

gsb
               
 
View Public Profile Send a private message to gsb Find all posts by gsb Add gsb to Your Contacts
#9    
 
swish0r's Avatar

Name: 
swish0r
Status: Offline
Rank: Registered User
Posts: 231
Old 04-25-2005, 10:17 AM Reply With Quote


Thank you so much for sharing this !!!

First I thought I did something wrong while trying to use it, because whenever I switched to another rss feed, it stopped working. Until I found out that it wasn't my fault, but because the xml file they provided was empty :wacko:
It's works now (using another feed which isn't empty ).

One more question:
start newsFeed.html in browser -> content is loaded
start newsFeed.swf in browser -> content isn't loaded
why ?
I'm asking because I would love to import the newsFeed.swf into my movie. I don't want to use a popup for the news.
               

Last edited by swish0r; 04-25-2005 at 10:34 AM..
 
View Public Profile Send a private message to swish0r Find all posts by swish0r Add swish0r to Your Contacts
#10    
 
gsb's Avatar

Name: 
gsb
Status: Offline
Rank: Registered User
Posts: 771
Mood: Always getting better.
Old 04-25-2005, 10:39 AM Reply With Quote


Check your RSS feed format.
Is probably of a different format than the php is set up to parse.

http://www.2rss.com/software.php
http://www.sitepoint.com/print/560

...and the usage is: .../newsFeed.html?rssFeed=http.....
This then overrides the default.

gsb
               

Last edited by gsb; 04-25-2005 at 10:42 AM..
 
View Public Profile Send a private message to gsb Find all posts by gsb Add gsb to Your Contacts
#11    
 
swish0r's Avatar

Name: 
swish0r
Status: Offline
Rank: Registered User
Posts: 231
Old 04-25-2005, 05:06 PM Reply With Quote


I managed to add the script to my swish movie. Everything works so far. I have several external .swf files which are loaded into a sprite. I was able to unload those .swf files so that the text box is displayed alone without external .swf content in the background . But now I have another problem: When I hit a button which loads an external .swf, the text box is still there. Is it possible to unload / delete the text box with a command ?

Thanks for the help in advance.
               
 
View Public Profile Send a private message to swish0r Find all posts by swish0r Add swish0r to Your Contacts
#12    
 
mobosof's Avatar

Name: 
mobosof
Status: Offline
Rank: Super Moderator
Posts: 15,970
Mood: wow warlock will...grrrr
Old 04-25-2005, 06:54 PM Reply With Quote


my congrats Greg I've been looking for something like this myself...a superb job.
like swishor too..would be nice wrapped in a sprite

http://www.mobosof.com/examples/newsfeed/newsFeed.html
               
 
View Public Profile Send a private message to mobosof Visit mobosof's homepage! Find all posts by mobosof Add mobosof to Your Contacts
#13    
 
gsb's Avatar

Name: 
gsb
Status: Offline
Rank: Registered User
Posts: 771
Mood: Always getting better.
Old 04-25-2005, 09:55 PM Reply With Quote


Hummm... Have not looked at this in almost a year now.
But:
o=createEmptyMovieClip("container",1);
...looks like the container sprite for the textfield.

So:
_root.container.removeMovieClip();
...should do it.

gsb
               
 
View Public Profile Send a private message to gsb Find all posts by gsb Add gsb to Your Contacts
#14    
 
swish0r's Avatar

Name: 
swish0r
Status: Offline
Rank: Registered User
Posts: 231
Old 04-26-2005, 07:05 AM Reply With Quote


Wohoooo it works ! Thank you so much for all the help gsb (aka codemaster ).
               
 
View Public Profile Send a private message to swish0r Find all posts by swish0r Add swish0r to Your Contacts
#15    
 
Stephan's Avatar

Name: 
Stephan
Status: Offline
Rank: Super Moderator
Posts: 4,689
Old 04-26-2005, 07:28 AM Reply With Quote


very cool...
               
 
View Public Profile Send a private message to Stephan Find all posts by Stephan Add Stephan to Your Contacts
#16    
 
gsb's Avatar

Name: 
gsb
Status: Offline
Rank: Registered User
Posts: 771
Mood: Always getting better.
Old 04-26-2005, 09:21 AM Reply With Quote


Thanks Stephan.

Remember this warning though:
This works well except for some of the WAY-long links often passed in the XML feeds. The flash player truncates long anchor tag HREF's, so caution.

gsb
               
 
View Public Profile Send a private message to gsb Find all posts by gsb Add gsb to Your Contacts
#17    
 
swish0r's Avatar

Name: 
swish0r
Status: Offline
Rank: Registered User
Posts: 231
Old 04-27-2005, 12:02 PM Reply With Quote


Yes, some feeds are not displayed probably because of this.
I found a xml2swf php solution (free for non-commercial purposes). I'm going to attach it. Would this be a good solution ?

Can this be loaded into a sprite ? How ? (Code for swishmax ? What would have to be edited in the php files ?).

I just don't understand all this "php stuff"
Attached Files
File Type: zip xml2swf_10.zip (2.6 KB, 205 views)
               
 
View Public Profile Send a private message to swish0r Find all posts by swish0r Add swish0r to Your Contacts
#18    
 
gsb's Avatar

Name: 
gsb
Status: Offline
Rank: Registered User
Posts: 771
Mood: Always getting better.
Old 04-27-2005, 03:17 PM Reply With Quote


I know nothing about your "found" solution nor do I have the time to jump into it just now.

However, "Yes, some feeds are not displayed probably because of this." - this can be solved.

For example, in the php you could make a list of the urls and place in the hrefs an asFunction replacement for the link by reference, say index.

At the end of the data file sent, have the script add back in the list of url, say as a commented out, pipe separated list.
Back in SWiSHmax, parse the list into an array, say list, ans define your asFunction (make it global.).

Now a users click on a link would run your asFunction which, for example would use getURL( list[i] ); to load the new page.

No more truncated URLS.
Get creative. Must be many ways to work around the Flash player.

gsb
               

Last edited by gsb; 04-27-2005 at 03:21 PM..
 
View Public Profile Send a private message to gsb Find all posts by gsb Add gsb to Your Contacts
#19    
 
swish0r's Avatar

Name: 
swish0r
Status: Offline
Rank: Registered User
Posts: 231
Old 04-27-2005, 03:27 PM Reply With Quote


I know nothing about your "found" solution nor do I have the time to jump into it just now.

Hehe no problem, I just thought I post it in here, maybe someone who knows more about php than I do has time to have a look at it one day ...

Thank you for the other tip, I will have a look at it tomorrow (too tired now). gn8
               
 
View Public Profile Send a private message to swish0r Find all posts by swish0r Add swish0r to Your Contacts
#20    
 
gsb's Avatar

Name: 
gsb
Status: Offline
Rank: Registered User
Posts: 771
Mood: Always getting better.
Old 04-27-2005, 05:40 PM Reply With Quote


So, I took a break a while back and looked at the newsRSS code.
It was far easier than I remembered to fix.

delete one line of code in the .swi and add two lines:

Changed code follows with deleted line commented out:
...
_global.getNEWS=function(n){getURL(myArray[i][0],"_blank");};
// WhenLoaded routine
myArray.isLoaded=function() {
// format item by item from news feed array
for(s="<br>",i=0;i<this.length;i++) {
s+="<B><font face='Arial' size='12' color='#0000FF'>";
//s+="<a href='"+this[i][0]+"' target='_blank'>";
s+="<a href='asFunction:getNEWS,"+i+"' target='_blank'>";

s+=this[i][1]+"</a></font></B><br><font face='Arial' ";
s+="size='11'>"+this[i][2]+"<br><br></font>\n";
}
...

Should handle your long URLs now.

gsb
               
 
View Public Profile Send a private message to gsb Find all posts by gsb Add gsb to Your Contacts
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump