Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > Miscellaneous > Archive > Sunrise

Notices

 
 
Thread Tools Search this Thread
Old 02-05-2007, 09:32 PM   #1
HeffeD
Enthusiast
HeffeD has a complete set of Star Wars action figures.HeffeD has a complete set of Star Wars action figures.HeffeD has a complete set of Star Wars action figures.
 
Posts: 35
Karma: 270
Join Date: Feb 2007
Device: Palm Z22
Trouble rewriting Reuters...

Hi all, I'm new to the Palm and therefore Sunrise/Plucker. I have a few channels set up, but I'd like to learn more about rewriting links.

I'm attempting to rewrite a Reuters RSS feed. The URL is http://www.microsite.reuters.com/rss/oddlyEnoughNews/

I read in another thread how to rewrite links for the Yahoo feeds as:
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";
  }
};
Looking at the before and after URLs, I can't make much sense of what is actually going on with the code because it doesn't seem to resemble the URL.

In another thread, I found this:
Quote:
Hi all

I made some mistake in the pattern and rewrite rule for Reuters.

This is the right one:
Pattern rule: http://today\.reuters\.com(.*)type=(.*)
Rewrite rule: http://today.reuters.com/misc/PrinterFriendlyPopup.aspx?type=$2

Bye

Gaetano
OK, well that looks a lot more understandable. Unfortunately, I don't know how to format the script to incorporate the regex URL info.

Can anybody help me with this? Thanks in advance!
HeffeD is offline  
Old 02-06-2007, 08:00 AM   #2
DTM
Intentionally Left Blank
DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.
 
DTM's Avatar
 
Posts: 172
Karma: 300106
Join Date: Feb 2006
Location: Royal Oak, MI, USA
Device: Nook STR
The link below will take you to the Sunrise XP tutorial wiki. The discussion on the Advanced tab will get you started with how to filter and rewrite links.

https://wiki.mobileread.com/wiki/SunriseXP_tutorial

If you still have some questions, fire away and someone here should be able to help.
DTM is offline  
Advert
Old 02-06-2007, 08:37 AM   #3
Laurens
Jah Blessed
Laurens is no ebook tyro.Laurens is no ebook tyro.Laurens is no ebook tyro.Laurens is no ebook tyro.Laurens is no ebook tyro.Laurens is no ebook tyro.Laurens is no ebook tyro.Laurens is no ebook tyro.Laurens is no ebook tyro.Laurens is no ebook tyro.
 
Laurens's Avatar
 
Posts: 1,295
Karma: 1373
Join Date: Apr 2003
Location: The Netherlands
Device: iPod Touch
The JavaScript code is for the Java version of Sunrise.

The regular expressions are for Sunrise XP.
Laurens is offline  
Old 02-06-2007, 12:53 PM   #4
HeffeD
Enthusiast
HeffeD has a complete set of Star Wars action figures.HeffeD has a complete set of Star Wars action figures.HeffeD has a complete set of Star Wars action figures.
 
Posts: 35
Karma: 270
Join Date: Feb 2007
Device: Palm Z22
Thanks for the help! I'm using the Java version though, so I guess it requires the script.

Is there a similar Wiki for the Java version? Or should I switch to Sunrise XP? What is the difference between the two? Does one have more features or is more current than the other?

Thanks in advance!

Edit: Nevermind, I looked at the changelog for Sunrise XP and it had a later date than the last Java update, so it looks as though Sunrise XP is more current. I've downloaded Sunrise XP and I'm converting my Sunrise channels to XP.

Now I'll see if I can figure out the regex to rewrite Yahoo RSS feeds to point to printer friendly versions of the articles.

Last edited by HeffeD; 02-06-2007 at 01:55 PM. Reason: Updating post.
HeffeD is offline  
Old 02-06-2007, 02:48 PM   #5
HeffeD
Enthusiast
HeffeD has a complete set of Star Wars action figures.HeffeD has a complete set of Star Wars action figures.HeffeD has a complete set of Star Wars action figures.
 
Posts: 35
Karma: 270
Join Date: Feb 2007
Device: Palm Z22
OK, I have a question regarding the Yahoo RSS feeds.

I'm looking at this URL
http://rss.news.yahoo.com/rss/oddlyenough

The story link format is
http://news.yahoo.com/s/ap/20070206/...e_state_run_up

And the printer link uses the exact same URL, but places
&printer=1;_ylt=A0WTUeFN1MhFBmgB6QwuQE4F;_ylu=X3oD MTA3MXN1bHE0BHNlYwN0bWE-
on the end. Where does all this _ylt= and _ylu stuff come from?

I attemped using a pattern of
http://news\.yahoo\.com(.*)
With a rewrite as
http://news.yahoo.com/$1&printer=1;
But that doesn't work. How can you tell it to add stuff that wasn't in the orignal URL? Would I have to account for that in the pattern? Something like
http://news\.yahoo\.com(.*)&printer=1;(.*) ? (question character not being associated with the URL pattern)

