Compare commits
No commits in common. "68b34f797336f97bda74cdf30d6957c801fcdbe9" and "98f2bb3ea6694d966c1c76d5a46d791a9579e95a" have entirely different histories.
68b34f7973
...
98f2bb3ea6
|
@ -24,7 +24,6 @@ from . import (
|
|||
economist,
|
||||
fx,
|
||||
gwr,
|
||||
hn,
|
||||
meetup,
|
||||
stock_market,
|
||||
subscription,
|
||||
|
@ -262,7 +261,6 @@ async def get_data(now: datetime) -> typing.Mapping[str, str | object]:
|
|||
events += subscription.get_events(os.path.join(my_data, "subscriptions.yaml"))
|
||||
events += economist.publication_dates(last_week, next_year)
|
||||
events += meetup.get_events(my_data)
|
||||
events += hn.whoishiring(last_year, next_year)
|
||||
|
||||
events += domains.renewal_dates(my_data)
|
||||
|
||||
|
|
30
agenda/hn.py
30
agenda/hn.py
|
@ -1,30 +0,0 @@
|
|||
"""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