コード例 #1
0
ファイル: M6Replay.py プロジェクト: oogl-import/tvdownloader
	def __init__( self ):
		Plugin.__init__( self, "M6Replay", "www.m6replay.fr/", 1 )
		
		self.listeFichiers = {} # Clefs = nomChaine, Valeurs = { nomEmission, [ [ Episode 1, Date1, URL1 ], ... ] }

		if os.path.exists( self.fichierCache ):
			self.listeFichiers = self.chargerCache()
コード例 #2
0
ファイル: W9Replay.py プロジェクト: oogl-import/tvdownloader
	def __init__( self ):
		Plugin.__init__( self, "W9Replay", "http://www.w9replay.fr/", 1 )
		
		self.listeEmissionsCourantes = {}
		
		if os.path.exists( self.fichierCache ):
			self.listeFichiers = self.chargerCache()
コード例 #3
0
    def __init__(self, connection, eventhandler):

        Plugin.__init__(self, connection, eventhandler, needs_dir=False)

        self.eventhandler.get_events()['MessageEvent'].register(self.handler)

        self.api_url = "http://api.autome.me/text?lines=1"
コード例 #4
0
ファイル: AutoMeme.py プロジェクト: pirogoeth/ashiema
 def __init__(self, connection, eventhandler):
 
     Plugin.__init__(self, connection, eventhandler, needs_dir = False)
     
     self.eventhandler.get_events()['MessageEvent'].register(self.handler)
     
     self.api_url = "http://api.autome.me/text?lines=1"
コード例 #5
0
    def __init__(self):
        Plugin.__init__(self, "W9Replay", "http://www.w9replay.fr/", 1)

        self.listeEmissionsCourantes = {}

        if os.path.exists(self.fichierCache):
            self.listeFichiers = self.chargerCache()
コード例 #6
0
ファイル: M6Replay.py プロジェクト: btuduri/tvdownloader
    def __init__(self):
        Plugin.__init__(self, "M6Replay", "www.m6replay.fr/", 1)

        self.listeFichiers = {
        }  # Clefs = nomChaine, Valeurs = { nomEmission, [ [ Episode 1, Date1, URL1 ], ... ] }

        if os.path.exists(self.fichierCache):
            self.listeFichiers = self.chargerCache()
コード例 #7
0
ファイル: System.py プロジェクト: pirogoeth/ashiema
    def __init__(self, connection, eventhandler):

        Plugin.__init__(self, connection, eventhandler, needs_dir = False)
        
        self.eventhandler.get_events()['PMEvent'].register(self.handler)
        self.eventhandler.get_events()['PluginsLoadedEvent'].register(self.load_identification)
        
        self.system_event = self.eventhandler.get_events()['SystemEvent']
コード例 #8
0
 def __init__(self, connection, eventhandler):
     
     Plugin.__init__(self, connection, eventhandler, needs_dir = False)
     
     self.helpfactory = self.connection.pluginloader.helpfactory
     
     self.eventhandler.get_events()['MessageEvent'].register(self.handler)
     self.eventhandler.get_events()['PMEvent'].register(self.handler)
コード例 #9
0
    def __init__(self, connection, eventhandler):

        Plugin.__init__(self, connection, eventhandler, needs_dir=False)

        self.helpfactory = self.connection.pluginloader.helpfactory

        self.eventhandler.get_events()['MessageEvent'].register(self.handler)
        self.eventhandler.get_events()['PMEvent'].register(self.handler)
コード例 #10
0
ファイル: Europe1.py プロジェクト: oogl-import/tvdownloader
	def __init__( self):
		Plugin.__init__( self, "Europe1", "http://www.europe1.fr", 1 )
		# On instancie la classe qui permet de charger les pages web
		
		self.listeEmissions = {} # Clef = nom emission ; Valeur = lien fichier XML qui contient la liste des emissions
		
		if os.path.exists( self.fichierCache ):
			self.listeEmissions = self.chargerCache()
