Google Showtimes

By sizzlemctwizzle Last update Feb 22, 2009 — Installed 448 times.

some rotten tomatoes links not working

in
Subscribe to some rotten tomatoes links not working 5 posts, 2 voices



RainbowWarrior Scriptwright

Hi there,

Rotten tomatoes is storing some movies with some numbers at the start of the link which is breaking a lot of scripts like yours. I have modified your script to work with skycitycinemas.co.nz but not all links are working.

Eg: Quarantine
You would expect the link to be "http://www.rottentomatoes.com/m/quarantine/" however the actual link is "http://www.rottentomatoes.com/m/10009238-quarantine/"

Don't spose you know anything about these first few numbers at the start and why RT is using them?

thanks

 
RainbowWarrior Scriptwright

I think it might be something to do with multiple movies having the same title.

 
sizzlemctwizzle Script's Author

Well fuck me sideways...I don't have a clue why that's happening, but I know how to fix it. It will kind of be a pain in the ass though. Luckily when you guess the wrong page RT redirects you to the search page and most likely the first result is the result we're looking for so I will make my script follow that link to the real page. Give me a few days and I'll have it done. I hope you like the script though.

 
sizzlemctwizzle Script's Author

You might be right. I think there is another movie named quarantine, but it doesn't really matter why it happens, just whether we can fix it or not, which we can...I think...

I also need make sure to save which movies aren't found on RT so we don't keep looking for movies we can't find.

 
sizzlemctwizzle Script's Author

My latest update makes finding the correct rating nearly perfect. The script tries to find the movie page through three different techniques:
1. We try pure guessing since the url is usually predictable. This works the majority of the time, but sometimes it fails in which case we go to step 2. Also this sometimes fails when you get an older movie, so now my script checks the date to see if its a recent movie and if its not we go to step 3.
2. We try to parse the search page we are sent to when we pick an incorrect url with regular expression. Sometimes this works, in which case we will follow the url to parse the rating from that page.
3. We preform a search and use the DOMParser and XPath to get the first result of the search table. Then we use a formula to see how likely it is that this result is what we are looking for. If its above a 50% likely threshold then we call the url of the result and parse it for the rating.

Yes it is very complex process, but it is surprisingly accurate.

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel