forked from GeekBoySupreme/GDG-Slackbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
78 lines (76 loc) · 3.18 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html>
<html>
<head>
<title>Post | GDG Kolkata</title>
<link rel="icon" href="favicon.png">
<link rel="stylesheet" href="assets/index.css"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript">
function send() {
var url = "https://hooks.slack.com/services/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";
// There is a message that we would get from the User.
var jsonSendingData={
"attachments": [
{
"fallback": "Required plain-text summary of the attachment.",
"color": "#f4d142",
"pretext": document.getElementById("topic").value,
"author_name": document.getElementById("fullname").value,
"author_link": document.getElementById("authorlink").value,
"author_icon": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR4mfYbONCyW7JTfdPCUJk_t78vzD6_hLg-tHDJpI6_TQLOy6VC",
"title": document.getElementById("topic").value,
"title_link": document.getElementById("information_link").value,
"text": document.getElementById("about").value,
"fields": [
{
"title": "Timeframe : "+document.getElementById("timeframe").value,
"value": "Stipend : "+document.getElementById("stipend").value,
"short": false
}
],
},
{
"fallback": "Mail at :"+ "mailto:"+document.getElementById("mail").value,
"actions": [
{
"type": "button",
"text": "Contact :angel:",
"url": "mailto:"+document.getElementById("mail").value
}
],
"image_url": "./emojis.png",
"thumb_url": "./emojis.png",
"footer": "GDG Kolkata",
"footer_icon": "https://platform.slack-edge.com/img/default_application_icon.png"
}
]
};
$.post(url, JSON.stringify(jsonSendingData));
document.getElementById("result").innerHTML = "Message has been sent successfully!";
}
</script>
</head>
<body>
<div id="form">
<img src="assets/gdg.png" width="125px" height="100px"/>
<p>Information passed through this form shall be posted on the Google Developers' Group, Kolkata Slack Channel. Cheers!</p>
<p> </p>
</p>
<input type="text" id="topic" placeholder="Topic" required/>
<input type="text" id="fullname" placeholder="Full Name" required/>
<input type="text" id="authorlink" placeholder="Link to your Social Profile"/>
<textarea type="text" id="about" placeholder="Enter Relevant Details" required></textarea>
<input type="text" id="information_link" placeholder="Link for more Info"/>
<input type="text" id="timeframe" placeholder="Timeframe"/>
<input type="text" id="stipend" placeholder="Stipend"/>
<input type="text" id="mail" placeholder="Mail ID" required/>
<p> </p>
<button onclick="send()">Send to Slack</button>
<p> </p>
<div id="result"> </div>
</div>
<p> </p>
</body>
</html>