コード例 #11
0
ファイル: CanalPlus.py プロジェクト: oogl-import/tvdownloader
	def __init__( self ):
		Plugin.__init__( self, "Canal+", "http://www.canalplus.fr/", 7, "CanalPlus.jpg" )
		
		self.listeProgrammes          = {} # { Nom chaine : { Nom emission : ID emission } }
		self.derniereChaine           = ""
		
		if os.path.exists( self.fichierCache ):
			self.listeProgrammes = self.chargerCache()
コード例 #12
0
    def __init__(self, connection, eventhandler):

        Plugin.__init__(self, connection, eventhandler, needs_dir=False)

        self.eventhandler.get_events()['PMEvent'].register(self.handler)
        self.eventhandler.get_events()['PluginsLoadedEvent'].register(
            self.load_identification)

        self.system_event = self.eventhandler.get_events()['SystemEvent']
コード例 #13
0
ファイル: trivia.py プロジェクト: B-Rich/VTKBot
 def __init__(self, factory):
     Plugin.__init__(self, factory)
     self.channel_message_rule = "(.*)"
     self.trivia_started = {} #Dict with channel name and boolean to see if the trivia is busy on that channel
     self.questions = {}
     self.answered = {}
     self.timers = {}
     for channel in self.factory.channels:
         self.trivia_started[channel] = False
コード例 #14
0
ファイル: Europe1.py プロジェクト: btuduri/tvdownloader
    def __init__(self):
        Plugin.__init__(self, "Europe1", "http://www.europe1.fr", 1)
        # On instancie la classe qui permet de charger les pages web

        self.listeEmissions = {
        }  # Clef = nom emission ; Valeur = lien fichier XML qui contient la liste des emissions

        if os.path.exists(self.fichierCache):
            self.listeEmissions = self.chargerCache()
コード例 #15
0
    def __init__(self):
        Plugin.__init__(self, "Canal+", "http://www.canalplus.fr/", 7,
                        "CanalPlus.jpg")

        self.listeProgrammes = {
        }  # { Nom chaine : { Nom emission : ID emission } }
        self.derniereChaine = ""

        if os.path.exists(self.fichierCache):
            self.listeProgrammes = self.chargerCache()
コード例 #16
0
ファイル: Identification.py プロジェクト: pirogoeth/ashiema
    def __init__(self, connection, eventhandler):

        Plugin.__init__(self, connection, eventhandler, needs_dir=True)

        self.eventhandler.get_events()["PMEvent"].register(self.handler)
        self.eventhandler.get_events()["SystemEvent"].register(self.sys_handler)
        self.eventhandler.get_events()["PluginsLoadedEvent"].register(self.sys_handler)

        self.logins = {}
        self._opened = False

        self.__open_shelve__()
コード例 #17
0
ファイル: YoutubeScraper.py プロジェクト: pirogoeth/ashiema
    def __init__(self, connection, eventhandler):

        Plugin.__init__(self, connection, eventhandler, needs_dir=False)

        self.regexp = r"""(?:https?://(?:www.|)youtube.com/(?:watch\?v=([\w-]*)))"""
        self.pattern = re.compile(self.regexp, re.VERBOSE)

        self.format = "[%sYou%sTube%s] %s&t%s - %s&a%s" % (
            Escapes.YELLOW, Escapes.RED, Escapes.BLACK, Escapes.AQUA,
            Escapes.BLACK, Escapes.GREY, Escapes.BLACK)
        self.apiurl = "http://gdata.youtube.com/feeds/api/videos/%s?v=2&alt=jsonc"

        self.eventhandler.get_events()['MessageEvent'].register(self.handler)
コード例 #18
0
    def __init__(self, connection, eventhandler):

        Plugin.__init__(self, connection, eventhandler, needs_dir=True)

        self.eventhandler.get_events()['PMEvent'].register(self.handler)
        self.eventhandler.get_events()['SystemEvent'].register(
            self.sys_handler)
        self.eventhandler.get_events()['PluginsLoadedEvent'].register(
            self.sys_handler)

        self.logins = {}
        self._opened = False

        self.__open_shelve__()
