Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

the twitter parser redone

  • Loading branch information...
commit c791a9d0b80395540a36223ece1da74a9bd60e08 1 parent 1dec061
philgo20 authored
Showing with 3 additions and 6 deletions.
  1. +3 −6 liclient/parsers/lixml.py
View
9 liclient/parsers/lixml.py
@@ -295,12 +295,9 @@ def __init__(self, content):
self.results = self.__build_data(self.tree)
def __build_data(self, tree):
- data = {}
- for n in tree.getchildren():
- if not n.getchildren():
- data[re.sub('-', '_', n.tag)] = n.text
- else:
- data[re.sub('-', '_', n.tag)] = n.getchildren()[0].text
+ data = dict(
+ [(re.sub('-','_',key),self.xpath_collection[key](tree)[0].text) for key in self.xpath_collection if len(self.xpath_collection[key](tree)) > 0]
+ )
results = mappers.TwitterAccount(data, tree)
return results
Please sign in to comment.
Something went wrong with that request. Please try again.