Bob Russell
04-24-2005, 12:28 AM
I've been away from Sunrise for a while, waiting for the new reader software, but can't stand to wait any longer, so I'm back to using it.
Yahoo has a lot of RSS feeds (most are at http://news.yahoo.com/rss).
Does anyone have these as SDL site definitions for Sunrise already?
Or have the time and interest to create a few?
I know this is a bit of a longshot, but here are the ones I'm interested in:
http://rss.news.yahoo.com/rss/topstories
Which I assume corresponds to http://news.yahoo.com/news?tmpl=index&cid=716
http://rss.news.yahoo.com/rss/politics
http://rss.news.yahoo.com/rss/tech
http://rss.news.yahoo.com/rss/personaltech
http://rss.news.yahoo.com/rss/linux
http://rss.news.yahoo.com/rss/wireless
http://rss.news.yahoo.com/rss/oddlyenough
http://rss.news.yahoo.com/rss/science
http://rss.news.yahoo.com/rss/mostemailed
http://rss.news.yahoo.com/rss/mostviewed
http://rss.news.yahoo.com/rss/highestrated
Plus some that are part of Yahoo news, but seem to have independent feeds...
http://www.washingtonpost.com/wp-adv/rss/front.htm#politics
http://ppcmag.com/rss.asp (may not even have print version of pages?)
http://www.mobilepipeline.com/shared/static/rss.jhtml
http://www.techweb.com/rss/all.jhtml
(Are these last two even valid urls for RSS feeds?)
Thanks!
Colin Dunstan
04-24-2005, 01:11 PM
I am interested as well. Perhaps Laurens (or someone else) could give us some guidance?
taylor
04-28-2005, 07:17 AM
I'll give it a shot. Hopefully I'll have something to share by the end of the weekend.
taylor
04-28-2005, 11:10 AM
Unless I'm missing something, this looks pretty easy to set up. I thought it may be useful to describe the process I used... that way others can just duplicate it for their own feeds. As the saying goes, "Give a man a fish and he's fed for the day, teach a man to fish and he's fed for a lifetime." (or something like that).
Here is what I did to create a document corresponding to Yahoo's Oddly Enough feed:
1. Select File -> New Document
2. Give the document a name OddlyEnough
3. Enter URL/File: http://rss.news.yahoo.com/rss/oddlyenough (note: if you copy the URL to the clipboard before step 1, the URL will be automatically filled in for you)
4. Modify Link depth to 1 with no restriction
5. Add scheduling as desired.
6. Be sure that a destination has been selected in the Output tab
7. On the Advanced tab, selected Embedded for the script and click on Edit Script...
8. Enter the following script in the window that pops up:
document.onanchorlink = function(link) {
if (link.depth == 1) {
link.uri = link.uri.replace("/news?tmpl=story&u=", "/s");
link.uri = link.uri + "&printer=1";
}
};
This will rewrite the article links so that they use the printable pages instead of the default web pages.
Once you have one document set up the way you want it, you can duplicate it and just change the name and url (just for the Yahoo feeds).
I hope this helps. Please let me know if you have any questions or suggestions.
Bob Russell
04-28-2005, 11:41 AM
Exellent! I think I can fish now!
The problem for me was how to do the url manipuation. Your example turned a light bulb on for me. Previously could only do straight text replacements (i.e. as done on the 3rd line of your example.) Now I can see how to do multiple replace and append operations, which greatly multiplies the number of sites with URL rewrites I can accomplish.
Next I need to discover an alternative for Vade Mecum on PPC. It seems to corrupt my Toshiba PPC every time I start using it regularly. Might be a conflict with another program. But it just crashed it again this week, so I'm a little gun shy. I'll see if I can use my old Palm IIIxe as a reader for now.
Thanks much Taylor.
8. Enter the following script in the window that pops up:
[CODE]document.onanchorlink = function(link) {
if (link.depth == 1) {
link.uri = link.uri.replace("/news?tmpl=story&u=", "/s");
link.uri = link.uri + "&printer=1";
}
Thanks for the inspiration Taylor! I never dared to touch SDL before, but now I think I should give it a try. Can you share any more information on that code within link.uri.replace() ?
taylor
04-30-2005, 09:37 PM
The first stuff in quotes is the part of the original URL that I didn't want, the stuff in the second set of quotes is what I wanted to be placed in the URL instead.
Laurens
05-01-2005, 06:47 AM
Contrary to what I said earlier, scripting will still be supported in the commercial version. (Most likely, it will use the SpiderMonkey engine from Mozilla.)
taylor
05-01-2005, 07:04 AM
That's great news Laurens. I almost mentioned earlier in this thread that script was going to be eliminated (based on earlier comments from you)... glad I didn't mention it.
Bob Russell
05-01-2005, 08:51 AM
I did some more digging in hopes of getting info that would help me with the scripting/link rewrites. Looks like there is some great info right there in the help files... From the Sunrise desktop, Help, and then look at advanced topics. Don't understand all that's there yet as I only took a quick first glance, but it seems to handle thinks like selective filtering for various link depths, and regular expressions, etc.
But the way I read things, if you really need something fancy like stripping out areas of content, I guess you need to use the XSL transformations, which probably aren't especially technically challenging, but more time consuming. At this point, I don't even have a clue how to go about something like that, but it's probably more work than I would do for any particular sites anyway.
The other scripting seems to be a form of Javascript minus some server-side specific features.
I'm also really glad to hear that a form of scripting will be included in the new product!