コード例 #19
0
ファイル: URLScraper.py プロジェクト: pirogoeth/ashiema
 def __init__(self, connection, eventhandler):
 
     Plugin.__init__(self, connection, eventhandler, needs_dir = False)
     
     # props to John Gruber, http://daringfireball.net/2010/07/improved_regex_for_matching_urls
     self.regexp = r"""(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'"\.<>]))"""
     self.title_regexp = r"""<title>(.*?)</title>"""
     self.pattern = re.compile(self.regexp, re.VERBOSE)
     self.title_pattern = re.compile(self.title_regexp, re.VERBOSE | re.DOTALL | re.M)
     
     self.alt_title_len = 50
     
     self.format = "[%sURLScraper%s] %s^t^%s - [%s^l^%s]" % (Escapes.GREEN, Escapes.BLACK, Escapes.AQUA, Escapes.BLACK, Escapes.GREY, Escapes.BLACK)
     
     self.eventhandler.get_events()['MessageEvent'].register(self.handler)
コード例 #20
0
    def __init__(self, connection, eventhandler):

        Plugin.__init__(self, connection, eventhandler, needs_dir=False)

        # props to John Gruber, http://daringfireball.net/2010/07/improved_regex_for_matching_urls
        self.regexp = r"""(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'"\.<>]))"""
        self.title_regexp = r"""<title>(.*?)</title>"""
        self.pattern = re.compile(self.regexp, re.VERBOSE)
        self.title_pattern = re.compile(self.title_regexp,
                                        re.VERBOSE | re.DOTALL | re.M)

        self.alt_title_len = 50

        self.format = "[%sURLScraper%s] %s^t^%s - [%s^l^%s]" % (
            Escapes.GREEN, Escapes.BLACK, Escapes.AQUA, Escapes.BLACK,
            Escapes.GREY, Escapes.BLACK)

        self.eventhandler.get_events()['MessageEvent'].register(self.handler)
コード例 #21
0
    def __init__(self, connection, eventhandler):

        Plugin.__init__(self, connection, eventhandler, needs_dir=True)

        HTTPServer.running = False

        self.config = self.get_plugin_configuration()

        if len(self.config) == 0:
            raise Exception(
                "You must configure options for the HTTP server in your server config!"
            )

        self.resource_path = self.config['resource_path']

        if self.resource_path[0] == '/':
            self.resource_path = self.resource_path[1:]

        self.resource_path = self.get_path() + self.resource_path

        self.resource_route = self.config['resource_route']

        if self.resource_route[0] == '/':
            self.resource_route = self.resource_route[1:]

        if not os.path.exists(self.resource_path):
            try:
                os.makedirs(self.resource_path)
            except (OSError) as e:
                if e.errno != errno.EEXIST:
                    raise

        sys.stderr = WSGILoggingHandler()
        sys.stdout = sys.stderr

        self.request_handlers = {}
        self.__thread = None

        self.__load_layers()

        self.eventhandler.get_events()['MessageEvent'].register(self.handler)
        self.eventhandler.get_events()['PluginsLoadedEvent'].register(
            self.__on_plugins_loaded)
コード例 #22
0
ファイル: UrbanDictionary.py プロジェクト: pirogoeth/ashiema
 def __init__(self, connection, eventhandler):
 
     Plugin.__init__(self, connection, eventhandler, needs_dir = False)
     
     self.cache = {}
     
     self.eventhandler.get_default_events()['MessageEvent'].register(self.handler)
     self.eventhandler.get_default_events()['PluginsLoadedEvent'].register(self._load_identification)
     
     self.connection.tasks.update({
         "UrbanDictionary__scheduled_cache_clean" :
             self.scheduler.add_interval_job(
                 self.clean_cache,
                 days = 1
             )
         }
     )
     
     self.url = "http://api.urbandictionary.com/v0/define?"
