Rotten Tomatoes Agent [request filled]



Already Taken.


bugger.



Thank you, would have driven myself crazy looking for the right folder! Cheers.

Is there a way to get the tomatometer score instead of the average rating?



Now THIS would be amazing, but I believe that Plex would have to build in the functionality to include that is metadata... for instance there could be a "Rating," and a "RT Score" as two separate metadata entrees.


You could change:


<br />
avg_rating = movie_page.xpath('//div[@id="all-critics-numbers"]/div/p/span')[0].text.split('/')[0]<br />
metadata.rating = float(avg_rating)<br />




to


<br />
avg_rating = movie_page.xpath('//div[@id="all-critics-numbers"]/div/span')[0].text<br />
metadata.rating = float(avg_rating)/10<br />




in the __init__.py file inside the bundle

Sorry for the last two posts, I messed up.



Anyways, this agent is not working for me. It’s not pulling anything off of RT. It’s on top of my list, but metadata is still coming from TheMovieDB. Any ideas?



Thanks

Sascha

Strange. I can’t reproduce that. It’s pulling the entire thing for me.



Maybe the version of the website is location-specific? Can you go to the website in a browser, view source, and paste that into a text document and post it here?


Post the log, and I'll take a look.


I just retried. Does not work. I'll post the source right away, give me a minute.


Where do I find the log?

You’ll find it at ~/Library/Logs/PMS Plugin Logs/com.plexapp.agents.rottentomatoes.log, where the ~ represents your user home folder.

Check the attachment for the source code of the page for the movie “25th hour”.

There’s not an attachment.

HEre is the log (see attachment).



I get a lot of entries like this:



2011-01-04 00:23:47,193 (-4faed000) :  CRITICAL (core) - Exception in the update function of agent named 'Rotten Tomatoes', called with guid 'com.plexapp.agents.imdb://tt0076729?lang=en' (most recent call last):<br />
  File "/Users/sascha/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 694, in _update<br />
    agent.update(obj, media, lang)<br />
  File "/Users/sascha/Library/Application Support/Plex Media Server/Plug-ins/RottenTomatoes.bundle/Contents/Code/__init__.py", line 33, in update<br />
    metadata.rating = ratings['T-Meter Critics']<br />
  File "/Users/sascha/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/bases.py", line 140, in <lambda><br />
    _getitem_ = lambda x, y: x.__getitem__(y),<br />
KeyError: 'T-Meter Critics'

Trying the source again (sorry). See attachment (hope it works this time)

That log says you’re not using the agent I wrote.

Did you download the agent from the first page, or are you using the old version that originally shipped with Plex/Nine?



Delete the RottenTomatoes.bundle that you have in ~/Library/Application Support/Plex Media Server/Plug-ins and reinstall it.



Now that is strange. I downloaded the one from this thread and double-clicked to install.

Guess the installation did not overwrite the old plugin then.

I just deleted the old one, re-installed your version and now it seems to be working.

Thanks a lot for your help! Much appreciated :D



The above suggestion didn't work for me to get the Tomatometer score instead of the average rating. I don't know anything about agents, but from looking at the code for the synopsis and the previous suggestion, I came up with this replacement which pulls the Tomatometer rating and then divides it by 10 (I didn't check, but I assume the rating has to be between 1 and 10?)


<br />
avg_rating = movie_page.xpath('//span[@id="all-critics-meter"]')[0].text<br />
			metadata.rating = float(avg_rating)/10<br />




Hopefully this will help someone else out.

Thanks to the originator, this is a phenomenal agent.

Hi All



Very Very excited about this, since RT is THE movies bible. I am, however a self confessed techno muppet so if anyone feels like posting a step by step guide for downloading and installing this scraper on a mac I’d be mose obliged.



Thanks for reading!