Skip to content

Commit e970afa

Browse files
committed
simplify
1 parent 1b05071 commit e970afa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

linkedin_post_generator.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
# Get today's date
1212
today = datetime.today()
1313

14+
today_str = datetime.now().strftime('%Y-%m-%d')
15+
16+
1417
# Calculate the date 7 days ago
1518
seven_days_ago = today - timedelta(days=-1)
1619

@@ -52,7 +55,8 @@ def get_latest_buttondown_email():
5255
# For now, we'll assume the default API call without specific filters might return
5356
# recent ones and we'll pick the absolute latest from the results.
5457
# A more robust approach might involve `?ordering=-publish_date&limit=1` if the API supports it.
55-
FILTERS = f"&type=public&status=scheduled" # Attempt to get just one, the most recent
58+
59+
FILTERS = f"&type=public&publish_date__start={today_str}" # Attempt to get just one, the most recent
5660

5761
try:
5862
response = requests.request("GET", f"{BUTTONDOWN_BASE_URL}/v1{BUTTONDOWN_ENDPOINT}?{FILTERS}", headers=headers)

0 commit comments

Comments
 (0)