コード例 #23
0
ファイル: YoutubeScraper.py プロジェクト: pirogoeth/ashiema
    def __init__(self, connection, eventhandler):

        Plugin.__init__(self, connection, eventhandler, needs_dir=False)

        self.regexp = r"""(?:https?://(?:www.|)youtube.com/(?:watch\?v=([\w-]*)))"""
        self.pattern = re.compile(self.regexp, re.VERBOSE)

        self.format = "[%sYou%sTube%s] %s&t%s - %s&a%s" % (
            Escapes.YELLOW,
            Escapes.RED,
            Escapes.BLACK,
            Escapes.AQUA,
            Escapes.BLACK,
            Escapes.GREY,
            Escapes.BLACK,
        )
        self.apiurl = "http://gdata.youtube.com/feeds/api/videos/%s?v=2&alt=jsonc"

        self.eventhandler.get_events()["MessageEvent"].register(self.handler)
コード例 #24
0
 def __init__(self, connection, eventhandler):
     
     Plugin.__init__(self, connection, eventhandler, needs_dir = False)
 
     self.cache = {}
     self.scheduler = connection.scheduler
 
     self.eventhandler.get_default_events()['MessageEvent'].register(self.handler)
     self.eventhandler.get_default_events()['PluginsLoadedEvent'].register(self._load_identification)
 
     self.connection.tasks.update({
         "WolframAlpha__scheduled_cache_clean":
             self.scheduler.add_interval_job(
                 self.clean_cache,
                 days = 1
             )
         }
     )
     
     self.appID = "395X7T-8JLXGEP8YH"
コード例 #25
0
    def __init__(self, connection, eventhandler):

        Plugin.__init__(self, connection, eventhandler, needs_dir=True)

        self.brain = megahal.MegaHAL(brainfile=self.get_path() + "/brain")
        self.scheduler = connection.scheduler

        self.eventhandler.get_events()['MessageEvent'].register(self.handler)
        self.eventhandler.get_events()['PluginsLoadedEvent'].register(
            self._load_identification)

        self.ignored = []
        # chance (out of 100) that the AI will respond (per-channel).
        self.response_chances = {}
        self.default_chance = 30

        self.connection.tasks.update({
            "ArtificialIntelligence__scheduled_sync":
            self.scheduler.add_interval_job(self.sync, minutes=30)
        })
コード例 #26
0
ファイル: GoogleSearch.py プロジェクト: pirogoeth/ashiema
 def __init__(self, connection, eventhandler):
 
     Plugin.__init__(self, connection, eventhandler, needs_dir = False)
     
     self.cache = {}
     self.scheduler = connection.scheduler
     
     self.eventhandler.get_events()['MessageEvent'].register(self.handler)
     self.eventhandler.get_events()['PMEvent'].register(self.handler)
     
     self.connection.tasks.update({
         "GoogleSearch__scheduled_cache_clean" :
             self.scheduler.add_interval_job(
                 self.clean_cache,
                 days = 1
             )
         }
     )
     
     self.url = "https://ajax.googleapis.com/ajax/services/search/web?"
     self.prefix = "%sG%so%so%sg%sl%se%s" % (Escapes.BLUE, Escapes.RED, Escapes.YELLOW, Escapes.BLUE, Escapes.GREEN, Escapes.RED, Escapes.BLACK)
コード例 #27
0
ファイル: HTTPServer.py プロジェクト: pirogoeth/ashiema
    def __init__(self, connection, eventhandler):

        Plugin.__init__(self, connection, eventhandler, needs_dir = True)

        HTTPServer.running = False

        self.config = self.get_plugin_configuration()
        
        if len(self.config) == 0:
            raise Exception("You must configure options for the HTTP server in your server config!")

        self.resource_path = self.config['resource_path']

        if self.resource_path[0] == '/':
            self.resource_path = self.resource_path[1:]
        
        self.resource_path = self.get_path() + self.resource_path

        self.resource_route = self.config['resource_route']
        
        if self.resource_route[0] == '/':
            self.resource_route = self.resource_route[1:]
        
        if not os.path.exists(self.resource_path):
            try:
                os.makedirs(self.resource_path)
            except (OSError) as e:
                if e.errno != errno.EEXIST:
                    raise
        
        sys.stderr = WSGILoggingHandler()
        sys.stdout = sys.stderr
        
        self.request_handlers = {}
        self.__thread = None
        
        self.__load_layers()

        self.eventhandler.get_events()['MessageEvent'].register(self.handler)
        self.eventhandler.get_events()['PluginsLoadedEvent'].register(self.__on_plugins_loaded)
