diff --git a/gitfiti.py b/gitfiti.py
index b327a1df60..21771be2dd 100755
--- a/gitfiti.py
+++ b/gitfiti.py
@@ -14,6 +14,7 @@
import json
import math
import os
+import re
try:
# Python 3+
from urllib.error import HTTPError, URLError
@@ -296,10 +297,12 @@ def parse_contributions_calendar(contributions_calendar):
"""Yield daily counts extracted from the embedded contributions SVG."""
for line in contributions_calendar.splitlines():
# a valid line looks like this:
- # 23 contributions on Sunday, February 26, 2023
- if 'data-date=' in line:
- commit = line.split('>')[1].split()[0] # yuck
+ # No contributions on August 27th.
+ pattern = r'(\bNo\b|\d+)\s+contributions on'
+ match = re.search(pattern, line, re.IGNORECASE)
+ if match:
+ commit = match.group(1)
if commit.isnumeric():
yield int(commit)