forked from MahmoudHegazi/scrape-social-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
460 lines (339 loc) · 10.5 KB
/
index.html
File metadata and controls
460 lines (339 loc) · 10.5 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<style>
body {
background: black;
color: white;
}
.interface {
border: 2px solid white;
height: 800px;
width: 95%;
margin-left: auto;
margin-right: auto;
margin-top: 30px;
}
.main {
display: grid;
grid-template-columns: 200px auto auto;
grid-template-rows: 200px 550px 1fr;
grid-template-areas:
"top top top top"
"aside content content content"
"foot foot foot foot";
height: 100%;
}
.flex_center {
display: flex;
justify-content: center;
align-items: center;
}
/* header style */
.grid_header{
grid-area:top;
border: 2px solid white;
background: url("https://c4.wallpaperflare.com/wallpaper/704/561/129/background-pattern-black-gold-hd-wallpaper-thumb.jpg");
}
.head_text {
font-size: 3em;
text-align: center;
}
/* aside style */
.grid_aside{
grid-area:aside;
border: 2px solid white;
display: flex;
flex-direction: column;
align-items: center;
background: url("https://c4.wallpaperflare.com/wallpaper/704/561/129/background-pattern-black-gold-hd-wallpaper-thumb.jpg");
}
.aside_title {
height: 50px;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
background: black;
}
.nav_continer {
border: 2px solid white;
width: 100%;
display: block;
text-align:center;
height: 100%;
overflow: auto;
}
.nav_link {
border: 2px solid white;
height: 10%;
width: 95%;
padding: 2px;
display: flex;
justify-content: center;
align-items: center;
background: url("https://media.istockphoto.com/vectors/black-abstract-background-vector-id686873178?k=6&m=686873178&s=612x612&w=0&h=RuUcV0I4JIhBCCWwGbFhflhLRItGk2Xp9H7xEe3uL_4=");
color: white;
cursor: pointer;
}
.nav_link:hover {
background: transparent;
opacity: .8;
}
/* content style */
.grid_content{
grid-area:content;
display: block;
overflow: auto;
background: url("https://c4.wallpaperflare.com/wallpaper/704/561/129/background-pattern-black-gold-hd-wallpaper-thumb.jpg");
}
.content_section {
margin-top: 30px;
width: 80%;
margin-left: auto;
margin-right: auto;
height: 80%;
background: black;
}
.content_section .section_title {
height: 10%;
border: 2px solid white;
overflow: auto;
cursor: pointer;
}
.content_section .section_main {
height: 88%;
overflow: auto;
border: 2px solid white;
text-align: center;
}
.section_main .input_field {
border: 2px solid gold;
width: 90%;
margin-top: 10px;
margin-left: auto;
margin-right: auto;
height: 20%;
display: block;
padding-top: 10px;
justify-content: center;
align-items: center;
flex-direction: column;
}
.csv_json_section {
height:40% !important;
text-align: center;
border: 2px solid green;
}
.load_icon_style {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
}
.load_icon_style img {
}
/* footer style */
.grid_footer{
grid-area:foot;
border: 2px solid white;
}
/* mobile style */
@media only screen and (max-width: 600px) {
.main {
display: grid;
grid-template-columns: auto auto;
grid-template-rows: 100px 200px 2fr 100px;
grid-template-areas:
"top top"
"aside aside"
"content content"
"foot foot";
height: 100%;
}
/* navlink */
.nav_link { height: 35px;margin-bottom:10px; width:80%; margin-left:auto; margin-right:auto;}
/* headtext */
.head_text {
font-size: 2em;
text-align: center;
}
}
</style>
</head>
<body>
<!-- /searchform/<string:username>/<string:csv_filename -->
<div class="interface">
<div class="main">
<div class="grid_header grid_box flex_center">
<h2 class="head_text">Soical Scraper Tool </h2>
</div>
<!-- aside -->
<div class="grid_aside grid_box ">
<div class="aside_title">Select App</div>
<div class="nav_continer">
<div class="nav_link">1</div>
<div class="nav_link">1</div>
<div class="nav_link">1</div>
<div class="nav_link">1</div>
<div class="nav_link">1</div>
<div class="nav_link">1</div>
</div>
</div>
<!-- end aside -->
<!-- content -->
<!-- load icon when scraper working or something loads -->
<div id="load_icon" class="load_icon_style" style="width:99%;height:100%;" style="display:none;">
<img src="https://i.pinimg.com/originals/90/80/60/9080607321ab98fa3e70dd24b2513a20.gif" alt="load image gif" style="width:100%; height:100%;">
</div>
<div class="grid_content grid_box" id="content_sectionid">
<div class="content_section">
<!-- data-action == current status -->
<div title="click to Close" class="section_title flex_center" data-action='open'>Search Form (Single Action)</div>
<div class="section_main">
<div class="input_field">
<label for="url_link">Profile URL: </label>
<input id="url_link" name="url_link" required="required">
</div>
<div class="input_field">
<label for="nametype" >Scrape Name </label>
<input type="radio" value="single" name="nametype" checked="checked" required="required">
first name
<input type="radio" value="all" name="nametype" required="required">
all
</div>
<div class="input_field csv_json_section" style="">
<div class="json_container">
<input type="radio" value="json" id="download_json_radio" name="download_type" checked="checked" required="required">
<label for="json_file" >JSON FILE Name: </label><br />
<input id="json_file_inpt" name="json_file">
</div>
<br />
<div class="csv_container">
<input type="radio" value="csv" id="download_csv_radio" name="download_type" required="required">
<label for="csv_file" >CSV FILE Name: </label><br />
<input id="csv_file_inpt" name="csv_file">
</div>
</div>
</div>
</div>
<div class="content_section">
<div title="click to open" class="section_title flex_center" data-action='close'>Search By URL (Single Action)</div>
<div class="section_main">4</div>
</div>
<div class="content_section">
<div title="click to open" class="section_title flex_center" data-action='close'>Search Form (multiple Action)</div>
<div class="section_main">6</div>
</div>
<div class="content_section">
<div title="click to open" class="section_title flex_center" data-action='close'>Search By URL (multiple Action)</div>
<div class="section_main">8</div>
</div>
</div>
<!-- end content -->
<div class="grid_footer grid_box flex_center">
<p class="copyright_p"><em>Developed and Desgined By Python King</em></p>
</div>
</div>
</div>
<script>
window.addEventListener('DOMContentLoaded', (event) => {
const section_titles = document.querySelectorAll(".section_title");
// content element
const content_container = document.querySelector("#content_sectionid");
const load_container = document.querySelector("#load_icon");
const how_to = document.querySelector("#how_to");
const how_to_btn = document.querySelector("#how_to_btn");
const json_download_radio = document.querySelector("#download_json_radio");
const csv_download_radio = document.querySelector("#download_csv_radio");
const json_file_name = document.querySelector("#json_file_inpt");
const csv_file_name = document.querySelector("#csv_file_inpt");
const download_ajson = () => {
json_download_radio.setAttribute('checked', 'checked');
json_file_name.setAttribute('required', 'required');
json_file_name.removeAttribute('disabled');
csv_file_name.removeAttribute('required');
csv_file_name.setAttribute('disabled', 'disabled');
}
const download_csv = () => {
csv_download_radio.setAttribute('checked', 'checked');
csv_file_name.removeAttribute('disabled');
csv_file_name.setAttribute('required', 'required');
json_file_name.setAttribute('disabled', 'disabled');
json_file_name.removeAttribute('required');
}
if (csv_download_radio.checked == true) {
download_csv();
} else {
download_ajson();
}
json_download_radio.addEventListener( 'click', download_ajson );
csv_download_radio.addEventListener( 'click', download_csv );
// load function
const show_load = ()=> {
load_container.style.display = "flex";
content_container.style.display = "none";
load_container.classList.add("grid_content");
return true;
};
const hide_load = ()=> {
load_container.style.display = "none";
content_container.style.display = "block";
load_container.classList.remove("grid_content");
return true;
};
const showload_for = (seconds)=> {
show_load();
let time_towait_milleseconds = (seconds * 1000) - 50;
setTimeout(function(){ hide_load(); return true;}, time_towait_milleseconds);
};
// AI no direct selector
const close = (element) => {
element.nextElementSibling.style.display = "none";
element.parentElement.style.height = '10%';
element.style.height = "100%";
};
const open = (element) => {
element.nextElementSibling.style.display = "block";
element.parentElement.style.height = '80%';
element.style.height = "10%";
showload_for(1);
};
const direct_action = (event) => {
action = event.target.getAttribute("data-action");
element = event.target;
if (action == "open"){
event.target.setAttribute("data-action", "close");
event.target.setAttribute("title", "Click To Open");
close(element);
return true;
} else {
event.target.setAttribute("data-action", "open");
event.target.setAttribute("title", "Click To Close");
open(element);
return true;
}
};
const collapse_titles_apply = () => {
section_titles.forEach( (title) => {
title.addEventListener( "click", direct_action );
});
};
// this function to check onload status to open the correct active
const correct_oder = ()=> {
section_titles.forEach( (sec)=> {
if (sec.getAttribute("data-action") == "open") {
open(sec);
} else {
close(sec);
}
});
};
correct_oder();
collapse_titles_apply();
showload_for(1);
});
</script>
</body>
</html>