返回 social-analyzer
app.html
根目录 / public / app.html
1 <!--
2 // -------------------------------------------------------------
3 // author Giga
4 // project qeeqbox/social-analyzer
5 // email gigaqeeq@gmail.com
6 // description app.py (CLI)
7 // licensee AGPL-3.0
8 // -------------------------------------------------------------
9 // contributors list qeeqbox/social-analyzer/graphs/contributors
10 // -------------------------------------------------------------
11 -->
12
13 <html>
14 <meta charset="utf-8" />
15 <title>QeeqBox - Social Analyzer</title>
16 <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css">
17 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.default.css" />
18 <script src="https://code.jquery.com/jquery-2.1.1.js"></script>
19 <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
20 <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.bundle.min.js"></script>
21 <script src="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/js/standalone/selectize.js"></script>
22 <script src="//unpkg.com/force-graph"></script>
23 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
24 <style>
25 html,
26 body {
27 width: 100%;
28 height: 100%;
29 margin: 0 !important;
30 padding: 0 !important;
31 overflow: hidden !important;
32 background-color: #212222;
33 }
34
35 header {
36 background-color: #2b2c2c;
37 position: fixed;
38 top: 0;
39 width: 100%;
40 overflow: hide;
41 box-shadow: 0 8px 5px rgba(0, 0, 0, .08);
42 }
43
44 a {
45 color: #d0d0d0 !important;
46 }
47
48 .navbar {
49 height: 50px;
50 color: #d0d0d0 !important;
51 }
52
53 body {
54 display: flex;
55 flex-direction: column;
56 }
57
58 body>* {
59 font-family: monospace !important;
60 font-size: 12px !important;
61 line-height: normal;
62 cursor: default !important;
63 color: #d0d0d0 !important;
64 }
65
66 #selectable {
67 vertical-align: top;
68 }
69
70 th {
71 text-align: left;
72 font-weight: normal !important;
73 background-color: #383939 !important;
74 }
75
76 table {
77 color: #d0d0d0 !important;
78 font-size: 12px !important;
79 margin-bottom: 20px;
80 border: 0;
81 box-shadow: none;
82 -webkit-border-radius: 2px !important;
83 border-radius: 2px !important;
84 width: 100%;
85 }
86
87 tr {
88 border-bottom: 1px solid #3c3c3c;
89 }
90
91 tr:first-child {
92 border-top: none;
93 }
94
95 tr:last-child {
96 border-bottom: none;
97 }
98
99 #selectable .ui-selecting {
100 background: #feca40;
101 }
102
103 #selectable .ui-selected {
104 background: #aa6400;
105 color: white;
106 }
107
108 #selectable ul {
109 margin: 0 0 0 0;
110 padding: 0 0 0 0;
111 list-style-type: none;
112 }
113
114 #selectable ul li {
115 border: none;
116 margin: 2px 2px 2px 2px;
117 }
118
119 .ui-selectable-helper {
120 position: absolute;
121 z-index: 100;
122 border: 1px dotted black;
123 }
124
125 #analyzed {
126 display: none;
127 }
128
129 .center-dev {
130 display: flex;
131 margin-left: auto;
132 margin-top: 50px;
133 padding-top: 20px;
134 overflow-y: auto !important;
135 overflow-x: hidden;
136 scrollbar-width: thin;
137 scrollbar-color: #aa6400 #272c2e;
138 justify-content: center;
139 width: 100%;
140 }
141
142 .string-analyzer-app {
143 width: 95%;
144 }
145
146 .cell-separator {
147 width: 15px;
148 }
149
150 .cell-separator-line {
151 width: 2px;
152 margin-left: 12px;
153 margin-right: 12px;
154 height: 26px;
155 background-color: #383939 !important
156 }
157
158 .separator {
159 height: 1px;
160 margin-bottom: 20px;
161 background-color: #3c3c3c;
162 margin-top: 20px;
163 }
164
165 input[type="text"] {
166 background-color: #383939 !important;
167 -webkit-border-radius: 2px !important;
168 border-radius: 2px !important;
169 border: none;
170 height: 26px;
171 padding: 3px 6px 3px 6px !important;
172 color: #d0d0d0 !important;
173 font-size: 12px;
174 }
175
176 input[type="button"] {
177 border: 0;
178 background-color: #383939 !important;
179 box-shadow: none;
180 -webkit-border-radius: 2px !important;
181 border-radius: 2px !important;
182 color: #d0d0d0 !important;
183 height: 26px;
184 border: none;
185 font-size: 12px;
186 }
187
188 .div-right1 {
189 flex: 1;
190 -webkit-box-shadow: inset 0px -1px 0px #3c3c3c inset;
191 -moz-box-shadow: inset 0px -1px 0px #3c3c3c inset;
192 box-shadow: 0px -1px 0px #3c3c3c inset;
193 margin-left: 10px !important;
194 }
195
196 .div-right {
197 flex: 1;
198 margin-left: 10px !important;
199 }
200
201 .div-left {
202 font-size: 16px;
203 line-height: 16px;
204 }
205
206
207 .div-header {
208 display: flex;
209 height: 15px;
210 color: #d0d0d0 !important;
211 margin-bottom: 20px;
212 }
213
214 .div-100 {
215 width: 100%;
216 display: flex;
217 margin-bottom: 20px;
218 align-items: center;
219 display: flex;
220 flex-wrap: wrap;
221 }
222
223 .div-100>* {
224 margin-top: 5px;
225 margin-bottom: 5px;
226 }
227
228 #analyzed-options li {
229 display: inline-block;
230 color: #d0d0d0 !important;
231 height: 26px;
232 line-height: 26px;
233 padding-left: 2px;
234 padding-right: 2px;
235 }
236
237 .selectize-dropdown .optgroup {
238 border-top: 1px solid #666666;
239 }
240
241 .optgroup-header {
242 border: none !important;
243 background-color: #383939 !important;
244 color: #d0d0d0 !important;
245 font-weight: bold;
246 font-size: 14px !important;
247 }
248
249 #lookups-section,
250 #possible-words-section,
251 #combinations-section,
252 #output-section-1,
253 #output-section-2,
254 #output-section-3,
255 #output-section-4,
256 #output-section-5,
257 #force-graph-section,
258 #logs-section,
259 #save-to-file-section,
260 #most-common-words-section,
261 #words-info-section,
262 #stats-section,
263 #metadata-section,
264 #ages-section,
265 #custom-search-section,
266 #names-origins-section {
267 display: none;
268 }
269
270 #lookups-checking-info {
271 text-align: left;
272 }
273
274
275 .navbar-nav {
276 flex-direction: inherit !important;
277 }
278
279 .nav-item {
280 font-size: 14px;
281 padding-left: 15px;
282 }
283
284 #most-common-words-section table tr th:first-child,
285 #most-common-words-section table tr td:first-child,
286 #words-info-section table tr th:first-child,
287 #words-info-section table tr td:first-child {
288 width: 150px;
289 min-width: 150px;
290 max-width: 150px;
291 word-break: break-word;
292 }
293
294 #words-info-section table tr th:nth-child(2),
295 #words-info-section table tr td:nth-child(2) {
296 width: 150px;
297 min-width: 150px;
298 max-width: 150px;
299 word-break: break-word;
300 }
301
302 #custom-search-section table tr th:first-child,
303 #custom-search-section table tr td:first-child {
304 width: 150px;
305 min-width: 150px;
306 max-width: 150px;
307 word-break: break-word;
308 }
309
310 .box-border-style {
311 background-color: #2b2c2c !important;
312 -webkit-border-radius: 2px !important;
313 border-radius: 2px !important;
314 border: none;
315 padding: 10px 10px 10px 10px;
316 margin-bottom: 20px;
317 }
318
319 .hex-spinner {
320 width: 140px;
321 height: 140px;
322 animation: spinner 2s linear infinite;
323 }
324
325 @keyframes spinner {
326 0% {
327 stroke-dasharray: 0 0 300 300;
328 }
329
330 50% {
331 stroke-dasharray: 0 150 300 300;
332 }
333
334 75% {
335 stroke-dasharray: 150 150 150 150;
336 }
337
338 100% {
339 stroke-dasharray: 300 300 150 150;
340 }
341 }
342
343 .waiting {
344 position: fixed;
345 z-index: 99999;
346 width: 100%;
347 height: 100%;
348 background: #212222;
349 opacity: .9;
350 display: none;
351 }
352
353 .waiting-box {
354 position: fixed;
355 top: 50%;
356 left: 50%;
357 transform: translate(-50%, -50%);
358 text-align: center;
359 display: none;
360 }
361
362 input[type='checkbox'] {
363 -webkit-appearance: none;
364 -webkit-box-shadow: none;
365 -moz-box-shadow: none;
366 box-shadow: none;
367 padding: 5px;
368 height: 5px;
369 color: #c0c0c0;
370 border: 1px solid #b4b4b4;
371 border-radius: 2px !important;
372 outline: none;
373 }
374
375 input[type='checkbox']:checked {
376 position: relative;
377 }
378
379 input[type='checkbox']:checked:before {
380 position: absolute;
381 display: block;
382 background: none #b4b4b4;
383 content: '';
384 height: 8px;
385 width: 8px;
386 left: 1px;
387 top: 1px;
388 }
389
390 #detection-options,
391 #google-api,
392 #user-agent-api,
393 #proxy-api {
394 margin-top: 10px;
395 width: 100%;
396 margin-bottom: 10px;
397 }
398
399 #detection-options-list {
400 list-style-type: none;
401 max-height: 200px;
402 text-align: left;
403 margin: 0;
404 padding: 0;
405 overflow: auto;
406 overflow-y: auto;
407 }
408
409 #detection-options li {
410 height: 20px;
411 line-height: 20px;
412 }
413
414 #detection-options label {
415 margin: 0;
416 padding-left: 5px;
417 }
418
419 #detection-options-buttons {
420 display: inline-flex;
421 margin-top: 10px;
422 }
423
424 .search-result {
425 list-style-type: none;
426 font-size: 17px;
427 padding: 5px;
428 }
429
430 .modal-header {
431 border-bottom: 1px solid #3c3c3c;
432 }
433
434 .modal-content {
435 background-color: #2b2c2c !important;
436 -webkit-border-radius: 2px !important;
437 border-radius: 2px !important;
438 border: none;
439 padding: 10px 10px 10px 10px;
440 margin-bottom: 20px;
441 }
442
443 .modal-footer {
444 border-top: 1px solid #3c3c3c;
445 }
446
447 #google-api input,
448 #user-agent-api input,
449 #proxy-api input {
450 width: 100%;
451 margin-bottom: 10px !important;
452 }
453
454 .modal-body .div-right {
455 flex: 1;
456 }
457
458 .modal-body .div-left {
459 font-size: 14px;
460 line-height: 14px;
461 }
462
463 .modal-body .div-header {
464 display: flex;
465 height: 15px;
466 color: #d0d0d0 !important;
467 margin-bottom: 10px;
468 }
469
470 .modal-dialog {
471 height: calc(100vh - 100px) !important;
472 display: flex;
473 }
474
475 .modal-content {
476 margin: auto !important;
477 height: fit-content !important;
478 }
479
480 .user-info-container {
481 display: flex;
482 max-height: 250px;
483 }
484
485 .user-info-container-right {
486 display: flex;
487 justify-content: center;
488 align-items: center;
489 }
490
491 .user-info-container-right img {
492 max-height: 210px;
493 padding: 10px;
494 }
495
496 .user-info-container-right_temp img {
497 filter: blur(5px);
498 }
499
500 .user-info-container-left {
501 flex-direction: column;
502 justify-content: center;
503 flex: 1 1 0;
504 overflow-y: auto !important;
505 overflow-x: hidden;
506 -ms-overflow-style: none;
507 scrollbar-width: none;
508 scrollbar-color: #aa6400 #272c2e;
509 }
510
511 .user-info-container-left::-webkit-scrollbar {
512 display: none;
513 }
514
515 .user-info-container {
516 padding-top: 10px;
517 padding-bottom: 10px;
518 border-bottom: 1px solid #3c3c3c;
519 }
520
521 .user-info-container:last-child {
522 border-bottom: none;
523 }
524
525 .box-border-style-settings {
526 background-color: transparent;
527 -webkit-border-radius: 2px !important;
528 border-radius: 2px !important;
529 border: none;
530 text-align: right;
531 margin-bottom: 10px;
532 font-size: 14px;
533 }
534
535 #string-section .div-right {
536 text-align: right;
537 font-size: 16px;
538 }
539
540 .selectize-control {
541 position: static !important;
542 background-color: #383939 !important;
543 min-width: 400px;
544 min-height: 20px;
545 line-height: 20px;
546 color: #d0d0d0 !important;
547 }
548
549 .selectize-input {
550 color: #d0d0d0 !important;
551 padding: 0px;
552 background-color: #383939 !important;
553 border: none !important;
554 min-width: 400px;
555 min-height: 20px;
556 line-height: 20px;
557 font-size: 10px;
558 }
559
560 #analyzed-options-selectized {
561 color: #d0d0d0 !important;
562 padding: 3px 6px 3px 6px !important;
563 }
564
565 .selectize-dropdown {
566 color: #d0d0d0 !important;
567 background-color: #383939 !important;
568 border: none !important;
569 }
570
571 .selectize-input .item {
572 background-color: #aa6400;
573 }
574
575 .item {
576 background: #aa6400 !important;
577 color: #ffffff !important;
578 }
579
580 .selectize-input [data-value] {
581 background-color: #111111;
582 background-image: none !important;
583 background-repeat: none !important;
584 -webkit-box-shadow: none !important;
585 box-shadow: none !important
586 }
587
588 .selectize-control.multi .selectize-input>div {
589 border: none !important;
590 }
591
592 .selectize-dropdown-content .active {
593 background: #2196f3 !important;
594 color: #ffffff !important;
595 }
596
597 .selectize-control.plugin-remove_button [data-value] .remove {
598 border-left: none !important;
599 }
600
601 #output-table-1 {
602 display: flex;
603 flex-direction: row;
604 flex-wrap: wrap;
605 }
606
607 .profile-card {
608 max-width: 320;
609 float: left;
610 padding: 10px;
611 white-space: nowrap;
612 overflow: hidden;
613 text-overflow: ellipsis;
614 }
615
616 .profile-card-text {
617 padding: 10px;
618 text-overflow: ellipsis;
619 }
620
621 .profile-card img {
622 max-height: 210px;
623 padding: 10px;
624 }
625
626 .logs {
627 padding-top: 20px
628 }
629
630 .logs_cancel {
631 padding-top: 10px;
632 display: none;
633 }
634
635 .user-info-container-color-unknown {
636 opacity: 0.4 !important;
637 }
638
639 .user-info-container-color-failed {
640 opacity: 0.1 !important;
641 }
642
643 #stats-tables tr td:nth-child(2),
644 #stats-tables tr th:nth-child(2) {
645 text-align: right;
646 }
647
648 #metadata-table tr td:nth-child(1),
649 #metadata-table tr th:nth-child(1) {
650 width: 50px;
651 }
652
653 .div-right-icon {
654 float: right;
655 font-size: 16px;
656 }
657
658 #logs-section pre {
659 color: #d0d0d0 !important;
660 font-size: 12px !important;
661 font-family: monospace !important;
662 }
663
664 #ixora-graph-iframe {
665 width: 100%;
666 height: 100%;
667 border: none !important;
668 }
669 </style>
670
671 <body>
672
673 <div class="waiting">
674 <div class="waiting-box">
675 <svg class="hex-spinner" viewBox="0 -5 100 110">
676 <polygon stroke-width="7" stroke="#aa6400" fill-opacity="0" id="hex" points="50 1 95 25 95 75 50 99 5 75 5 25" stroke-linecap="round" stroke-linejoin="round"/>
677 </svg>
678 <div class="logs" id="logs"></div>
679 <div class="logs_cancel" id="cancel_task">Cancel task? <i class="fa fa-window-close"></i></div>
680 </div>
681 </div>
682
683 <header>
684 <nav class="navbar navbar-expand-lg navbar-dark">
685 <a class="navbar-brand" href="#">Social Analyzer</a>
686 <ul class="navbar-nav ml-auto">
687 <li class="nav-item">
688 <a href="https://github.com/qeeqbox/social-analyzer/stargazers"> <i class="fa fa-star"></i></a>
689 </li>
690 <li class="nav-item">
691 <a href="https://github.com/qeeqbox/social-analyzer/archive/main.zip"> <i class="fa fa-download"></i></a>
692 </li>
693 <li class="nav-item">
694 <a href="https://github.com/qeeqbox/social-analyzer/watchers"> <i class="fa fa-eye"></i></a>
695 </li>
696 </ul>
697 </nav>
698 </header>
699
700 <div class="center-dev">
701 <div class="string-analyzer-app">
702 <div class="modal fade" id="settings-modal" role="dialog">
703 <div class="modal-dialog">
704 <div class="modal-content">
705 <div class="modal-header">
706 <div class="div-left">Settings</div>
707 <div class="div-right"></div>
708 </div>
709 <div class="modal-body">
710 <div id="user-agent-api">
711 <div class="div-header">
712 <div class="div-left">User-Agent (Optional)</div>
713 <div class="div-right"></div>
714 </div>
715 <input type="text" id="user-agent-string" placeholder="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0" />
716 </div>
717 <div id="proxy-api">
718 <div class="div-header">
719 <div class="div-left">HTTP\HTTPS Proxy (Optional)</div>
720 <div class="div-right"></div>
721 </div>
722 <input type="text" id="proxy-string" placeholder="http://host:port" />
723 </div>
724 <div id="google-api">
725 <div class="div-header">
726 <div class="div-left">Google API (Optional)</div>
727 <div class="div-right"></div>
728 </div>
729 <input type="text" id="google-api-key" placeholder="Google API Key" />
730 <input type="text" id="google-api-cs" placeholder="Google API CS" />
731 </div>
732 <div id="detection-options">
733 <div class="div-header">
734 <div class="div-left">Available websites</div>
735 <div class="div-right"></div>
736 </div>
737 <ul id="detection-options-list">
738 None
739 </ul>
740 <div id="detection-options-buttons">
741 <input type="button" id="settings-select-all" value="Select All" />
742 <div class="cell-separator"></div>
743 <input type="button" id='de-settings-select-all' value="De-Select All" />
744 <div class="cell-separator"></div>
745 <input type="button" id='select-top-10' value="Top 10" />
746 <div class="cell-separator"></div>
747 <input type="button" id='select-top-50' value="Top 50" />
748 <div class="cell-separator"></div>
749 <input type="button" id='select-top-100' value="Top 100" />
750 </div>
751 </div>
752 </div>
753 <div class="modal-footer">
754 <input type="button" id="save-settings" value="Save" />
755 <input type="button" value="Dismiss" data-dismiss="modal" />
756 </div>
757 </div>
758 </div>
759 </div>
760 <div class="box-border-style" id="string-section">
761 <div class="div-header">
762 <div class="div-left">Enter Profile Name</div>
763 <div class="div-right"><i id="open-settings" class="fa fa-cog"></i></div>
764 </div>
765 <div class="div-100 collapse show">
766 <input type="text" id="string-to-analyze" placeholder="Joe" />
767 <div class="cell-separator"></div>
768 <div name="analyzed-options" placeholder="Choose some options..." id="analyzed-options" multiple="multiple">
769 </div>
770 <div class="cell-separator"></div>
771 <div>or</div>
772 <div class="cell-separator"></div>
773 <input type="button" id="fast-options" value="Fast Options" />
774 <div class="cell-separator-line"></div>
775 <input type="button" id="analyze-normal" value="Analyze" />
776 <div class="cell-separator"></div>
777 <input type="button" id="clear-options" value="Clear" />
778 <div class="cell-separator"></div>
779 <input type="button" id="reset-everything" value="Reset" />
780 </div>
781 </div>
782 <div class="box-border-style" id="lookups-section">
783 <div class="div-header">
784 <div class="div-left">String LookUps</div>
785 <div class="div-right"><i class="div-right-icon fa fa-caret-up"></i></div>
786 </div>
787 <div class="div-100">
788 <div id="lookups-checking-info" class="collapse show"></div>
789 </div>
790 <div id="lookups-table">
791 </div>
792 </div>
793 <div class="box-border-style" id="most-common-words-section">
794 <div class="div-header">
795 <div class="div-left">Most common words by languages</div>
796 <div class="div-right"><i class="div-right-icon fa fa-caret-up"></i></div>
797 </div>
798 <div id="most-common-words-table" class="collapse show">
799 </div>
800 </div>
801 <div class="box-border-style" id="names-origins-section">
802 <div class="div-header">
803 <div class="div-left">Extracted names with orginis</div>
804 <div class="div-right"><i class="div-right-icon fa fa-caret-up"></i></div>
805 </div>
806 <div id="names-origins-table" class="collapse show">
807 </div>
808 </div>
809 <div class="box-border-style" id="possible-words-section">
810 <div class="div-header">
811 <div class="div-left">Extracted combinations</div>
812 <div class="div-right"><i class="div-right-icon fa fa-caret-up"></i></div>
813 </div>
814 <div id="possible-words-section-table" class="collapse show"></div>
815 </div>
816 <div class="box-border-style" id="ages-section">
817 <div class="div-header">
818 <div class="div-left">Extracted Profile\Person age (Maybe)</div>
819 <div class="div-right"><i class="div-right-icon fa fa-caret-up"></i></div>
820 </div>
821 <div id="ages-table" class="collapse show">
822 </div>
823 </div>
824 <div class="box-border-style" id="words-info-section">
825 <div class="div-header">
826 <div class="div-left">Extracted words information </div>
827 <div class="div-right"><i class="div-right-icon fa fa-caret-up"></i></div>
828 </div>
829 <div id="words-info-tables" class="collapse show">
830 </div>
831 </div>
832 <div class="box-border-style" id="custom-search-section">
833 <div class="div-header">
834 <div class="div-left">Custom Search</div>
835 <div class="div-right"><i class="div-right-icon fa fa-caret-up"></i></div>
836 </div>
837 <div id="custom-search-table" class="collapse show">
838 </div>
839 </div>
840 <div class="box-border-style" id="combinations-section">
841 <div class="div-header">
842 <div class="div-left">Save Report</div>
843 <div class="div-right"><i class="div-right-icon fa fa-caret-up"></i></div>
844 </div>
845 <div class="div-100 collapse show">
846 <input type="button" class="save-text" value="Save as (Text)" />
847 <div class="cell-separator"></div>
848 <input type="button" class="save-json" value="Save as (Json)" />
849 <div class="cell-separator"></div>
850 <input type="button" class="save-xml" value="Save as (XML)" />
851 </div>
852 </div>
853 <div class="box-border-style" id="output-section-1">
854 <div class="div-header">
855 <div class="div-left">Profiles</div>
856 <div class="div-right"><i class="div-right-icon fa fa-caret-up"></i></div>
857 </div>
858 <div id="output-table-1" class="collapse show"></div>
859 </div>
860 <div class="box-border-style" id="output-section-2">
861 <div class="div-header">
862 <div class="div-left">Detected Profiles (Advanced)</div>
863 <div class="div-right"><i class="div-right-icon fa fa-caret-up"></i></div>
864 </div>
865 <div id="output-table-2" class="collapse show"></div>
866 </div>
867 <div class="box-border-style" id="output-section-3">
868 <div class="div-header">
869 <div class="div-left">Detected Profiles (Normal)</div>
870 <div class="div-right"><i class="div-right-icon fa fa-caret-up"></i></div>
871 </div>
872 <div id="output-table-3" class="collapse show"></div>
873 </div>
874 <div class="box-border-style" id="output-section-4">
875 <div class="div-header">
876 <div class="div-left">All Profiles (Normal)</div>
877 <div class="div-right"><i class="div-right-icon fa fa-caret-up"></i></div>
878 </div>
879 <div id="output-table-4" class="collapse show"></div>
880 </div>
881 <div class="box-border-style" id="force-graph-section">
882 <div class="div-header">
883 <div class="div-left">Graph</div>
884 <div class="div-right"><i class="div-right-icon fa fa-caret-up"></i></div>
885 </div>
886 <div id="force-graph-canvas" class="collapse show">
887 </div>
888 </div>
889 <div class="box-border-style" id="metadata-section">
890 <div class="div-header">
891 <div class="div-left">Meta</div>
892 <div class="div-right"><i class="div-right-icon fa fa-caret-up"></i></div>
893 </div>
894 <div id="metadata-table" class="collapse show">
895 </div>
896 </div>
897 <div class="box-border-style" id="stats-section">
898 <div class="div-header">
899 <div class="div-left">Stats</div>
900 <div class="div-right"><i class="div-right-icon fa fa-caret-up"></i></div>
901 </div>
902 <div id="stats-tables" class="collapse show">
903 </div>
904 </div>
905 <div class="box-border-style" id="logs-section">
906 <div class="div-header">
907 <div class="div-left">Logs</div>
908 <div class="div-right"><i class="div-right-icon fa fa-caret-down"></i></div>
909 </div>
910 <div id="logs-pre" class="collapse"></div>
911 </div>
912 <div class="box-border-style" id="save-to-file-section">
913 <div class="div-header">
914 <div class="div-left">Save to file as</div>
915 <div class="div-right"><i class="div-right-icon fa fa-caret-up"></i></div>
916 </div>
917 <div class="div-100 collapse show">
918 <input type="button" id="download-json" value="JSON" />
919 </div>
920 </div>
921 </div>
922 </div>
923 <script>
924 /* eslint-disable camelcase */
925 const verbose = true
926 const analyzed_options_options = [{
927 group: 'Name Analysis',
928 value: 'WordInfo',
929 name: 'Get names or words information',
930 disable: false,
931 },
932 {
933 group: 'Name Analysis',
934 value: 'MostCommon',
935 name: 'Find common names or words by language',
936 disable: false,
937 },
938 {
939 group: 'Name Analysis',
940 value: 'FindOrigins',
941 name: 'Find origins of names or words',
942 disable: false,
943 },
944 {
945 group: 'Find Profiles',
946 value: 'LookUps',
947 name: 'Perform normal search queries',
948 disable: false,
949 },
950 {
951 group: 'Find Profiles',
952 value: 'CustomSearch',
953 name: 'Perform custom search queries',
954 disable: false,
955 },
956 {
957 group: 'Find Profiles',
958 value: 'FindUserProfilesFast,GetUserProfilesFast',
959 name: 'Find profiles in fast mode (Recommended)',
960 disable: false,
961 },
962 {
963 group: 'Find Profiles',
964 value: 'FindUserProfilesSlow',
965 name: 'Find profiles in slow mode',
966 disable: false,
967 },
968 {
969 group: 'Find Profiles',
970 value: 'FindUserProfilesSpecial',
971 name: 'Find profiles in slow mode using customized actions',
972 disable: false,
973 },
974 {
975 group: 'Show Profiles',
976 value: 'ShowUserProfilesSlow',
977 name: 'Show screenshots of profiles in slow mode',
978 disable: false,
979 },
980 {
981 group: 'Extract Information',
982 value: 'ExtractMetadata',
983 name: 'Extract metadata of profiles',
984 disable: false,
985 },
986 {
987 group: 'Extract Information',
988 value: 'ExtractPatterns',
989 name: 'Extract defined patterns',
990 disable: false,
991 },
992 {
993 group: 'Visualize Information',
994 value: 'NetworkGraph',
995 name: 'Show a visualized map based on the extracted metadata',
996 disable: false,
997 },
998 {
999 group: 'Stats',
1000 value: 'CategoriesStats',
1001 name: 'Generate stats of categories',
1002 disable: false,
1003 }, {
1004 group: 'Stats',
1005 value: 'MetadataStats',
1006 name: 'Generate stats of Metadata',
1007 disable: false,
1008 },
1009 {
1010 group: 'Other options',
1011 value: 'FindNumbers',
1012 name: 'Find numbers in names or words before analyzing',
1013 disable: false,
1014 },
1015 {
1016 group: 'Other options',
1017 value: 'FindAges',
1018 name: 'Find age in names or words before analyzing',
1019 disable: false,
1020 },
1021 {
1022 group: 'Other options',
1023 value: 'FindSymbols',
1024 name: 'Find symbols in names or words before analyzing',
1025 disable: false,
1026 },
1027 {
1028 group: 'Other options',
1029 value: 'ConvertNumbers',
1030 name: 'Convert numbers to letters before analyzing',
1031 disable: false,
1032 },
1033 {
1034 group: 'Other options',
1035 value: 'SplitWordsByAlphabet',
1036 name: 'Split word or name by alphabet before analyzing',
1037 disable: false,
1038 },
1039 {
1040 group: 'Other options',
1041 value: 'SplitWordsByUpperCase',
1042 name: 'Split word or name by upper case before analyzing',
1043 disable: false,
1044 },
1045 ];
1046
1047 const analyzed_options_groups = [{
1048 group: 'Name Analysis',
1049 },
1050 {
1051 group: 'Find Profiles',
1052 },
1053 {
1054 group: 'Show Profiles',
1055 },
1056 {
1057 group: 'Extract Information',
1058 },
1059 {
1060 group: 'Visualize Information',
1061 },
1062 {
1063 group: 'Stats',
1064 },
1065 {
1066 group: 'Other options',
1067 },
1068 ];
1069
1070 // $("#string-to-analyze").attr("placeholder", random_names[(Math.random() * random_names.length) | 0]);
1071 $('#string-to-analyze').attr('placeholder', 'johndoe');
1072
1073 let interval_logs;
1074 let output_json = {};
1075 let global_uuid = '';
1076 let current_settings = [];
1077
1078 function change_analyzed_option(string, key, value) {
1079 const obj = analyzed_options_options.find((o) => o.value === string);
1080 obj[key] = value;
1081 return obj;
1082 }
1083
1084 $('#analyzed-options').selectize({
1085 options: analyzed_options_options,
1086 optgroups: analyzed_options_groups,
1087 optgroupField: 'group',
1088 optgroupLabelField: 'group',
1089 optgroupValueField: 'group',
1090 valueField: 'value',
1091 labelField: 'name',
1092 disabledField: 'disable',
1093 searchField: ['group', 'value'],
1094 plugins: ['remove_button'],
1095 onChange(value, isOnInitialize) {
1096 const sel = $('#analyzed-options')[0].selectize;
1097 if (sel.items.includes('FindUserProfilesFast,GetUserProfilesFast')) {
1098 sel.updateOption('FindUserProfilesSlow', change_analyzed_option('FindUserProfilesSlow', 'disable', true));
1099 sel.updateOption('FindUserProfilesSpecial', change_analyzed_option('FindUserProfilesSpecial', 'disable', true));
1100 sel.updateOption('ShowUserProfilesSlow', change_analyzed_option('ShowUserProfilesSlow', 'disable', true));
1101 } else {
1102 sel.updateOption('FindUserProfilesSlow', change_analyzed_option('FindUserProfilesSlow', 'disable', false));
1103 sel.updateOption('FindUserProfilesSpecial', change_analyzed_option('FindUserProfilesSpecial', 'disable', false));
1104 sel.updateOption('ShowUserProfilesSlow', change_analyzed_option('ShowUserProfilesSlow', 'disable', false));
1105 }
1106 if (sel.items.includes('FindUserProfilesSlow') || sel.items.includes('FindUserProfilesSpecial') || sel.items.includes(
1107 'ShowUserProfilesSlow',
1108 )) {
1109 sel.updateOption('FindUserProfilesFast,GetUserProfilesFast', change_analyzed_option('FindUserProfilesFast,GetUserProfilesFast', 'disable', true));
1110 } else {
1111 sel.updateOption('FindUserProfilesFast,GetUserProfilesFast', change_analyzed_option('FindUserProfilesFast,GetUserProfilesFast', 'disable', false));
1112 }
1113 },
1114 });
1115
1116 function spinner_on_off(on_off, text = '', cancel = false) {
1117 if (on_off) {
1118 $('#logs').text(text);
1119 $('.waiting').show();
1120 $('.waiting-box').show();
1121 if (cancel === true) {
1122 $('.logs_cancel').show();
1123 }
1124 } else {
1125 $('#logs').text('');
1126 $('.waiting').hide();
1127 $('.waiting-box').hide();
1128 $('.logs_cancel').hide();
1129 }
1130 }
1131
1132 function save_to_file_as(output_json) {
1133 try {
1134 delete output_json.graph;
1135 window.URL = window.URL || window.webkitURL;
1136 const a = document.createElement('a');
1137 a.download = `${output_json.username.replace(/[^a-z0-9 ]/gi, '_').toLowerCase()}.json`;
1138 a.innerHTML = 'Download File';
1139 a.href = window.URL.createObjectURL(new Blob([JSON.stringify(output_json)], {
1140 type: 'application/json',
1141 }));
1142 a.style.display = 'none';
1143 document.body.appendChild(a);
1144 a.click();
1145 document.body.removeChild(a);
1146 } catch (err) {
1147 verbose && console.log(err);
1148 }
1149 }
1150
1151 function cancel_task(uuid) {
1152 $.ajax({
1153 type: 'POST',
1154 url: '/cancel',
1155 data: {
1156 option: 'on',
1157 uuid,
1158 },
1159 }).done((data) => {}).fail((jqXHR, textStatus, errorThrown) => {
1160 // clearInterval(interval_logs);
1161 });
1162 }
1163
1164 function get_logs(uuid) {
1165 $.ajax({
1166 type: 'POST',
1167 url: '/get_logs',
1168 data: {
1169 last_line: $('#logs').text(),
1170 uuid,
1171 },
1172 }).done((data) => {
1173 if (data !== 'Error' && data !== 'nothinghere' && data !== 'nothing_here_error' && data !== '') {
1174 $('#logs').text(data);
1175 } else if (data === 'nothing_here_error' || data === 'Error') {
1176 clearInterval(interval_logs);
1177 }
1178 }).fail((jqXHR, textStatus, errorThrown) => {
1179 // clearInterval(interval_logs);
1180 });
1181 }
1182
1183 function reset_everything() {
1184 // $('#analyzed-options')[0].selectize.clear()
1185 $('#lookups-checking-info').html('');
1186 $('#lookups-table').html('');
1187 $('#lookups-section').hide();
1188 $('#most-common-words-table').html('');
1189 $('#most-common-words-section').hide();
1190 $('#words-info-tables').html('');
1191 $('#words-info-section').hide();
1192 $('#possible-words-section').hide();
1193 $('#possible-words-section-table').html('');
1194 $('#combinations-section').hide();
1195 $('#output-section-1').hide();
1196 $('#output-table-1').html('');
1197 $('#output-section-2').hide();
1198 $('#output-table-2').html('');
1199 $('#output-section-3').hide();
1200 $('#output-table-3').html('');
1201 $('#output-section-4').hide();
1202 $('#output-table-4').html('');
1203 $('#force-graph-section').hide();
1204 $('#force-graph-canvas').html('');
1205 $('#logs-section').hide();
1206 $('#logs-pre').html('');
1207 $('#save-to-file-section').hide();
1208 $('#names-origins-section').hide();
1209 $('#names-origins-table').html('');
1210 $('#custom-search-section').hide();
1211 $('#custom-search-table').html('');
1212 $('#logs').html('');
1213 $('#stats-tables').html('');
1214 $('#stats-section').hide();
1215 $('#metadata-table').html('');
1216 $('#metadata-section').hide();
1217 $('#ages-table').html('');
1218 $('#ages-section').hide();
1219 clearInterval(interval_logs);
1220 }
1221
1222 function setup_selectable(tag) {
1223 $(tag).selectable({
1224 selecting(event, ui) {
1225 if ($(ui.selecting).hasClass('ui-selected')) {
1226 this.del_selected.push(ui.selecting);
1227 }
1228 },
1229 unselecting(event, ui) {
1230 $(ui.unselecting).addClass('ui-selected');
1231 },
1232 stop() {
1233 $.each(this.del_selected, (ix, de) => {
1234 $(de).removeClass('ui-selecting').removeClass('ui-selected');
1235 });
1236 this.del_selected = [];
1237 },
1238 });
1239 }
1240
1241 function add_extract(site) {
1242 let temp_extracted_all = '<div>Extracted: unavailable</div>';
1243 let temp_metadata_all = '<div>Metadata: unavailable</div>';
1244 try {
1245 if (site.extracted !== 'unavailable' && site.extracted !== '') {
1246 temp_extracted_all = '';
1247 site.extracted.forEach((extracted, i) => {
1248 let temp_extracted = '';
1249 Object.keys(extracted).forEach((key) => {
1250 temp_extracted += `${key} : ${extracted[key]} `;
1251 });
1252 temp_extracted_all += `<div>Extracted ${i}: ${temp_extracted}</div>`;
1253 });
1254 }
1255 } catch (err) {
1256 temp_extracted_all = '<div>Extracted: unavailable</div>';
1257 }
1258 try {
1259 if (site.metadata !== 'unavailable' && site.metadata !== '') {
1260 temp_metadata_all = '';
1261 site.metadata.forEach((extracted, i) => {
1262 let temp_metadata = '';
1263 Object.keys(extracted).forEach((key) => {
1264 temp_metadata += `${key} : ${extracted[key]} `;
1265 });
1266 temp_metadata_all += `<div>Metadata ${i}: ${temp_metadata}</div>`;
1267 });
1268 }
1269 } catch (err) {
1270 temp_metadata_all = '<div>Metadata: unavailable</div>';
1271 }
1272
1273 return temp_extracted_all + temp_metadata_all;
1274 }
1275
1276 function add_table(items) {
1277 let temp_th = '';
1278 let temp_td = '';
1279
1280 Object.keys(items).forEach((key) => {
1281 if (items[key].length > 0) {
1282 temp_th += `<th>${key}</th>`;
1283 let temp_ul = '';
1284 items[key].forEach((item) => {
1285 temp_ul += `<li>${item}</li>`;
1286 });
1287 temp_td += `<td id="selectable"><ul id="${key}-prefix-search-box">${temp_ul}</ul></td>`;
1288 }
1289 });
1290
1291 if (temp_th !== '' && temp_td !== '') {
1292 $('#possible-words-section-table').html(`<table><tr>${temp_th}</tr>` + `<tr>${temp_td}</tr>` + '</table>');
1293 $('#possible-words-section').show();
1294 }
1295 }
1296
1297 async function analyze_string() {
1298 reset_everything();
1299 spinner_on_off(true, 'Retrieving logs', true);
1300 output_json = {};
1301 const random_string = Math.random().toString(36).substring(2);
1302 global_uuid = random_string;
1303 interval_logs = setInterval(get_logs.bind(null, random_string), 1000);
1304 try {
1305 const list_of_options = [];
1306 $('.selectize-input .item').each(function() {
1307 list_of_options.push($(this).attr('data-value'));
1308 });
1309
1310 await $.ajax({
1311 type: 'POST',
1312 url: '/analyze_string',
1313 data: {
1314 string: $('#string-to-analyze').val(),
1315 group: false,
1316 option: list_of_options.join(','),
1317 uuid: random_string,
1318 },
1319 }).done((data) => {
1320 if (data !== 'Error') {
1321 let temp_tr = '';
1322 output_json = data;
1323 if (data.common.length > 0) {
1324 temp_tr = '';
1325 Object.keys(data.common).forEach((item) => {
1326 temp_tr += `<tr><td>${data.common[item].word}</td><td>${data.common[item].languages}</td></tr>`;
1327 });
1328
1329 $('#most-common-words-table').last().append(`<table><tr><th>word</th><th>languages</th></tr>${temp_tr}</table>`);
1330 $('#most-common-words-section').show();
1331 }
1332 if ((data.info.checking.indexOf('with no lookups') === -1)) {
1333 $('#lookups-checking-info').html(data.info.checking);
1334 if (data.info.items.length > 0) {
1335 temp_tr = '';
1336 Object.keys(data.info.items).forEach((item) => {
1337 temp_tr += `<tr><td>${data.info.items[item].title}</td><td>${data.info.items[item].snippet}</td></tr>`;
1338 });
1339 $('#lookups-table').last().append(`<table><tr><th>title</th><th>snippet</th></tr>${temp_tr}</table>`);
1340 $('#lookups-table').show();
1341 }
1342
1343 $('#lookups-section').show();
1344 }
1345 if (data.words_info.length > 0) {
1346 data.words_info.forEach((item) => {
1347 temp_tr = `<tr><td>${item.word}</td><td>definition</td><td>${item.text}</td></tr>`;
1348 if (item.results.length > 0) {
1349 item.results.forEach((result) => {
1350 temp_tr += `<tr><td>${item.word}</td><td>${result.type}</td><td>${result.text}</td></tr>`;
1351 });
1352 }
1353 $('#words-info-tables').last().append(`<table><tr><th>word</th><th>type</th><th>text</th></tr>${temp_tr}</table>`);
1354 });
1355 $('#words-info-section').show();
1356 }
1357
1358 add_table(data.table);
1359
1360 if (data.user_info_advanced.data.length > 0) {
1361 temp_tr = '';
1362 if (data.user_info_advanced.type === 'all' || data.user_info_advanced.type === 'noshow') {
1363 data.user_info_advanced.data.forEach((site) => {
1364 if (site.found > 0 || site.image !== '') {
1365 let temp_image = '';
1366 if (site.image !== '') {
1367 temp_image = `<img src=${site.image}>`;
1368 }
1369 const temp_extract_adv = add_extract(site);
1370 temp_tr += `<div class="user-info-container"><div class="user-info-container-left"><div>Link: <a href="${site.link}">${site.link}</a></div><div>Username: ${site.username}</div><div>Rate: ${site.rate}</div><div>Status: ${site.status
1371 }</div><div>Title: ${site.title
1372 }</div><div>Language: ${site.language}</div><div>Country: ${site.country}</div><div>Rank: ${site.rank}</div><div>Description: ${site.type}</div><div>Text: ${site.text}</div>${temp_extract_adv
1373 }</div><div class="user-info-container-right">${temp_image
1374 }</div></div>`;
1375 }
1376 });
1377
1378 $('#output-table-2').html(temp_tr);
1379 $('#output-section-2').show();
1380 } else if (data.user_info_advanced.type === 'show') {
1381 data.user_info_advanced.data.forEach((site) => {
1382 if (site.found > 0 || site.image !== '') {
1383 let temp_image = '';
1384 if (site.image !== '') {
1385 temp_image = `<img src=${site.image}>`;
1386 }
1387 temp_tr += `<div class="profile-card"><div class="profile-card-text">Link: <a href="${site.link}">${site.link}</a></div>${temp_image} </div>`;
1388 }
1389 });
1390
1391 $('#output-table-1').html(temp_tr);
1392 $('#output-section-1').show();
1393 }
1394 }
1395
1396 if (data.user_info_normal.data.length > 0) {
1397 temp_tr = '';
1398
1399 data.user_info_normal.data.forEach((site) => {
1400 if (site.method === 'all') {
1401 if (site.good === 'true') {
1402 const temp_extract_normal_all = add_extract(site);
1403 temp_tr += `<div class="user-info-container"><div class="user-info-container-left"><div>Link: <a href="${site.link}">${site.link}</a></div><div>Username: ${site.username}</div><div>Rate: ${site.rate}</div><div>Status: ${site.status
1404 }</div><div>Title: ${site.title
1405 }</div><div>Language: ${site.language}</div><div>Country: ${site.country}</div><div>Rank: ${site.rank}</div><div>Description: ${site.type}</div><div>Text: ${site.text}</div>${temp_extract_normal_all
1406 }</div><div class="user-info-container-right"></div></div>`;
1407 } else {
1408 temp_tr += `<div class="user-info-container user-info-container-color-unknown"><div class="user-info-container-left"><div>Link: <a href="${site.link}">${site.link}</a></div><div>Username: ${site.username}</div><div>Title: ${site.title
1409 }</div><div>Language: ${site.language}</div><div>Country: ${site.country}</div><div>Rank: ${site.rank}</div><div>Description: ${site.type}</div><div>Text: ${site.text
1410 }</div></div><div class="user-info-container-right"></div></div>`;
1411 }
1412 } else if (site.method === 'find') {
1413 if (site.good === 'true') {
1414 const temp_extract_normal_find = add_extract(site);
1415 temp_tr += `<div class="user-info-container"><div class="user-info-container-left"><div>Link: <a href="${site.link}">${site.link}</a></div><div>Username: ${site.username}</div><div>Rate: ${site.rate}</div><div>Status: ${site.status
1416 }</div><div>Title: ${site.title
1417 }</div><div>Language: ${site.language}</div><div>Country: ${site.country}</div><div>Rank: ${site.rank}</div><div>Description: ${site.type}</div><div>Text: ${site.text}</div>${temp_extract_normal_find
1418 }</div><div class="user-info-container-right"></div></div>`;
1419 }
1420 } else if (site.method === 'get') {
1421 temp_tr += `<div class="user-info-container user-info-container-color-unknown"><div class="user-info-container-left"><div>Link: <a href="${site.link}">${site.link}</a></div><div>Username: ${site.username}</div><div>Rate: ${site.rate
1422 }</div><div>Status: ${site.status}</div><div>Title: ${site.title
1423 }</div><div>Language: ${site.language}</div><div>Country: ${site.country}</div><div>Rank: ${site.rank}</div><div>Description: ${site.type}</div><div>Text: ${site.text
1424 }</div></div><div class="user-info-container-right"></div></div>`;
1425 } else if (site.method === 'failed') {
1426 temp_tr += `<div class="user-info-container user-info-container-color-failed"><div class="user-info-container-left"><div>Link: <a href="${site.link}">${site.link
1427 }</a></div><div>Username: ${site.username}</div></div><div class="user-info-container-right"></div></div>`;
1428 }
1429 });
1430
1431 $('#output-table-3').html(temp_tr);
1432 $('#output-section-3').show();
1433 }
1434
1435 if (data.user_info_special.data.length > 0) {
1436 temp_tr = '';
1437 data.user_info_special.data.forEach((site) => {
1438 if (site.found > 0) {
1439 const temp_image = '';
1440 temp_tr += `<div class="user-info-container"><div class="user-info-container-left"><div>Link: <a href="${site.link}">${site.link}</a></div><div>Username: ${site.username}</div><div>Rate: ${site.rate}</div><div>Status: ${site.status
1441 }</div><div>Title: ${site.title
1442 }</div><div>Description: ${site.type}</div><div>Text: ${site.text}</div></div><div class="user-info-container-right">${temp_image}</div></div>`;
1443 }
1444 });
1445
1446 $('#output-table-4').html(temp_tr);
1447 $('#output-section-4').show();
1448 }
1449 if (data.names_origins.length > 0) {
1450 temp_tr = '';
1451 Object.keys(data.names_origins).forEach((item) => {
1452 temp_tr += `<tr><td>${data.names_origins[item].origin}</td><td>${data.names_origins[item].name}</td><td>${data.names_origins[item].matched}</td><td>${data.names_origins[item].similar}</td><td>${data
1453 .names_origins[item].gender}</td></tr>`;
1454 });
1455 $('#names-origins-table').last().append(`<table><tr><th>origin</th><th>name</th><th>matched</th><th>similar</th><th>gender</th></tr>${temp_tr}</table>`);
1456 $('#names-origins-section').show();
1457 }
1458 if (data.custom_search.length > 0) {
1459 temp_tr = '';
1460 Object.keys(data.custom_search).forEach((item) => {
1461 temp_tr += `<tr><td>${data.custom_search[item].site}</td><td><a href="${data.custom_search[item].link}">${data.custom_search[item].link}</a></td><td>${data.custom_search[item].snippet}</td></tr>`;
1462 });
1463 $('#custom-search-table').last().append(`<table><tr><th>site</th><th>link</th><th>snippet</th></tr>${temp_tr}</table>`);
1464 $('#custom-search-section').show();
1465 }
1466
1467 if ((data.graph.graph.nodes.length > 0) && (data.graph.graph.links.length > 0)) {
1468 $('#force-graph-canvas').html('<iframe id="ixora-graph-iframe" src="/graph.html"></iframe>');
1469 $('#ixora-graph-iframe').load(function() {
1470 document.getElementById('ixora-graph-iframe').contentWindow.ixora_wrapper(data.graph, true);
1471 });
1472 $('#force-graph-section').show();
1473 }
1474
1475 Object.keys(data.stats).forEach((type_key) => {
1476 if(typeof data.stats[type_key] === "object" && !Array.isArray(data.stats[type_key])){
1477 if (Object.keys(data.stats[type_key]).length > 0) {
1478 Object.keys(data.stats[type_key]).forEach((status_key) => {
1479 temp_tr = '';
1480 data.stats[type_key][status_key].forEach((item) => {
1481 temp_tr += `<tr><td>${item[0]}</td><td>%${item[1]}</td></tr>`;
1482 });
1483 if (temp_tr.length > 0) {
1484 $('#stats-tables').last().append(`<table><tr><th>[${status_key} profiles] ${type_key}</th><th>Percentage</th></tr>${temp_tr}</table>`);
1485 }
1486 });
1487 $('#stats-section').show();
1488 }
1489 }
1490 if(typeof data.stats[type_key] === "object" && Array.isArray(data.stats[type_key])){
1491 temp_tr = '';
1492 data.stats[type_key].forEach((item) => {
1493 temp_tr += `<tr><td>${item[0]}</td><td>${item[1]}</td></tr>`;
1494 });
1495
1496 if (temp_tr.length > 0) {
1497 $('#metadata-table').last().append(`<table><tr><th>Total</th><th>Metadata string</th></tr>${temp_tr}</table>`);
1498 }
1499
1500 $('#metadata-section').show();
1501 }
1502 });
1503
1504 if(data.ages.length > 0){
1505 temp_tr = '';
1506 data.ages.forEach((item) => {
1507 temp_tr += `<tr><td>${item.found}</td><td>${item.year}</td><td>${item.age}</td></tr>`;
1508 });
1509
1510 if (temp_tr.length > 0) {
1511 $('#ages-table').last().append(`<table><tr><th>Found</th><th>Year</th><th>Age</th></tr>${temp_tr}</table>`);
1512 }
1513
1514 $('#ages-section').show();
1515 }
1516
1517 if (data.logs.length > 0) {
1518 $('#logs-pre').html(`<pre>${data.logs}</pre>`);
1519 $('#logs-section').show();
1520 }
1521
1522 if ((data.common.length > 0) || (data.info.checking.indexOf('with no lookups') === -1) || (data.words_info.length > 0) || (data.user_info_advanced.data.length > 0) || (data.user_info_normal.data.length > 0) || (data
1523 .user_info_special.data.length > 0) || (data.names_origins.length > 0) || (data.custom_search.length > 0)) {
1524 $('#save-to-file-section').show();
1525 } else {
1526 for (const [key, value] of Object.entries(data.table)) {
1527 if (value.length > 0) {
1528 $('#save-to-file-section').show();
1529 break;
1530 }
1531 }
1532 }
1533 }
1534 });
1535 } catch (err) {
1536 verbose && console.log(err);
1537 }
1538
1539 clearInterval(interval_logs);
1540 spinner_on_off(false);
1541 }
1542
1543 async function settings_modal(option) {
1544 spinner_on_off(true);
1545 if (option === 'get_settings') {
1546 await $.ajax({
1547 type: 'GET',
1548 url: '/get_settings',
1549 }).done((data) => {
1550 if (data !== 'Error') {
1551 if (data.websites.length > 0) {
1552 current_settings = data;
1553 let temp_tr = '';
1554 data.websites.forEach((site) => {
1555 let temp_selected = '';
1556 if (site.selected === 'true') {
1557 temp_selected = 'checked';
1558 }
1559 temp_tr += `<li><input type="checkbox" name=url_${site.index} ${temp_selected}><label for=url_${site.index}>${site.url}</label></li>`;
1560 });
1561
1562 $('#detection-options-list').html(temp_tr);
1563 }
1564 $('#user-agent-string').val(data.user_agent);
1565 $('#google-api-key').val(data.google[0]);
1566 $('#google-api-cs').val(data.google[1]);
1567 }
1568 });
1569 } else if (option === 'save_settings') {
1570 const temp_checked = [];
1571 $('#detection-options-list :checked').each(function() {
1572 temp_checked.push(Number(this.name.substring('url_'.length)));
1573 });
1574 await $.ajax({
1575 type: 'POST',
1576 url: '/save_settings',
1577 data: {
1578 websites: temp_checked.join(','),
1579 user_agent: $('#user-agent-string').val(),
1580 proxy: $('#proxy-string').val(),
1581 google_key: $('#google-api-key').val(),
1582 google_cv: $('#google-api-cs').val(),
1583 },
1584 }).done((data) => {
1585 if (data !== 'Error') {}
1586 });
1587 }
1588
1589 spinner_on_off(false);
1590 }
1591
1592 $('#de-settings-select-all').click((e) => {
1593 e.preventDefault();
1594 $('#detection-options-list input:checkbox').prop('checked', false);
1595 });
1596
1597 $('#settings-select-all').click((e) => {
1598 e.preventDefault();
1599 $('#detection-options-list input:checkbox').prop('checked', true);
1600 });
1601
1602 $('[id^=select-top-]').click(function(e) {
1603 e.preventDefault();
1604 if ('websites' in current_settings) {
1605 if (current_settings.websites.length > 0) {
1606 const websites_entries_filtered = current_settings.websites.filter((item) => item.global_rank !== 0);
1607 websites_entries_filtered.sort((a, b) => a.global_rank - b.global_rank);
1608 const top_websites = new RegExp('^select-top-([0-9]+)$', 'i');
1609 const matched = $(this).attr('id').match(top_websites);
1610 if (typeof matched !== 'undefined' && matched !== null) {
1611 $('#detection-options-list input:checkbox').prop('checked', false);
1612 for (let i = 0; i < matched[1]; i++) {
1613 $(`#detection-options-list input:checkbox[name="url_${websites_entries_filtered[i].index}"]`).prop('checked', true);
1614 }
1615 }
1616 }
1617 }
1618 });
1619
1620 setup_selectable('#analyzed-options');
1621
1622 $('#analyze-normal').click((e) => {
1623 e.preventDefault();
1624 analyze_string();
1625 });
1626
1627 $('.generate').click((e) => {
1628 e.preventDefault();
1629 // generate_combinations('Generate');
1630 });
1631
1632 $('#reset-everything').click((e) => {
1633 e.preventDefault();
1634 reset_everything();
1635 });
1636
1637 $('#save-settings').click((e) => {
1638 e.preventDefault();
1639 settings_modal('save_settings');
1640 $('#settings-modal').modal('toggle');
1641 });
1642
1643 $('#open-settings').click((e) => {
1644 e.preventDefault();
1645 settings_modal('get_settings');
1646 $('#settings-modal').modal();
1647 });
1648
1649 $('#clear-options').click((e) => {
1650 e.preventDefault();
1651 $('#analyzed-options')[0].selectize.clear();
1652 });
1653
1654 $('#fast-options').click((e) => {
1655 e.preventDefault();
1656 $('#analyzed-options')[0].selectize.clear();
1657 $('#analyzed-options')[0].selectize.setValue(['WordInfo', 'MostCommon', 'FindOrigins', 'LookUps', 'CustomSearch', 'FindUserProfilesFast,GetUserProfilesFast', 'ExtractMetadata', 'ExtractPatterns', 'NetworkGraph', 'FindNumbers',
1658 'CategoriesStats','MetadataStats','FindAges',
1659 'FindSymbols', 'SplitWordsByAlphabet', 'SplitWordsByUpperCase',
1660 ]);
1661 });
1662
1663 $('#download-json').click((e) => {
1664 e.preventDefault();
1665 save_to_file_as(output_json);
1666 });
1667
1668 $('#cancel_task').click((e) => {
1669 e.preventDefault();
1670 if (global_uuid !== '') {
1671 cancel_task(global_uuid);
1672 }
1673 });
1674
1675 $(function() {
1676 $('.div-header').click(function() {
1677 if (this.innerText !== 'Enter Profile Name') {
1678 if ($(this).next().hasClass('show')) {
1679 $(this).find('.div-right-icon').removeClass('fa-caret-up');
1680 $(this).find('.div-right-icon').addClass('fa-caret-down');
1681 } else {
1682 $(this).find('.div-right-icon').removeClass('fa-caret-down');
1683 $(this).find('.div-right-icon').addClass('fa-caret-up');
1684 }
1685 $(this).next().collapse('toggle');
1686 }
1687 });
1688 });
1689 </script>
1690 </body>
1691
1692 </html>
1693
1693 lines HTML