Skip to content

Commit 0463658

Browse files
author
Spencer
committed
updates
1 parent 7a53b23 commit 0463658

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

src/clicksend_sms_notifier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def send_notification(self, url: str, message: str, subject: Optional[str] = Non
9595
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
9696
sms_body = "WEBSITE CHANGE DETECTED\n"
9797
sms_body += f"Time: {timestamp}\n"
98-
sms_body += f"URL: {url}\n\n"
98+
# sms_body += f"URL: {url}\n\n"
9999

100100
# Include diff if provided, but limit length for SMS (160-1600 chars typical limit)
101101
if message and message.strip():

src/url_watcher.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@
1717

1818
import requests
1919

20-
from src.clicksend_sms_notifier import ClickSendSMSNotifier as SMSNotifier
21-
from src.clicksend_sms_notifier import create_notifier_from_env
20+
try:
21+
from src.clicksend_sms_notifier import ClickSendSMSNotifier as SMSNotifier
22+
from src.clicksend_sms_notifier import create_notifier_from_env
23+
except ImportError:
24+
from clicksend_sms_notifier import ClickSendSMSNotifier as SMSNotifier
25+
from clicksend_sms_notifier import create_notifier_from_env
2226

2327

2428
class URLWatcher:
@@ -42,7 +46,8 @@ def _save_cache(self):
4246
with open(self.storage_file, "w") as f:
4347
json.dump(self.cache, f, indent=2)
4448

45-
def _fetch_url_content(self, url):
49+
@staticmethod
50+
def _fetch_url_content(url):
4651
"""Fetch content from URL"""
4752
try:
4853
response = requests.get(url, timeout=10)
@@ -51,7 +56,8 @@ def _fetch_url_content(self, url):
5156
except requests.RequestException as e:
5257
raise Exception(f"Failed to fetch URL: {e}")
5358

54-
def _get_content_hash(self, content):
59+
@staticmethod
60+
def _get_content_hash(content):
5561
"""Generate hash of content for quick comparison"""
5662
return hashlib.sha256(content.encode("utf-8")).hexdigest()
5763

@@ -114,7 +120,8 @@ def check_url(self, url):
114120

115121
return True, diff
116122

117-
def _generate_diff(self, old_content, new_content, url):
123+
@staticmethod
124+
def _generate_diff(old_content, new_content, url):
118125
"""Generate human-readable difference between old and new content"""
119126
old_lines = old_content.splitlines(keepends=True)
120127
new_lines = new_content.splitlines(keepends=True)

0 commit comments

Comments
 (0)