text: import feedparser
  import time
  import sqlite3
  import re
  import config
  
  openbugbounty_db_path = config.api_database_folder + config.openbugbounty_db_name
  cybercrimetracker_db_path = config.api_database_folder + config.cybercrimetracker_db_name
  
  
  def process_cybercrimetracker():
      url = 'http://cybercrime-tracker.net/rss.xml'
      d = feedparser.parse(url)
  
      entries = d['entries']
  
      malware_details_list = []
  
      for item in entries:
  
          source = item['title']
  
          date_parsed = item['published_parsed']
          date = time.strftime('%Y-%m-%d %H:%M:%S', date_parsed)
  
          description_list = item['description']
          f_type = ''
          if description_list is not None:
              if re.findall("\s+Type:", item['description']):
                  if re.findall("\s+IP:", item['description']):
                      regex = re.findall("\[\w{1,20}:\w{1,20}\]\s+Type:\s+", description_list)
                      regex = regex[0]
                      regex2 = re.findall("\s+-\s+IP:\s+\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}", description_list)
                      regex2 = regex2[0]
                      f_type = description_list.replace(regex, '')
                      f_type = f_type.replace(regex2, '')
                  else:
                      regex = re.findall("\[\w{1,20}:\w{1,20}\]\s+Type:\s+", description_list)
                      regex = regex[0]
                      f_type = description_list.replace(regex, '')
  
          malware_details_list.append((source, f_type, date))
  
      conn = sqlite3.connect(cybercrimetracker_db_path)
      c = conn.cursor()
      c.execute("CREATE TABLE IF NOT EXISTS data (source text, f_type text, date number)")
      c.execute('CREATE UNIQUE INDEX IF NOT EXISTS source_index ON data(source)')
      c.executemany("INSERT OR IGNORE INTO data VALUES(?, ?, ?)", malware_details_list, )
      conn.commit()
      conn.close()
  
  
  def process_openbugbounty():
      url = 'http://feeds.feedburner.com/XSSPosed'
      d = feedparser.parse(url)
  
      entries = d['entries']
  
      malware_details_list = []
  
      for item in entries:
          if re.findall("[\w\s+]{1,20}\s+on\s+", item['title']):
              s = item['title']
              regex = re.findall("[\w\s+]{1,20}\s+on\s+", s)
              regex = regex[0]
  
              source = s.replace(regex, '')
  
              regex2 = re.findall("\s+on\s+", regex)
              regex2 = regex2[0]
  
              f_type = regex.replace(regex2, '')
  
              date_parsed = item['published_parsed']
              date = time.strftime('%Y-%m-%d %H:%M:%S', date_parsed)
  
              malware_details_list.append((source, f_type, date))
          else:
              pass
  
      conn = sqlite3.connect(openbugbounty_db_path)
      c = conn.cursor()
      c.execute("CREATE TABLE IF NOT EXISTS data (source text, f_type text, date number)")
      c.execute('CREATE UNIQUE INDEX IF NOT EXISTS source_index ON data(source)')
      c.executemany("INSERT OR IGNORE INTO data VALUES(?, ?, ?)", malware_details_list, )
      conn.commit()
      conn.close()
  
  
  process_cybercrimetracker()
  
  process_openbugbounty()