Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ JSMON_TELEGRAM_TOKEN=YOUR TELEGRAM TOKEN
JSMON_TELEGRAM_CHAT_ID=YOUR TELEGRAM CHAT ID
#JSMON_NOTIFY_SLACK=True
#JSMON_SLACK_TOKEN=sometoken
#JSMON_SLACK_CHANNEL_ID=somechannel
#JSMON_SLACK_CHANNEL_ID=somechannel_ID
```
To Enable slack, uncomment the slack lines in the env and add your token.
To Enable slack, uncomment the slack lines in the env and add your token (`JSMON_SLACK_CHANNEL_ID` should be in the form of: C04P1XXXXXX).

To create a cron script to run JSMon regularly:
```
Expand Down
6 changes: 3 additions & 3 deletions jsmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
NOTIFY_SLACK = config("JSMON_NOTIFY_SLACK", default=False, cast=bool)
NOTIFY_TELEGRAM = config("JSMON_NOTIFY_TELEGRAM", default=False, cast=bool)
if NOTIFY_SLACK:
from slack import WebClient
from slack.errors import SlackApiError
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError
if(SLACK_TOKEN == "CHANGEME"):
print("ERROR SLACK TOKEN NOT FOUND!")
exit(1)
Expand Down Expand Up @@ -130,7 +130,7 @@ def notify_telegram(endpoint,prev, new, diff, prevsize,newsize):

def notify_slack(endpoint,prev, new, diff, prevsize,newsize):
try:
response = client.files_upload(
response = client.files_upload_v2(
initial_comment = "[JSmon] {} has been updated! Download below diff HTML file to check changes.".format(endpoint),
channels = SLACK_CHANNEL_ID,
content = diff,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
author_email='mail@r0b.re',
license='MIT',
url='https://github.com/robre/jsmon',
install_requires=['requests', 'jsbeautifier', 'python-decouple','slackclient'],
install_requires=['requests', 'jsbeautifier', 'python-decouple','slack_sdk'],
)