seanbreckenridge / HPI

Human Programming Interface - a way to unify, access and interact with all of my personal data [my modules]
https://beepb00p.xyz/hpi.html
MIT License
69 stars 6 forks source link

fix my.google namedtuple structure #8

Closed seanbreckenridge closed 3 years ago

seanbreckenridge commented 3 years ago

parsing multiple links and having to call e.parse_json() on every element isnt great

https://github.com/seanbreckenridge/HPI/blob/master/my/google/models.py#L7-L32

probably could be done better by converting some HtmlEvents to some other type of model which has additional fields for the other links, or just reducing the amount of links one captures to 1/2

To debug:

for y in events():
    if hasattr(y, 'links'):
        if hasattr(y, 'Service') and y.Service == "Maps":
        continue
       j = json.loads(y.links)
       if len(j) > 1:
           print(y)
           print(j)
seanbreckenridge commented 3 years ago

solves in https://github.com/seanbreckenridge/HPI/commit/a107cbf45b89a55b81e4843e43b103e9beabbec8