Read image from metadata, gitignore updates, cleanup cache py files

master
Jurij Podgoršek 2021-09-30 22:14:33 +02:00
parent 665764bc80
commit 13bb18f8a3
7 changed files with 13 additions and 1 deletions

2
.gitignore vendored
View File

@ -1,2 +1,4 @@
scratch
**/__pycache__/
.#*

View File

@ -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

View File

@ -1,2 +1,4 @@
sgqlc==v14.1
feedparser==6.0.8
metadata-parser==0.10.5
lxml==4.6.3