Add emojis to events
This commit is contained in:
parent
a8d36a55b0
commit
a4e226ea03
|
@ -13,7 +13,8 @@ def get_events(filepath: str) -> list[Event]:
|
||||||
date=item["from"],
|
date=item["from"],
|
||||||
end_date=item["to"],
|
end_date=item["to"],
|
||||||
name="accommodation",
|
name="accommodation",
|
||||||
title=(
|
title="🧳"
|
||||||
|
+ (
|
||||||
f'{item["location"]} Airbnb'
|
f'{item["location"]} Airbnb'
|
||||||
if item["operator"] == "airbnb"
|
if item["operator"] == "airbnb"
|
||||||
else item["name"]
|
else item["name"]
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
from datetime import date
|
from datetime import date
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
from rich.pretty import pprint
|
|
||||||
|
|
||||||
from .types import Event
|
from .types import Event
|
||||||
|
|
||||||
|
@ -34,7 +33,7 @@ def get_birthdays(from_date: date, filepath: str) -> list[Event]:
|
||||||
Event(
|
Event(
|
||||||
date=bday.replace(year=bday.year + offset),
|
date=bday.replace(year=bday.year + offset),
|
||||||
name="birthday",
|
name="birthday",
|
||||||
title=f'{entity["label"]} (aged {age + offset})',
|
title=f'🎈 {entity["label"]} (aged {age + offset})',
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ def get_list(filepath: str) -> list[Event]:
|
||||||
name="conference",
|
name="conference",
|
||||||
date=start_date,
|
date=start_date,
|
||||||
end_date=end_date,
|
end_date=end_date,
|
||||||
title=f'{conf["name"]} ({conf["location"]})',
|
title=f'🎤 {conf["name"]} ({conf["location"]})',
|
||||||
url=conf.get("url"),
|
url=conf.get("url"),
|
||||||
)
|
)
|
||||||
events.append(event)
|
events.append(event)
|
||||||
|
|
|
@ -7,6 +7,8 @@ from dateutil.relativedelta import TH, relativedelta
|
||||||
from . import uk_time
|
from . import uk_time
|
||||||
from .types import Event
|
from .types import Event
|
||||||
|
|
||||||
|
# emoji: 📰
|
||||||
|
|
||||||
|
|
||||||
def publication_dates(start_date: date, end_date: date) -> list[Event]:
|
def publication_dates(start_date: date, end_date: date) -> list[Event]:
|
||||||
"""List of Economist publication dates."""
|
"""List of Economist publication dates."""
|
||||||
|
|
|
@ -21,7 +21,7 @@ def get_events(data_dir: str) -> list[Event]:
|
||||||
date=start,
|
date=start,
|
||||||
end_date=end,
|
end_date=end,
|
||||||
name="meetup",
|
name="meetup",
|
||||||
title=item_event["title"],
|
title="👥" + item_event["title"],
|
||||||
url=item_event["eventUrl"],
|
url=item_event["eventUrl"],
|
||||||
)
|
)
|
||||||
events.append(e)
|
events.append(e)
|
||||||
|
|
|
@ -25,7 +25,7 @@ def get_flights(data_dir: str) -> list[Event]:
|
||||||
date=item["depart"],
|
date=item["depart"],
|
||||||
end_date=item.get("arrive"),
|
end_date=item.get("arrive"),
|
||||||
name="transport",
|
name="transport",
|
||||||
title=f'flight from {item["from"]} to {item["to"]} ({flight_number(item)})',
|
title=f'✈️ {item["from"]} to {item["to"]} ({flight_number(item)})',
|
||||||
url=item.get("url"),
|
url=item.get("url"),
|
||||||
)
|
)
|
||||||
for item in parse_yaml("flights", data_dir)
|
for item in parse_yaml("flights", data_dir)
|
||||||
|
@ -42,7 +42,7 @@ def get_trains(data_dir: str) -> list[Event]:
|
||||||
date=leg["depart"],
|
date=leg["depart"],
|
||||||
end_date=leg["arrive"],
|
end_date=leg["arrive"],
|
||||||
name="transport",
|
name="transport",
|
||||||
title=f'train from {leg["from"]} to {leg["to"]}',
|
title=f'🚆 {leg["from"]} to {leg["to"]}',
|
||||||
url=item.get("url"),
|
url=item.get("url"),
|
||||||
)
|
)
|
||||||
for leg in item["legs"]
|
for leg in item["legs"]
|
||||||
|
|
|
@ -95,7 +95,7 @@ def parse(root: lxml.html.HtmlElement) -> list[Event]:
|
||||||
Event(
|
Event(
|
||||||
name="waste_schedule",
|
name="waste_schedule",
|
||||||
date=uk_time(d, time(6, 30)),
|
date=uk_time(d, time(6, 30)),
|
||||||
title="Backwell: " + ", ".join(services),
|
title="🗑️ Backwell: " + ", ".join(services),
|
||||||
)
|
)
|
||||||
for d, services in by_date.items()
|
for d, services in by_date.items()
|
||||||
]
|
]
|
||||||
|
@ -204,6 +204,6 @@ async def get_bristol_gov_uk(start_date: date, data_dir: str, uprn: str) -> list
|
||||||
by_date[d].append(service)
|
by_date[d].append(service)
|
||||||
|
|
||||||
return [
|
return [
|
||||||
Event(name="waste_schedule", date=d, title="Bristol: " + ", ".join(services))
|
Event(name="waste_schedule", date=d, title="🗑️ Bristol: " + ", ".join(services))
|
||||||
for d, services in by_date.items()
|
for d, services in by_date.items()
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue