- allRecentData = self._grab_json(flatXml)
- for recentCallData in allRecentData["messages"].itervalues():
- number = recentCallData["displayNumber"]
- exactDate = recentCallData["displayStartDateTime"]
- relativeDate = recentCallData["relativeStartTime"]
- action = ", ".join((
- label.title()
- for label in recentCallData["labels"]
- if label.lower() != "all" and label.lower() != "inbox"
- ))
- number = saxutils.unescape(number)
- exactDate = saxutils.unescape(exactDate)
- exactDate = datetime.datetime.strptime(exactDate, "%m/%d/%y %I:%M %p")
- relativeDate = saxutils.unescape(relativeDate)
- action = saxutils.unescape(action)
- yield "", number, exactDate, relativeDate, action
+ allRecentHtml = self._grab_html(flatXml)
+ allRecentData = self._parse_voicemail(allRecentHtml)
+ for recentCallData in allRecentData:
+ exactTime = recentCallData["time"]
+ if recentCallData["name"]:
+ header = recentCallData["name"]
+ elif recentCallData["prettyNumber"]:
+ header = recentCallData["prettyNumber"]
+ elif recentCallData["location"]:
+ header = recentCallData["location"]
+ else:
+ header = "Unknown"
+ yield header, recentCallData["number"], exactTime, recentCallData["relTime"], action