コード例 #28
0
 def __init__(self, connection, eventhandler):
 
     Plugin.__init__(self, connection, eventhandler, needs_dir = True)
     
     self.brain = megahal.MegaHAL(brainfile = self.get_path() + "/brain")
     self.scheduler = connection.scheduler
     
     self.eventhandler.get_events()['MessageEvent'].register(self.handler)
     self.eventhandler.get_events()['PluginsLoadedEvent'].register(self._load_identification)
     
     self.ignored = []
     # chance (out of 100) that the AI will respond (per-channel).
     self.response_chances = {}
     self.default_chance = 30
     
     self.connection.tasks.update({
         "ArtificialIntelligence__scheduled_sync" :
             self.scheduler.add_interval_job(
                 self.sync,
                 minutes = 30
             )
         }
     )
コード例 #29
0
	def __init__( self ):
		Plugin.__init__( self, "France Inter", "http://sites.radiofrance.fr/franceinter/accueil/", 30 )
		
		if os.path.exists( self.fichierCache ):
			self.listeEmissions = self.chargerCache()
コード例 #30
0
ファイル: ExamplePlugin.py プロジェクト: pirogoeth/ashiema
 def __init__(self, connection, eventhandler):
     Plugin.__init__(self, connection, eventhandler, needs_dir = False)
     
     self.eventhandler.get_events()['MessageEvent'].register(self.handler)
コード例 #31
0
ファイル: say.py プロジェクト: B-Rich/VTKBot
 def __init__(self, factory):
     Plugin.__init__(self, factory)
     self.channel_message_rule = "%s: say ([^ ]*) (.*)" % factory.nickname
     self.user_join_rule = ".*?"
コード例 #32
0
ファイル: quote.py プロジェクト: B-Rich/VTKBot
 def __init__(self, factory):
     Plugin.__init__(self, factory)
     self.channel_message_rule = "%s: quote" % self.factory.nickname
コード例 #33
0
ファイル: help.py プロジェクト: B-Rich/VTKBot
 def __init__(self, factory):
     Plugin.__init__(self, factory)
     self.channel_message_rule = "%s: help" % factory.nickname
コード例 #34
0
	def __init__( self):
		Plugin.__init__( self, "Podcasts", "", 30 )
コード例 #35
0
ファイル: seen.py プロジェクト: B-Rich/VTKBot
 def __init__(self, factory):
     Plugin.__init__(self, factory)
     self.channel_message_rule = ".*?"
コード例 #36
0
 def __init__(self):
     Plugin.__init__(self, "Radio France", "http://www.radiofrance.fr/", 30)
コード例 #37
0
ファイル: idle.py プロジェクト: B-Rich/VTKBot
 def __init__(self, factory):
     Plugin.__init__(self, factory)
     self.connected_rule = ".*?"
コード例 #38
0
    def __init__(self, connection, eventhandler):
        Plugin.__init__(self, connection, eventhandler, needs_dir=False)

        self.eventhandler.get_events()['MessageEvent'].register(self.handler)
コード例 #39
0
	def __init__( self):
		Plugin.__init__( self, "Radio France", "http://www.radiofrance.fr/", 30 )
コード例 #40
0
    def __init__(self):
        Plugin.__init__(self, self.nom, self.url,
                        7)  #7 = fréquence de rafraichissement

        if os.path.exists(self.fichierCache):
            self.listeChaines = self.chargerCache()