Extension -> Userscript

This commit is contained in:
Ruud
2011-09-27 07:51:06 +02:00
parent ff9a5971c4
commit d79a25bb5b
22 changed files with 38 additions and 38 deletions
@@ -0,0 +1,6 @@
from .main import MovieMeter
def start():
return MovieMeter()
config = []
@@ -0,0 +1,41 @@
from couchpotato.core.providers.userscript.base import UserscriptBase
class MovieMeter(UserscriptBase):
includes = ['http://*.moviemeter.nl/film/*', 'http://moviemeter.nl/film/*']
#CouchPotato['moviemeter.nl'] = (function(){
#
# function isMovie(){
# var pattern = /[^/]+\/?$/;
# var html = document.getElementsByTagName('h1')[0].innerHTML
# matched = location.href.match(pattern);
# return null != matched;
# }
#
# function getId(){
# var pattern = /imdb\.com\/title\/tt(\d+)/;
# var html = document.getElementsByTagName('html')[0].innerHTML;
# var imdb_id = html.match(pattern)[1];
# return imdb_id;
#
# }
#
# function getYear(){
# var pattern = /(\d+)[^\d]*$/;
# var html = document.getElementsByTagName('h1')[0].innerHTML;
# var year = html.match(pattern)[1];
# return year;
#
# }
#
# function constructor(){
# if(isMovie()){
# lib.osd(getId(), getYear());
# }
# }
#
# return constructor;
#
#})();