diff --git a/couchpotato/core/providers/userscript/rottentomatoes/__init__.py b/couchpotato/core/providers/userscript/rottentomatoes/__init__.py new file mode 100644 index 00000000..ee8266eb --- /dev/null +++ b/couchpotato/core/providers/userscript/rottentomatoes/__init__.py @@ -0,0 +1,6 @@ +from .main import RottenTomatoes + +def start(): + return RottenTomatoes() + +config = [] diff --git a/couchpotato/core/providers/userscript/rottentomatoes/main.py b/couchpotato/core/providers/userscript/rottentomatoes/main.py new file mode 100644 index 00000000..cb36b6cf --- /dev/null +++ b/couchpotato/core/providers/userscript/rottentomatoes/main.py @@ -0,0 +1,19 @@ +from BeautifulSoup import BeautifulSoup +from couchpotato.core.event import fireEvent +from couchpotato.core.providers.userscript.base import UserscriptBase + +class RottenTomatoes(UserscriptBase): + + includes = ['http*://www.rottentomatoes.com/m/*'] + + def getMovie(self, url): + + try: + data = self.urlopen(url) + except: + return + + html = BeautifulSoup(data) + title = html.find('span', {'itemprop':'name'}).text + info = fireEvent('scanner.name_year', title, single = True) + return self.search(info['name'], info['year'])