Browse Source

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

master
Jurij Podgoršek 8 months ago
parent
commit
13bb18f8a3
  1. 2
      .gitignore
  2. BIN
      mobili_cli/__pycache__/__init__.cpython-38.pyc
  3. BIN
      mobili_cli/__pycache__/__init__.cpython-39.pyc
  4. BIN
      mobili_cli/__pycache__/cli.cpython-38.pyc
  5. BIN
      mobili_cli/__pycache__/event.cpython-39.pyc
  6. 10
      mobili_cli/event.py
  7. 2
      requirements.txt

2
.gitignore

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

BIN
mobili_cli/__pycache__/__init__.cpython-38.pyc

BIN
mobili_cli/__pycache__/__init__.cpython-39.pyc

BIN
mobili_cli/__pycache__/cli.cpython-38.pyc

BIN
mobili_cli/__pycache__/event.cpython-39.pyc

10
mobili_cli/event.py

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

2
requirements.txt

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