Compare commits
2 commits
98f2bb3ea6
...
68b34f7973
Author | SHA1 | Date | |
---|---|---|---|
Edward Betts | 68b34f7973 | ||
Edward Betts | d70a18ad82 |
|
@ -24,6 +24,7 @@ from . import (
|
||||||
economist,
|
economist,
|
||||||
fx,
|
fx,
|
||||||
gwr,
|
gwr,
|
||||||
|
hn,
|
||||||
meetup,
|
meetup,
|
||||||
stock_market,
|
stock_market,
|
||||||
subscription,
|
subscription,
|
||||||
|
@ -261,6 +262,7 @@ async def get_data(now: datetime) -> typing.Mapping[str, str | object]:
|
||||||
events += subscription.get_events(os.path.join(my_data, "subscriptions.yaml"))
|
events += subscription.get_events(os.path.join(my_data, "subscriptions.yaml"))
|
||||||
events += economist.publication_dates(last_week, next_year)
|
events += economist.publication_dates(last_week, next_year)
|
||||||
events += meetup.get_events(my_data)
|
events += meetup.get_events(my_data)
|
||||||
|
events += hn.whoishiring(last_year, next_year)
|
||||||
|
|
||||||
events += domains.renewal_dates(my_data)
|
events += domains.renewal_dates(my_data)
|
||||||
|
|
||||||
|
|
30
agenda/hn.py
Normal file
30
agenda/hn.py
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
"""Hacker News: Who Is Hiring post."""
|
||||||
|
|
||||||
|
from datetime import date, datetime, time, timedelta
|
||||||
|
|
||||||
|
import pytz
|
||||||
|
from dateutil.relativedelta import relativedelta
|
||||||
|
|
||||||
|
from .types import Event
|
||||||
|
|
||||||
|
eastern_time = pytz.timezone("America/New_York")
|
||||||
|
|
||||||
|
|
||||||
|
def whoishiring(start_date: date, end_date: date) -> list[Event]:
|
||||||
|
"""Who Is Hiring post."""
|
||||||
|
events: list[Event] = []
|
||||||
|
cur = start_date.replace(day=1)
|
||||||
|
t = time(11, 0)
|
||||||
|
while cur < end_date:
|
||||||
|
cur += relativedelta(months=1)
|
||||||
|
weekday = cur.weekday()
|
||||||
|
event_date = cur if 0 <= weekday <= 4 else cur + timedelta(days=7 - weekday)
|
||||||
|
events.append(
|
||||||
|
Event(
|
||||||
|
name="whoishiring",
|
||||||
|
date=eastern_time.localize(datetime.combine(event_date, t)),
|
||||||
|
url="https://news.ycombinator.com/submitted?id=whoishiring",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
return events
|
Loading…
Reference in a new issue