def get_items(xml):
 try:
  from bs4 import BeautifulSoup
 except ImportError:
  error = u'Missing dependency "BeautifulSoup4" and "lxml" required to import WordPress XML files.'
  sys.exit(error)
 with open(xml, encoding=u'utf-8') as infile:
  xmlfile = infile.read()
 soup = BeautifulSoup(xmlfile, u'xml')
 items = soup.rss.channel.findAll(u'item')
 return items

def get_items ( xml ) : try : from bs4 import BeautifulSoup except ImportError : error = u'Missing dependency "BeautifulSoup4" and "lxml" required to import WordPress XML files.' sys . exit ( error ) with open ( xml , encoding = u'utf-8' ) as infile : xmlfile = infile . read ( ) soup = BeautifulSoup ( xmlfile , u'xml' ) items = soup . rss . channel . findAll ( u'item' ) return items
get a list of alfred .