

def getList(self):
    'Background loop.'
    url = 'http://xkcd.com/archive/'
    try:
        xml_str = str(urllib.request.urlopen(url).read()).split('(Hover mouse over title to view publication date)<br /><br />', 1)[(- 1)].split('</div>\\n<div id="bottom" class="box">', 1)[0].strip()
    except urllib.error.URLError as e:
        print(('Xkcd: %s: URL error %s reading list' % (__name__, str(e.reason))))
    clean_xml_str = xml_str.split('<br/>')
    self.menu_list = []
    for line in clean_xml_str:
        if (line is not None):
            line_id = line.split('"/', 1)[(- 1)].split('/"', 1)[0]
            line_date = line.split('="', 2)[(- 1)].split('">', 1)[0]
            line_title = line.split('">', 1)[(- 1)].split('</', 1)[0]
            self.menu_list.append([line_title, line_id, line_date])
    sublime.set_timeout_async(self.window.show_quick_panel(self.menu_list, self.on_chosen), 0)

dataset/ETHPy150Open eivind88/xkcd/xkcd.py XkcdGetComicCommand.getList/original