old_contents: # -*- coding: utf-8 -*-
  import json
  
  from intelmq.lib.bot import CollectorBot
  
  from .OTXv2 import OTXv2
  
  
  class AlienVaultOTXCollectorBot(CollectorBot):
  
      def init(self):
          if hasattr(self.parameters, 'http_ssl_proxy'):
              self.logger.warning("Parameter 'http_ssl_proxy' is deprecated and will be removed in "
                                  "version 1.0!")
              if not self.parameters.https_proxy:
                  self.parameters.https_proxy = self.parameters.http_ssl_proxy
  
      def process(self):
          self.logger.info("Downloading report through API")
          otx = OTXv2(self.parameters.api_key, proxy=self.parameters.https_proxy)
          pulses = otx.getall()
          self.logger.info("Report downloaded.")
  
          report = self.new_report()
          report.add("raw", json.dumps(pulses))
          self.send_message(report)
  
  
  BOT = AlienVaultOTXCollectorBot
  
new_contents: # -*- coding: utf-8 -*-
  import json
  import datetime
  
  from intelmq.lib.bot import CollectorBot
  
  from .OTXv2 import OTXv2
  
  
  class AlienVaultOTXCollectorBot(CollectorBot):
  
      def init(self):
          if hasattr(self.parameters, 'http_ssl_proxy'):
              self.logger.warning("Parameter 'http_ssl_proxy' is deprecated and will be removed in "
                                  "version 1.0!")
              if not self.parameters.https_proxy:
                  self.parameters.https_proxy = self.parameters.http_ssl_proxy
          self.modified_pulses_only = False
          if hasattr(self.parameters, 'modified_pulses_only'):
              self.modified_pulses_only = self.parameters.modified_pulses_only
              self.interval = getattr(self.parameters, 'interval', 24)
  
  
      def process(self):
          self.logger.info("Downloading report through API")
          otx = OTXv2(self.parameters.api_key, proxy=self.parameters.https_proxy)
          if self.modified_pulses_only:
              self.logger.info("Downloading modified pulses")
              interval =(datetime.datetime.now() - \
                         datetime.timedelta(hours=self.interval)).isoformat()
              pulses = otx.getsince(interval, limit=9999)
          else:
              self.logger.info("Downloading all pulses")
              pulses = otx.getall()
          self.logger.info("Report downloaded.")
  
          report = self.new_report()
          report.add("raw", json.dumps(pulses))
          self.send_message(report)
  
  
  BOT = AlienVaultOTXCollectorBot
  
subject: add method to download only modified pulses since