-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
80 lines (70 loc) · 3.03 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
79
80
<html>
<head>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script type="text/javascript">
api_key = "YOUR_MEETUP_API_KEY";
$(function () {
var update = function () {
field_values = $('form').serialize()
url = "https://api.meetup.com/2/open_events"
+ "?key=" + api_key
+ "&sign=true"
+ "&photo-host=public"
+ "&limited_events=true"
+ "&text_format=plain"
+ "&" + field_values
+ "&page=100";
// console.log(url);
$.ajax({
url: url,
type: "GET",
dataType: "jsonp",
success: function (response) {
// console.log(response);
// console.log(response.results.length);
var r = new Array(), j = -1;
r[++j] = '<table><thead><tr><th>Name</th><th>Yes</th><th>Wait</th><th>Distance</th><th>Time</th></tr></thead><tbody>';
for (var key = 0, size = response.results.length; key < size; key++) {
r[++j] = '<tr><td>';
r[++j] = response.results[key].name;
r[++j] = '</td><td>';
r[++j] = response.results[key].yes_rsvp_count;
r[++j] = '</td><td>';
r[++j] = response.results[key].waitlist_count;
r[++j] = '</td><td>';
r[++j] = response.results[key].distance;
r[++j] = '</td><td><a href="';
r[++j] = response.results[key].event_url;
r[++j] = '" data-toggle="tooltip" title="';
r[++j] = $("<div>").text(response.results[key].group.name + '\n\n' + response.results[key].description).html();
r[++j] = '">';
d = new Date(response.results[key].time);
r[++j] = d.toLocaleTimeString();
r[++j] = '</a></td></tr>';
}
r[++j] = '</tbody></table>';
$('#dataTable').html(r.join(''));
},
error: function (xhr, status) {
alert(status);
}
});
};
update();
$('form').change(update);
$('form').submit(function () {
return false;
});
})
</script>
</head>
<body class="body">
<form target='_self'>
<input name='text' size='100' value='devops'>
<input name='time' value=',2d'>
<input name='country' value='gb'>
<input name='city' value='london'>
</form>
<div id="dataTable"></div>
</body>
</html>