text: # Copyright 2016 Mycroft AI, Inc.
  #
  # This file is part of Mycroft Core.
  #
  # Mycroft Core is free software: you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
  # the Free Software Foundation, either version 3 of the License, or
  # (at your option) any later version.
  #
  # Mycroft Core is distributed in the hope that it will be useful,
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  # GNU General Public License for more details.
  #
  # You should have received a copy of the GNU General Public License
  # along with Mycroft Core.  If not, see <http://www.gnu.org/licenses/>.
  
  
  # Visit https://docs.mycroft.ai/skill.creation for more detailed information
  # on the structure of this skill and its containing folder, as well as
  # instructions for designing your own skill based on this template.
  
  
  # Import statements: the list of outside modules you'll be using in your
  # skills, whether from other files in mycroft-core or from external libraries
  from os.path import dirname
  
  from adapt.intent import IntentBuilder
  from mycroft.skills.core import MycroftSkill
  from mycroft.util.log import getLogger
  import requests
  import urllib.request
  import ssl
  __author__ = 'brihopki'
  
  
  LOGGER = getLogger(__name__)
  
  
  class TodayHistorySkill(MycroftSkill):
  
      def __init__(self):
          super(TodayHistorySkill, self).__init__(name="TodayHistorySkill")
  
      def initialize(self):
          self.load_data_files(dirname(__file__))
  
          random_event_intent = IntentBuilder("RandomEventIntent").\
              require("RandomEventKeyword").build()
          self.register_intent(random_event_intent, self.handle_random_event_intent)
  
  
  
    
      def handle_random_event_intent(self, message):
          r = urllib.request.urlopen("https://10.106.0.225/gpio/0", context=ssl.SSLContext()).read()
          self.speak("As you wish") 
  
  
      def stop(self):
          pass
  
  # The "create_skill()" method is used to create an instance of the skill.
  # Note that it's outside the class itself.
  def create_skill():
      return TodayHistorySkill()
  