Read image from metadata, gitignore updates, cleanup cache py files
parent
665764bc80
commit
13bb18f8a3
|
@ -1,2 +1,4 @@
|
|||
scratch
|
||||
**/__pycache__/
|
||||
.#*
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -2,6 +2,7 @@
|
|||
|
||||
from pprint import pp
|
||||
from datetime import datetime
|
||||
from metadata_parser import MetadataParser
|
||||
|
||||
class Event:
|
||||
status = None
|
||||
|
@ -17,12 +18,17 @@ class Event:
|
|||
def setLocation(self, location):
|
||||
self.location = location
|
||||
|
||||
def setImageFromLink(self, link):
|
||||
page = MetadataParser(self.link)
|
||||
self.image = page.get_metadata_link('image')
|
||||
|
||||
def __str__(self):
|
||||
return str({
|
||||
'title': self.title,
|
||||
'time': self.time,
|
||||
'link': self.link,
|
||||
'status': self.status
|
||||
'status': self.status,
|
||||
'image': self.image
|
||||
})
|
||||
|
||||
def parseRSS(entry):
|
||||
|
@ -39,4 +45,6 @@ def parseRSS(entry):
|
|||
if 'ical_location' in entry:
|
||||
ev.setLocation(entry['ical_location'])
|
||||
|
||||
ev.setImageFromLink(ev.link)
|
||||
|
||||
return ev
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
sgqlc==v14.1
|
||||
feedparser==6.0.8
|
||||
metadata-parser==0.10.5
|
||||
lxml==4.6.3
|
||||
|
|
Loading…
Reference in New Issue