Edit: Oh, and what does "Error enumerating VFS volumes: 0x290d" mean? I've never seen this before using Sunrise XP. Everything seems to function properly, and this error doesn't show up on my Palm, only on the log on my desktop. I'm assuming it's a sync issue of some sort? My Palm thinks it's fine, but my PC has issues with what the Palm says?

Edit 2: Well, I got rid of the enumerating error by uninstalling and reinstalling without th conduit, and all seems well.

I've also found that in the web browser, you can delete all the stuff following the '&printer=1;" portion of the URL and the pages displays just fine.

So, reading through the wiki and various threads on the forum, it appears as though my rewrite is the correct format, yet it still gives me the standard article instead of the printer friendly version. Any ideas what I'm doing wrong?

Thanks in advance for any help!

Last edited by HeffeD; 02-07-2007 at 12:42 AM. Reason: Adding more info
HeffeD is offline  
Advert
Old 02-07-2007, 09:35 PM   #6
DTM
Intentionally Left Blank
DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.
 
DTM's Avatar
 
Posts: 172
Karma: 300106
Join Date: Feb 2006
Location: Royal Oak, MI, USA
Device: Nook STR
You were close!

Although the "regular" story is at a URL that is of the form:

http://news\.yahoo\.com(.*)

as you used in your filter, you must look at the link in the feed page. Hover on one of the links and you'll find a bunch of stuff before that. And that stuff is irrelevant. To capture the link properly, you must filter on:

(.*)//news\.yahoo\.com(.*)

which will match the link, regardless of the junk before the "http:"

Now to filter, you must use:

http://news.yahoo.com$2&printer=1;

The same as yours, except there should be no / before the $2 and the $1 in yours has become $2 here, because now $1 is the junk up to "http:", that we don't need.
DTM is offline  
Old 02-08-2007, 12:00 AM   #7
HeffeD
Enthusiast
HeffeD has a complete set of Star Wars action figures.HeffeD has a complete set of Star Wars action figures.HeffeD has a complete set of Star Wars action figures.
 
Posts: 35
Karma: 270
Join Date: Feb 2007
Device: Palm Z22
Ah, thank you DTM! That makes me very happy.

You know, I didn't even see that stuff prior to 'http:' on the RSS page because I have a Firefox extension that rewrites redirects for me. All I saw was the actual news story URL. I'll need to remember to disable that before doing this type of thing.

And that superfluous '/' after .com, my first attempts didn't have that because I figured that the (.*) in the regex pattern was taking care of that, (and it is) but when it didn't work, I tried putting it in to see if it made a difference. It didn't. That is the version I pasted in my post. Now I see that the reason it made no difference is because I wasn't actually filtering the right URL.

Thanks again, I really appreciate it!
HeffeD is offline  
Old 02-08-2007, 08:09 AM   #8
DTM
Intentionally Left Blank
DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.
 
DTM's Avatar
 
Posts: 172
Karma: 300106
Join Date: Feb 2006
Location: Royal Oak, MI, USA
Device: Nook STR
You're welcome, HeffeD, and welcome to Mobileread!

Sometimes, when you're having problems like this, you never really know if the error is in the filter or the rewrite rule or both. One trick that I use (and used for this one) is to set your rewrite rule to:

www.google.com

That way, you can concentrate on getting the filter correct. When you are actually capturing your links correctly, they all get rewritten to send you to Google. At that point, you can start working on the real rewrite rule. Of course, there still may be errors in the filter, but at least you know you're catching the links.
DTM is offline  
Old 02-08-2007, 11:11 AM   #9
HeffeD
Enthusiast
HeffeD has a complete set of Star Wars action figures.HeffeD has a complete set of Star Wars action figures.HeffeD has a complete set of Star Wars action figures.
 
Posts: 35
Karma: 270
Join Date: Feb 2007
Device: Palm Z22
That's a handy tip. I don't think I would have ever thought of doing that, but it definitely allows you to think about one thing at a time instead of wondering if the problem is with the regex or the rewrite link.

Thanks again!
HeffeD is offline  
 


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
iPad Reuters: Still plenty of demand for iPad: Survey kjk Apple Devices 4 07-16-2010 06:22 PM
Borders CEO nixes idea of own e-reader (Reuters) Nate the great News 11 12-23-2009 06:42 PM
Reuters Article - with Actual quotes from Mr. Bezos poohbear_nc News 2 10-09-2009 10:33 AM
Reuters - E-readers seen as holiday hit, presage tablet PCs Gaurnim News 9 10-06-2009 01:35 PM
Reuters to offer podcasts Alexander Turcic Lounge 0 09-21-2005 08:53 AM


All times are GMT -4. The time now is 10:46 PM.


MobileRead.com is a privately owned, operated and funded community.