Skip to content

Commit 3727a3f

Browse files
committed
Added WebHook
1 parent 48875bd commit 3727a3f

File tree

3 files changed

+47
-8
lines changed

3 files changed

+47
-8
lines changed

diffJs.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from sys import argv
44
import os
55

6-
76
domain=argv[1]
87
all_domains=argv[2]
98
toolpath=os.getcwd()
@@ -17,9 +16,5 @@
1716

1817
os.system('./javascript_files_extractor.py '+all_domains+' ./temp/js_files.txt')
1918
os.system('./javascript_files_link_extractor.sh ./temp/js_files.txt ./results/'+domain+'/urls.txt ./dependency/relative-url-extractor/extract.rb')
20-
21-
if not first_time:
22-
os.system('./sendmail.sh')
23-
24-
19+
os.system('./sendmail.sh '+domain)
2520
os.system('git add . && git commit -m \"'+datetime.datetime.now().strftime("%I:%M%p on %B %d, %Y")+domain+'\"')

results/vanilla/changes.txt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
diff --git a/diffJs.py b/diffJs.py
2+
index 2eaf371..04a50c7 100755
3+
--- a/diffJs.py
4+
+++ b/diffJs.py
5+
@@ -3,7 +3,6 @@ import datetime
6+
from sys import argv
7+
import os
8+
9+
-
10+
domain=argv[1]
11+
all_domains=argv[2]
12+
toolpath=os.getcwd()
13+
@@ -17,9 +16,5 @@ if not first_time :
14+
15+
os.system('./javascript_files_extractor.py '+all_domains+' ./temp/js_files.txt')
16+
os.system('./javascript_files_link_extractor.sh ./temp/js_files.txt ./results/'+domain+'/urls.txt ./dependency/relative-url-extractor/extract.rb')
17+
-
18+
-if not first_time:
19+
- os.system('./sendmail.sh')
20+
-
21+
-
22+
+os.system('./sendmail.sh '+domain)
23+
os.system('git add . && git commit -m \"'+datetime.datetime.now().strftime("%I:%M%p on %B %d, %Y")+domain+'\"')
24+
\ No newline at end of file
25+
diff --git a/sendmail.sh b/sendmail.sh
26+
index d4c246b..e9a9098 100755
27+
--- a/sendmail.sh
28+
+++ b/sendmail.sh
29+
@@ -1,5 +1,8 @@
30+
if [[ $(git diff HEAD) ]]; then
31+
- echo 'dirty'
32+
+ git diff HEAD > ./results/$1/changes.txt
33+
+ date >> ./results/$1/changes.txt
34+
+ curl -d '{"changed":"'$1'"}' -H "Content-Type: application/json" -X POST https://hooks.zapier.com/hooks/catch/3086942/katsqw/
35+
+ echo 'Mail Sent for changes in $1 on $(date)'
36+
else
37+
- echo 'clean'
38+
+ echo 'No changes found'
39+
fi
40+
\ No newline at end of file
41+
Thu Mar 22 08:12:18 IST 2018

sendmail.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
if [[ $(git diff HEAD) ]]; then
2-
echo 'dirty'
2+
git diff HEAD > ./results/$1/changes.txt
3+
date >> ./results/$1/changes.txt
4+
curl -d '{"changed":"'$1'"}' -H "Content-Type: application/json" -X POST https://hooks.zapier.com/hooks/catch/3086942/katsqw/
5+
echo 'Mail Sent for changes in $1 on $(date)'
36
else
4-
echo 'clean'
7+
echo 'No changes found'
58
fi

0 commit comments

Comments
 (0)