-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathblog.sql
1955 lines (1929 loc) · 177 KB
/
blog.sql
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
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Navicat Premium Data Transfer
Source Server : localMongoDB
Source Server Type : MongoDB
Source Server Version : 40404
Source Host : localhost:27017
Source Schema : blog
Target Server Type : MongoDB
Target Server Version : 40404
File Encoding : 65001
Date: 03/06/2021 21:27:19
*/
// ----------------------------
// Collection structure for classifications
// ----------------------------
db.getCollection("classifications").drop();
db.createCollection("classifications");
// ----------------------------
// Documents of classifications
// ----------------------------
db.getCollection("classifications").insert([ {
_id: ObjectId("6039284a2684e22ec8291c64"),
name: "学习笔记",
description: "学习笔记",
contentsNum: NumberInt("123"),
createdAt: ISODate("2021-02-26T16:56:42.832Z"),
updatedAt: ISODate("2021-06-01T15:01:41.747Z"),
__v: NumberInt("0"),
icon: "mdi-note-multiple",
rank: NumberInt("1")
} ]);
db.getCollection("classifications").insert([ {
_id: ObjectId("603928522684e22ec8291c65"),
name: "test后台测试",
description: "test",
contentsNum: NumberInt("1"),
createdAt: ISODate("2021-02-26T16:56:50.485Z"),
updatedAt: ISODate("2021-03-08T17:57:54.716Z"),
__v: NumberInt("0"),
icon: "mdi-test-tube",
rank: NumberInt("4")
} ]);
db.getCollection("classifications").insert([ {
_id: ObjectId("603928552684e22ec8291c66"),
name: "吐槽",
description: "吐槽",
contentsNum: NumberInt("14"),
createdAt: ISODate("2021-02-26T16:56:53.057Z"),
updatedAt: ISODate("2021-06-01T15:01:06.448Z"),
__v: NumberInt("0"),
icon: "mdi-home-edit",
rank: NumberInt("2")
} ]);
db.getCollection("classifications").insert([ {
_id: ObjectId("603928572684e22ec8291c67"),
name: "加密分类",
description: "加密分类",
contentsNum: NumberInt("9"),
createdAt: ISODate("2021-02-26T16:56:55.626Z"),
updatedAt: ISODate("2021-06-01T15:01:22.846Z"),
__v: NumberInt("0"),
icon: "mdi-book-lock",
rank: 3
} ]);
db.getCollection("classifications").insert([ {
_id: ObjectId("6047bf1d87fb8270c421decf"),
name: "学习笔记",
description: "nest.js学习笔记",
contentsNum: NumberInt("1"),
icon: "https://material.iconhelper.cn/",
rank: null,
createdAt: ISODate("2021-03-09T18:31:57.431Z"),
updatedAt: ISODate("2021-03-18T18:00:49.848Z"),
__v: NumberInt("0")
} ]);
// ----------------------------
// Collection structure for comments
// ----------------------------
db.getCollection("comments").drop();
db.createCollection("comments");
// ----------------------------
// Documents of comments
// ----------------------------
db.getCollection("comments").insert([ {
_id: ObjectId("60532dc33f4f2e30c0a87b0f"),
childId: [
ObjectId("60532e5c3f4f2e30c0a87b11"),
ObjectId("60537eb8e4557a64389a4f71"),
ObjectId("6053817d6928ba641817a2af"),
ObjectId("605381fe6928ba641817a2b1")
],
contentsId: "60519b8eab170f1d4875e77a",
authorId: "",
authorName: "Dwsy",
ip: "::1",
url: "test",
text: "# 一级标题123123\n\n## 二级标题\n\n### 三级标题\n\n#### 四级标题\n\n##### 五级标题\n\n###### 六级标题\n\n我展示的是一级标题\n==================\n\n我展示的是二级标题\n------------------\n\n*斜体文本*\n_斜体文本_\n**粗体文本**\n__粗体文本__\n***粗斜体文本***\n___粗斜体文本___\n\n---\n\n---\n\n---\n",
MD5email: "a0b7b30cbef507e1fad31e75c6a134ee",
email: "[email protected]",
agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36 Edg/89.0.774.54",
isChild: false,
createdAt: ISODate("2021-03-18T10:38:59.6Z"),
updatedAt: ISODate("2021-03-18T16:38:22.209Z"),
__v: NumberInt("0")
} ]);
db.getCollection("comments").insert([ {
_id: ObjectId("60532e0d3f4f2e30c0a87b10"),
childId: [ ],
contentsId: "60519b8eab170f1d4875e77a",
authorId: "",
authorName: "test",
ip: "::1",
url: "test",
text: "test\n# 123",
MD5email: "098f6bcd4621d373cade4e832627b4f6",
email: "test",
agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36 Edg/89.0.774.54",
isChild: false,
createdAt: ISODate("2021-03-18T10:40:13.117Z"),
updatedAt: ISODate("2021-03-18T10:40:13.117Z"),
__v: NumberInt("0")
} ]);
db.getCollection("comments").insert([ {
_id: ObjectId("60532e5c3f4f2e30c0a87b11"),
childId: [ ],
contentsId: "60519b8eab170f1d4875e77a",
authorId: "777",
authorName: "评论测试",
ip: "::ffff:127.0.0.1",
url: "评论测试",
text: "回复@Dwsy:```shell\n#!/bin/bash\nfunWithReturn(){\n echo \"输入第一个数字: \"\n read aNum\n echo \"输入第二个数字: \"\n read anotherNum\n echo \"两个数字分别为 $aNum 和 $anotherNum !\"\n return $(($aNum+$anotherNum))\n}\nfunWithReturn\necho \"输入的两个数字之和为 $?\"\n```",
MD5email: "d83f67c56c7699c3178ba10a8daa767b",
email: "1@1",
fatherId: "60532dc33f4f2e30c0a87b0f",
agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36 Edg/89.0.774.54",
isChild: true,
createdAt: ISODate("2021-03-18T10:41:32.821Z"),
updatedAt: ISODate("2021-03-18T10:41:32.821Z"),
__v: NumberInt("0")
} ]);
db.getCollection("comments").insert([ {
_id: ObjectId("605331823f4f2e30c0a87b12"),
childId: [
ObjectId("605331c43f4f2e30c0a87b13")
],
contentsId: "60519b8eab170f1d4875e77a",
authorId: "",
authorName: "ttt",
ip: "::ffff:127.0.0.1",
url: "ttt",
text: "test",
MD5email: "9990775155c3518a0d7917f7780b24aa",
email: "ttt",
agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36 Edg/89.0.774.54",
isChild: false,
createdAt: ISODate("2021-03-18T10:54:58.866Z"),
updatedAt: ISODate("2021-03-18T10:56:04.708Z"),
__v: NumberInt("0")
} ]);
db.getCollection("comments").insert([ {
_id: ObjectId("605331c43f4f2e30c0a87b13"),
childId: [ ],
contentsId: "60519b8eab170f1d4875e77a",
authorId: "777",
authorName: "评论测试",
ip: "::ffff:127.0.0.1",
url: "评论测试",
text: "回复@ttt:test",
MD5email: "d83f67c56c7699c3178ba10a8daa767b",
email: "1@1",
fatherId: "605331823f4f2e30c0a87b12",
agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36 Edg/89.0.774.54",
isChild: true,
createdAt: ISODate("2021-03-18T10:56:04.707Z"),
updatedAt: ISODate("2021-03-18T10:56:04.707Z"),
__v: NumberInt("0")
} ]);
db.getCollection("comments").insert([ {
_id: ObjectId("605333673f4f2e30c0a87b14"),
childId: [ ],
contentsId: "60519b8eab170f1d4875e77a",
authorId: "",
authorName: "test",
ip: "::ffff:127.0.0.1",
url: "",
text: "正常文本测试",
MD5email: "d41d8cd98f00b204e9800998ecf8427e",
email: "",
agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36 Edg/89.0.774.54",
isChild: false,
createdAt: ISODate("2021-03-18T11:03:03.732Z"),
updatedAt: ISODate("2021-03-18T11:03:03.732Z"),
__v: NumberInt("0")
} ]);
db.getCollection("comments").insert([ {
_id: ObjectId("60537f4a2bd7c46cacad8249"),
childId: [ ],
contentsId: "60519b8eab170f1d4875e77a",
authorId: "",
authorName: "测试",
ip: "::1",
url: "测试测试",
text: "测试测试测试",
MD5email: "db06c78d1e24cf708a14ce81c9b617ec",
email: "测试",
agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36 Edg/89.0.774.54",
isChild: false,
createdAt: ISODate("2021-03-18T16:26:50.435Z"),
updatedAt: ISODate("2021-03-18T16:26:50.435Z"),
__v: NumberInt("0")
} ]);
db.getCollection("comments").insert([ {
_id: ObjectId("609e6a5547fa890c80ce45e6"),
childId: [ ],
contentsId: "603e751045d89d46e830734a",
authorId: "",
authorName: "123",
ip: "::1",
url: "123",
text: "123",
MD5email: "202cb962ac59075b964b07152d234b70",
email: "123",
agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36 Edg/90.0.818.56",
isChild: false,
createdAt: ISODate("2021-05-14T12:17:25.869Z"),
updatedAt: ISODate("2021-05-14T12:17:25.869Z"),
__v: NumberInt("0")
} ]);
db.getCollection("comments").insert([ {
_id: ObjectId("60b652d8a0137a1b988d468f"),
childId: [ ],
contentsId: "60a8e3ab77535e3424b9591c",
authorId: "",
authorName: "Dwsy",
ip: "::ffff:127.0.0.1",
url: "dwsy",
text: "滴滴答答",
MD5email: "a0b7b30cbef507e1fad31e75c6a134ee",
email: "[email protected]",
agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36 Edg/91.0.864.37",
isChild: false,
createdAt: ISODate("2021-06-01T15:31:36.538Z"),
updatedAt: ISODate("2021-06-01T15:31:36.538Z"),
__v: NumberInt("0")
} ]);
// ----------------------------
// Collection structure for contents
// ----------------------------
db.getCollection("contents").drop();
db.createCollection("contents");
db.getCollection("contents").createIndex({
"$**": "text"
}, {
name: "内容",
weights: {
text: NumberInt("1")
},
"default_language": "english",
"language_override": "language",
textIndexVersion: NumberInt("3")
});
// ----------------------------
// Documents of contents
// ----------------------------
db.getCollection("contents").insert([ {
_id: ObjectId("603e751045d89d46e830734a"),
fieldsId: "603e645cdc5d115e3c5071a3",
text: "<html><head></head><body><p><strong>cat.model.ts</strong></p>\n<pre><code class=\"language-javascript\">import { prop } from \"@typegoose/typegoose\";\nimport { IsString } from \"class-validator\";\n\nexport class Cat {\n @IsString()\n @prop({ required: true })\n name: string;\n}\n</code></pre>\n<p><strong>qweqwe</strong></p>\n<p><em>qweqw</em></p>\n<p><code>啊实打实的</code></p>\n<p><a href=\"\">asdasd</a></p>\n<blockquote>\n<p>123</p>\n</blockquote>\n<ol>\n<li>1</li>\n<li>2</li>\n<li>3</li>\n<li>4</li>\n<li>5</li>\n</ol>\n<ul>\n<li class=\"vditor-task\"><input checked=\"\" disabled=\"\" type=\"checkbox\"> 1</li>\n<li class=\"vditor-task\"><input checked=\"\" disabled=\"\" type=\"checkbox\"> 2</li>\n</ul>\n<h2 id=\"t0\">1</h2>\n<h1 id=\"t1\">1</h1>\n<p>[11]:</p>\n<table>\n<thead>\n<tr>\n<th></th>\n<th></th>\n<th></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<p><strong>cat.model.ts</strong></p>\n<pre><code class=\"language-javascript\">import { prop } from \"@typegoose/typegoose\";\nimport { IsString } from \"class-validator\";\n\nexport class Cat {\n @IsString()\n @prop({ required: true })\n name: string;\n}\n</code></pre>\n<p><strong>qweqwe</strong></p>\n<p><em>qweqw</em></p>\n<p><code>啊实打实的</code></p>\n<p><a href=\"\">asdasd</a></p>\n<blockquote>\n<p>123</p>\n</blockquote>\n<ol>\n<li>1</li>\n<li>2</li>\n<li>3</li>\n<li>4</li>\n<li>5</li>\n</ol>\n<ul>\n<li class=\"vditor-task\"><input checked=\"\" disabled=\"\" type=\"checkbox\"> 1</li>\n<li class=\"vditor-task\"><input checked=\"\" disabled=\"\" type=\"checkbox\"> 2</li>\n</ul>\n<h2 id=\"t2\">1</h2>\n<h1 id=\"t3\">1</h1>\n<p>[11]:</p>\n<table>\n<thead>\n<tr>\n<th></th>\n<th></th>\n<th></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<div class=\"footnotes-defs-div\"><hr class=\"footnotes-defs-hr\">\n<ol class=\"footnotes-defs-ol\"><li id=\"footnotes-def-1\"></li>\n</ol></div></body></html>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:25:36.44Z"),
updatedAt: ISODate("2021-06-01T14:52:03.014Z"),
__v: NumberInt("0"),
mdText: "**cat.model.ts**\n\n```javascript\nimport { prop } from \"@typegoose/typegoose\";\nimport { IsString } from \"class-validator\";\n\nexport class Cat {\n @IsString()\n @prop({ required: true })\n name: string;\n}\n```\n\n**qweqwe**\n\n*qweqw*\n\n`啊实打实的`\n\n[asdasd]()\n\n> 123\n\n1. 1\n2. 2\n3. 3\n4. 4\n5. 5\n\n- [X] 1\n- [X] 2\n\n## 1\n\n# 1\n\n[^1]:\n \n[11]:\n\n\n| | | |\n| --- | --- | --- |\n| | | |\n| | | |\n| | | |\n\n**cat.model.ts**\n\n```javascript\nimport { prop } from \"@typegoose/typegoose\";\nimport { IsString } from \"class-validator\";\n\nexport class Cat {\n @IsString()\n @prop({ required: true })\n name: string;\n}\n```\n\n**qweqwe**\n\n*qweqw*\n\n`啊实打实的`\n\n[asdasd]()\n\n> 123\n\n1. 1\n2. 2\n3. 3\n4. 4\n5. 5\n\n- [X] 1\n- [X] 2\n\n## 1\n\n# 1\n\n[^1]:\n \n[11]:\n\n\n| | | |\n| --- | --- | --- |\n| | | |\n| | | |\n| | | |\n",
menus: {
menus: [
{
type: "h2",
target: "#t0",
title: "1"
},
{
type: "h1",
target: "#t1",
title: "1"
},
{
type: "h2",
target: "#t2",
title: "1"
},
{
type: "h1",
target: "#t3",
title: "1"
}
],
summary: "**cat.model.ts**```javascriptimport { prop } from \"@typegoose/typegoose\";import { IsString } from \"class-validator\";export class Cat { @IsStri"
}
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e756b45d89d46e830734b"),
fieldsId: "603e645edc5d115e3c5071a4",
text: "<html><head></head><body><p>test</p>\n</body></html>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:27:07.993Z"),
updatedAt: ISODate("2021-06-01T14:54:38.628Z"),
__v: NumberInt("0"),
mdText: "test\n",
menus: {
menus: [ ],
summary: "test"
}
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d0700bde471cfe5f20"),
fieldsId: "603e645fdc5d115e3c5071a5",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:04.339Z"),
updatedAt: ISODate("2021-03-02T17:33:04.339Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d0700bde471cfe5f21"),
fieldsId: "603e645fdc5d115e3c5071a6",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:04.741Z"),
updatedAt: ISODate("2021-03-02T17:33:04.741Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d1700bde471cfe5f22"),
fieldsId: "603e6460dc5d115e3c5071a7",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:05.174Z"),
updatedAt: ISODate("2021-03-07T18:07:46.086Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d1700bde471cfe5f24"),
fieldsId: "603e6460dc5d115e3c5071a9",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:05.955Z"),
updatedAt: ISODate("2021-03-02T17:33:05.955Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d2700bde471cfe5f25"),
fieldsId: "603e6461dc5d115e3c5071aa",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:06.368Z"),
updatedAt: ISODate("2021-03-02T17:33:06.368Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d2700bde471cfe5f26"),
fieldsId: "603e6462dc5d115e3c5071ab",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:06.788Z"),
updatedAt: ISODate("2021-03-02T17:33:06.788Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d3700bde471cfe5f27"),
fieldsId: "603e6463dc5d115e3c5071ac",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:07.175Z"),
updatedAt: ISODate("2021-03-02T17:33:07.175Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d4700bde471cfe5f28"),
fieldsId: "603e6464dc5d115e3c5071ad",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:08.106Z"),
updatedAt: ISODate("2021-03-02T17:33:08.106Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d4700bde471cfe5f29"),
fieldsId: "603e6465dc5d115e3c5071ae",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:08.426Z"),
updatedAt: ISODate("2021-03-02T17:33:08.426Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d4700bde471cfe5f2a"),
fieldsId: "603e6465dc5d115e3c5071af",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:08.766Z"),
updatedAt: ISODate("2021-03-02T17:33:08.766Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d5700bde471cfe5f2b"),
fieldsId: "603e6466dc5d115e3c5071b0",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:09.157Z"),
updatedAt: ISODate("2021-03-02T17:33:09.157Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d5700bde471cfe5f2c"),
fieldsId: "603e6466dc5d115e3c5071b1",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:09.56Z"),
updatedAt: ISODate("2021-03-02T17:33:09.56Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d5700bde471cfe5f2d"),
fieldsId: "603e6466dc5d115e3c5071b2",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:09.927Z"),
updatedAt: ISODate("2021-03-02T17:33:09.927Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d6700bde471cfe5f2e"),
fieldsId: "603e6467dc5d115e3c5071b3",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:10.3Z"),
updatedAt: ISODate("2021-03-02T17:33:10.3Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d6700bde471cfe5f2f"),
fieldsId: "603e6467dc5d115e3c5071b4",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:10.622Z"),
updatedAt: ISODate("2021-03-02T17:33:10.622Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d6700bde471cfe5f30"),
fieldsId: "603e6467dc5d115e3c5071b5",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:10.958Z"),
updatedAt: ISODate("2021-03-02T17:33:10.958Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d7700bde471cfe5f31"),
fieldsId: "603e6467dc5d115e3c5071b6",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:11.29Z"),
updatedAt: ISODate("2021-03-02T17:33:11.29Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d8700bde471cfe5f32"),
fieldsId: "603e6467dc5d115e3c5071b7",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:12.167Z"),
updatedAt: ISODate("2021-03-02T17:33:12.167Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d8700bde471cfe5f33"),
fieldsId: "603e6467dc5d115e3c5071b8",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:12.495Z"),
updatedAt: ISODate("2021-03-02T17:33:12.495Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d8700bde471cfe5f34"),
fieldsId: "603e6467dc5d115e3c5071b9",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:12.885Z"),
updatedAt: ISODate("2021-03-02T17:33:12.885Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76d9700bde471cfe5f35"),
fieldsId: "603e6467dc5d115e3c5071ba",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:13.299Z"),
updatedAt: ISODate("2021-03-02T17:33:13.299Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76dd700bde471cfe5f36"),
fieldsId: "603e6468dc5d115e3c5071bb",
text: "<html><head></head><body><p>test</p>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:17.915Z"),
updatedAt: ISODate("2021-03-02T17:33:17.915Z"),
__v: NumberInt("0"),
mdText: "test",
menus: "(Document) 2 Fields"
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76de700bde471cfe5f37"),
fieldsId: "603e6468dc5d115e3c5071bc",
text: "<html><head></head><body><p><img src=\"http://api.03c3.cn/zb\" alt=\"\"></p>\n</body></html>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:18.195Z"),
updatedAt: ISODate("2021-06-01T15:01:42.683Z"),
__v: NumberInt("0"),
mdText: "\n",
menus: {
menus: [ ],
summary: ""
}
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76de700bde471cfe5f39"),
fieldsId: "603e6468dc5d115e3c5071be",
text: "<html><head></head><body><pre><code class=\"language-c\">//注释测试\n#include \n#include \n#include \n#ifdef _WIN32\n#include \n#include \n#endif\n#include \n\nstruct point\n{\n double x[3];\n};\nstruct edge\n{\n struct point a, b;\n};\nstruct plane\n{\n // k[0]x+k[1]y+k[2]z=d\n double k[3], d;\n};\ntypedef struct point point;\ntypedef struct edge edge;\ntypedef struct plane plane;\n\n#define PI 3.14159265358\npoint cubePoint[8] = {{0.5, 0.5, -0.5}, {0.5, 0.5, 0.5}, {-0.5, 0.5, 0.5}, {-0.5, 0.5, -0.5}, {0.5, -0.5, -0.5}, {0.5, -0.5, 0.5}, {-0.5, -0.5, 0.5}, {-0.5, -0.5, -0.5}};\nint cubePlaneGroup[6][4] = {{0, 1, 5, 4}, {1, 2, 6, 5}, {2, 3, 7, 6}, {3, 0, 4, 7}, {0, 1, 2, 3}, {4, 5, 6, 7}};\nint PlaneNumber[6];\nint table[6][6] = {{2, 4, 5, 3, 1, 6}, {1, 3, 6, 4, 2, 5}, {1, 5, 6, 2, 3, 4}, {2, 6, 5, 1, 4, 3}, {4, 6, 3, 1, 5, 2}, {3, 5, 4, 2, 6, 1}};\ndouble cube2dPoint[8][2];\nint cubeDisplayPoint[8][2];\npoint camera = {2, 1.5, 2};\npoint cameraY = {-2, 2, 2};\nconst double cameraR = 3.5;\ndouble displayPlaneSize = 4;\nconst int displayPixelSize = 30;\n// 终端英文字符宽高比例需要1:2\nconst int displayPixelWidth = 60;\nchar displayBuff[30][60];\ndouble angleA = -PI / 4;\ndouble angleB = PI / 4;\ndouble speed = 0.05;\n\nvoid draw();\n\n#ifndef _WIN32\n#include \n#include \nchar getch()\n{\n char buf = 0;\n struct termios old = {0};\n fflush(stdout);\n if (tcgetattr(0, &old) < 0)\n perror(\"tcsetattr()\");\n old.c_lflag &= ~ICANON; // local modes = Non Canonical mode\n old.c_lflag &= ~ECHO; // local modes = Disable echo.\n old.c_cc[VMIN] = 1; // control chars (MIN value) = 1\n old.c_cc[VTIME] = 0; // control chars (TIME value) = 0 (No time)\n if (tcsetattr(0, TCSANOW, &old) < 0)\n perror(\"tcsetattr ICANON\");\n if (read(0, &buf, 1) < 0)\n perror(\"read()\");\n old.c_lflag |= ICANON; // local modes = Canonical mode\n old.c_lflag |= ECHO; // local modes = Enable echo.\n if (tcsetattr(0, TCSADRAIN, &old) < 0)\n perror(\"tcsetattr ~ICANON\");\n return buf;\n}\n#endif\n\nplane getDisplayPlane()\n{\n double d = 0;\n for (int i = 0; i < 3; i++)\n {\n d += camera.x[i] * camera.x[i];\n }\n return (plane){{camera.x[0], camera.x[1], camera.x[2]}, -d};\n}\n\npoint getDisplayCenter()\n{\n return (point){-camera.x[0], -camera.x[1], -camera.x[2]};\n}\n\npoint getVector(point a, point b)\n{\n return (point){b.x[0] - a.x[0], b.x[1] - a.x[1], b.x[2] - a.x[2]};\n}\n\ndouble innerProduct(point a, point b)\n{\n double res = 0;\n for (int i = 0; i < 3; i++)\n {\n res += a.x[i] * b.x[i];\n }\n return res;\n}\n\npoint crossProduct(point a, point b)\n{\n return (point){a.x[1] * b.x[2] - a.x[2] * b.x[1], a.x[2] * b.x[0] - a.x[0] * b.x[2], a.x[0] * b.x[1] - a.x[1] * b.x[0]};\n}\n\ndouble getLength(point a)\n{\n double sqr = 0;\n for (int i = 0; i < 3; i++)\n {\n sqr += a.x[i] * a.x[i];\n }\n return sqrt(sqr);\n}\n\npoint getPoint(edge a, plane b)\n{\n point res;\n for (int i = 0; i < 3; i++)\n {\n double k = b.k[i];\n double d = b.d;\n for (int j = 0; j < 3; j++)\n {\n if (i != j)\n {\n k += b.k[j] * (a.a.x[j] - a.b.x[j]) / (a.a.x[i] - a.b.x[i]);\n d -= b.k[j] * (a.b.x[j] * a.a.x[i] - a.a.x[j] * a.b.x[i]) / (a.a.x[i] - a.b.x[i]);\n }\n }\n res.x[i] = d / k;\n }\n return res;\n}\n\nvoid initCamera()\n{\n\n camera.x[0] = cos(angleA) * cos(angleB) * cameraR;\n camera.x[1] = sin(angleA) * cameraR;\n camera.x[2] = cos(angleA) * sin(angleB) * cameraR;\n\n cameraY.x[0] = cos(angleA + PI / 2) * cos(angleB) * cameraR;\n cameraY.x[1] = sin(angleA + PI / 2) * cameraR;\n cameraY.x[2] = cos(angleA + PI / 2) * sin(angleB) * cameraR;\n}\n\nvoid drawLine(const int a[2], const int b[2])\n{\n\n if (a[0] == b[0] && a[1] == b[1])\n {\n return;\n }\n int step[2];\n for (int i = 0; i < 2; i++)\n {\n if (a[i] - b[i] > 0)\n {\n step[i] = -1;\n }\n else if (a[i] - b[i] == 0)\n {\n step[i] = 0;\n }\n else\n {\n step[i] = 1;\n }\n }\n if (abs(a[0] - b[0]) > abs(a[1] - b[1]))\n {\n int j = a[1];\n double k = (a[1] - b[1]) * 1.0 / (a[0] - b[0]);\n for (int i = a[0] + step[0]; (b[0] - i) / step[0] > 0; i += step[0])\n {\n if (fabs(1.0 * (j + step[1] - a[1]) / (i - a[0]) - k) < fabs(1.0 * (j - a[1]) / (i - a[0]) - k))\n {\n j += step[1];\n }\n if (displayBuff[i][j] == 0)\n {\n displayBuff[i][j] = '*';\n }\n }\n }\n else\n {\n int j = a[0];\n double k = (a[0] - b[0]) * 1.0 / (a[1] - b[1]);\n for (int i = a[1] + step[1]; (b[1] - i) / step[1] > 0; i += step[1])\n {\n if (fabs(1.0 * (j + step[0] - a[0]) / (i - a[1]) - k) < fabs(1.0 * (j - a[0]) / (i - a[1]) - k))\n {\n j += step[0];\n }\n if (displayBuff[j][i] == 0)\n {\n displayBuff[j][i] = '*';\n }\n }\n }\n}\n\nvoid fswap(double *a, double *b)\n{\n double tmp = *a;\n *a = *b;\n *b = tmp;\n}\n\nvoid fill(int r, int c, char ch)\n{\n if (r < 1 || c < 1 || r >= displayPixelSize || c >= displayPixelWidth)\n {\n return;\n }\n if (displayBuff[r][c] != 0)\n {\n return;\n }\n displayBuff[r][c] = ch;\n fill(r + 1, c, ch);\n fill(r - 1, c, ch);\n fill(r, c + 1, ch);\n fill(r, c - 1, ch);\n}\n\nint sqr(int x)\n{\n return x * 2;\n}\n\nvoid drawCube()\n{\n memset(displayBuff, 0, sizeof(displayBuff));\n double dis[6][2] = {0};\n\n for (int i = 0; i < 6; i++)\n {\n dis[i][0] = i;\n for (int j = 0; j < 4; j++)\n {\n dis[i][1] += getLength(getVector(camera, cubePoint[cubePlaneGroup[i][j]]));\n }\n for (int j = i - 1; j >= 0; j--)\n {\n if (dis[j][1] > dis[j + 1][1])\n {\n fswap(&dis[j][1], &dis[j + 1][1]);\n fswap(&dis[j][0], &dis[j + 1][0]);\n }\n }\n }\n for (int i = 0; i < 6; i++)\n {\n int planeId = (int)dis[i][0];\n int hide = 0;\n int xy[4][2];\n for (int j = 0; j < 4; j++)\n {\n memcpy(xy[j], cubeDisplayPoint[cubePlaneGroup[planeId][j]], sizeof(xy[j]));\n }\n for (int j = 0; j < 4; j++)\n {\n if (displayBuff[xy[j][0]][xy[j][1]] != 0 && displayBuff[xy[j][0]][xy[j][1]] != '+')\n {\n hide = 1;\n }\n }\n if (hide)\n {\n continue;\n }\n\n for (int j = 0; j < 4; j++)\n {\n drawLine(xy[j], xy[(j + 1) % 4]);\n }\n for (int j = 0; j < 4; j++)\n {\n displayBuff[xy[j][0]][xy[j][1]] = '+';\n }\n int center[2];\n if (sqr(xy[0][0] - xy[2][0]) + sqr(xy[0][1] - xy[2][1]) > sqr(xy[1][0] - xy[3][0]) + sqr(xy[1][1] - xy[3][1]))\n {\n center[0] = (xy[0][0] + xy[2][0]) / 2.0 + 0.5;\n center[1] = (xy[0][1] + xy[2][1]) / 2.0 + 0.5;\n }\n else\n {\n center[0] = (xy[1][0] + xy[3][0]) / 2.0 + 0.5;\n center[1] = (xy[1][1] + xy[3][1]) / 2.0 + 0.5;\n }\n fill(center[0], center[1], ' ');\n displayBuff[center[0]][center[1]] = '0' + PlaneNumber[planeId];\n }\n}\n\nvoid randomCast()\n{\n int tableIdx = rand() % 6;\n int offset = rand();\n for (int i = 0; i < 4; i++)\n {\n PlaneNumber[i] = table[tableIdx][(i + offset) % 4];\n }\n for (int i = 4; i < 6; i++)\n {\n PlaneNumber[i] = table[tableIdx][i];\n }\n}\n\nvoid cls()\n{\n#ifdef _WIN32\n COORD pos = {0, 0};\n HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE);\n SetConsoleCursorPosition(out, pos);\n#endif\n#ifndef _WIN32\n printf(\"\\033c\");\n#endif\n}\n\nvoid draw()\n{\n initCamera();\n for (int i = 0; i < 8; i++)\n {\n point p = getPoint((edge){camera, cubePoint[i]}, getDisplayPlane());\n point v = getVector(getDisplayCenter(), p);\n double vlen = getLength(v);\n double cos = innerProduct(v, cameraY) / getLength(cameraY) / vlen;\n double sin = sqrt(fabs(1 - cos * cos));\n int largeThanPi = innerProduct(crossProduct(cameraY, v), camera) < 0;\n double y = cos * vlen;\n double x = -sin * vlen;\n if (largeThanPi)\n {\n x *= -1;\n }\n cube2dPoint[i][0] = x;\n cube2dPoint[i][1] = y;\n cubeDisplayPoint[i][1] = ((x + displayPlaneSize / 2) / displayPlaneSize * displayPixelSize * 2 + 0.5);\n cubeDisplayPoint[i][0] = ((y + displayPlaneSize / 2) / displayPlaneSize * displayPixelSize + 0.5);\n }\n drawCube();\n char output[displayPixelSize * displayPixelSize * 2 + displayPixelSize + 1];\n int idx = 0;\n for (int i = 0; i < displayPixelSize; i++)\n {\n for (int j = 0; j < displayPixelSize * 2; j++)\n {\n if (displayBuff[i][j] == 0)\n {\n displayBuff[i][j] = '.';\n }\n output[idx++] = displayBuff[i][j];\n }\n output[idx++] = '\\n';\n }\n output[idx++] = 0;\n cls();\n printf(\"%s\", output);\n}\nvoid start()\n{\n while (1)\n {\n int key = getch();\n switch (key)\n {\n case 27:\n {\n exit(0);\n }\n case 'w':\n {\n angleA -= speed;\n break;\n }\n case 's':\n {\n angleA += speed;\n break;\n }\n case 'a':\n {\n angleB += speed;\n break;\n }\n case 'd':\n {\n angleB -= speed;\n break;\n }\n case 'r':\n randomCast();\n break;\n };\n draw();\n }\n}\n\nint main()\n{\n#ifdef _WIN32\n system(\"cls\");\n#endif\n srand(time(0));\n randomCast();\n draw();\n start();\n}\n</code></pre>\n<pre><code class=\"language-python\">import requests\nfrom bs4 import BeautifulSoup\nimport re\nvalue = ''\nvalue = str(input('输入搜索标题文字:'))\nif value == '':\n value = \"御坂美琴\"\nprint('''\n------------\n| 1.综合 |\n| 2.播放 |\n| 3.最新 |\n| 4.弹幕 |\n| 5.收藏 |\n------------\n''')\nssfs = 0\n\nssfs = input('请输入排序方式:')\nif ssfs=='':\n ssfs = 2\nfs = [\"\", \"&order=click\", \"&order=pubdate\", \"&order=dm\", \"&order=stow\"]\nif ssfs == 1:\n ssfs = fs[0]\nelif ssfs == 2:\n ssfs = fs[1]\nelif ssfs == 3:\n ssfs = fs[2]\nelif ssfs == 4:\n ssfs = fs[3]\nelif ssfs == 5:\n ssfs = fs[4]\nhead = {\n 'user-agent':\n 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) \\\n Chrome/80.0.3987.88 Safari/537.36'\n}\nurl = 'https://search.bilibili.com/all?keyword='+ \\\n value +ssfs\ndef geturl(url):\n try:\n a = requests.get(url, headers=head)\n if a.status_code == 200:\n return a.text\n except requests.RequestException:\n return None\nhtml = geturl(url)\nbf = BeautifulSoup(html, 'lxml')\ntitles = bf.find_all(\"div\", class_=\"headline clearfix\")\nbfl = bf.find_all(\"span\", class_=\"so-icon watch-num\")\ndm = bf.find_all(\"span\", class_=\"so-icon hide\")\nhref = re.findall('href=\"//(.*?)\"', str(titles))\nnewt = re.findall('title=\"(.*?)\">', str(titles))\nnewb = re.findall(r'(.*?)', str(bfl), re.S)\nnewdm = re.findall(r'(.*?)', str(dm), re.S)\na = ''\nb = ''\nlent = len(newt)\nfor i in range(lent):\n printf = str(newt[i])\n a = a + printf + '\\n'\n sc = str(i + 1) + printf + \"\\n 播放量\" + str(\n newb[i]) + \" 弹幕\" + '\\t' + str(newdm[i]) + \"\\n链接\" + str(href[i])\n print(sc)\n print(\"------------------------------------------------\")\n b += (sc + \"\\n------------------------------------------------\\n\")\ny = input('是否保存?(y,n)')\nif y == 'y':\n with open(value + str(ssfs) + '.txt', 'w+') as f:\n f.write(b)\n print(\"保存成功!\")\n</code></pre>\n</body></html>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:18.93Z"),
updatedAt: ISODate("2021-06-01T15:01:07.681Z"),
__v: NumberInt("0"),
mdText: "```c\n//注释测试\n#include \n#include \n#include \n#ifdef _WIN32\n#include \n#include \n#endif\n#include \n\nstruct point\n{\n double x[3];\n};\nstruct edge\n{\n struct point a, b;\n};\nstruct plane\n{\n // k[0]x+k[1]y+k[2]z=d\n double k[3], d;\n};\ntypedef struct point point;\ntypedef struct edge edge;\ntypedef struct plane plane;\n\n#define PI 3.14159265358\npoint cubePoint[8] = {{0.5, 0.5, -0.5}, {0.5, 0.5, 0.5}, {-0.5, 0.5, 0.5}, {-0.5, 0.5, -0.5}, {0.5, -0.5, -0.5}, {0.5, -0.5, 0.5}, {-0.5, -0.5, 0.5}, {-0.5, -0.5, -0.5}};\nint cubePlaneGroup[6][4] = {{0, 1, 5, 4}, {1, 2, 6, 5}, {2, 3, 7, 6}, {3, 0, 4, 7}, {0, 1, 2, 3}, {4, 5, 6, 7}};\nint PlaneNumber[6];\nint table[6][6] = {{2, 4, 5, 3, 1, 6}, {1, 3, 6, 4, 2, 5}, {1, 5, 6, 2, 3, 4}, {2, 6, 5, 1, 4, 3}, {4, 6, 3, 1, 5, 2}, {3, 5, 4, 2, 6, 1}};\ndouble cube2dPoint[8][2];\nint cubeDisplayPoint[8][2];\npoint camera = {2, 1.5, 2};\npoint cameraY = {-2, 2, 2};\nconst double cameraR = 3.5;\ndouble displayPlaneSize = 4;\nconst int displayPixelSize = 30;\n// 终端英文字符宽高比例需要1:2\nconst int displayPixelWidth = 60;\nchar displayBuff[30][60];\ndouble angleA = -PI / 4;\ndouble angleB = PI / 4;\ndouble speed = 0.05;\n\nvoid draw();\n\n#ifndef _WIN32\n#include \n#include \nchar getch()\n{\n char buf = 0;\n struct termios old = {0};\n fflush(stdout);\n if (tcgetattr(0, &old) < 0)\n perror(\"tcsetattr()\");\n old.c_lflag &= ~ICANON; // local modes = Non Canonical mode\n old.c_lflag &= ~ECHO; // local modes = Disable echo.\n old.c_cc[VMIN] = 1; // control chars (MIN value) = 1\n old.c_cc[VTIME] = 0; // control chars (TIME value) = 0 (No time)\n if (tcsetattr(0, TCSANOW, &old) < 0)\n perror(\"tcsetattr ICANON\");\n if (read(0, &buf, 1) < 0)\n perror(\"read()\");\n old.c_lflag |= ICANON; // local modes = Canonical mode\n old.c_lflag |= ECHO; // local modes = Enable echo.\n if (tcsetattr(0, TCSADRAIN, &old) < 0)\n perror(\"tcsetattr ~ICANON\");\n return buf;\n}\n#endif\n\nplane getDisplayPlane()\n{\n double d = 0;\n for (int i = 0; i < 3; i++)\n {\n d += camera.x[i] * camera.x[i];\n }\n return (plane){{camera.x[0], camera.x[1], camera.x[2]}, -d};\n}\n\npoint getDisplayCenter()\n{\n return (point){-camera.x[0], -camera.x[1], -camera.x[2]};\n}\n\npoint getVector(point a, point b)\n{\n return (point){b.x[0] - a.x[0], b.x[1] - a.x[1], b.x[2] - a.x[2]};\n}\n\ndouble innerProduct(point a, point b)\n{\n double res = 0;\n for (int i = 0; i < 3; i++)\n {\n res += a.x[i] * b.x[i];\n }\n return res;\n}\n\npoint crossProduct(point a, point b)\n{\n return (point){a.x[1] * b.x[2] - a.x[2] * b.x[1], a.x[2] * b.x[0] - a.x[0] * b.x[2], a.x[0] * b.x[1] - a.x[1] * b.x[0]};\n}\n\ndouble getLength(point a)\n{\n double sqr = 0;\n for (int i = 0; i < 3; i++)\n {\n sqr += a.x[i] * a.x[i];\n }\n return sqrt(sqr);\n}\n\npoint getPoint(edge a, plane b)\n{\n point res;\n for (int i = 0; i < 3; i++)\n {\n double k = b.k[i];\n double d = b.d;\n for (int j = 0; j < 3; j++)\n {\n if (i != j)\n {\n k += b.k[j] * (a.a.x[j] - a.b.x[j]) / (a.a.x[i] - a.b.x[i]);\n d -= b.k[j] * (a.b.x[j] * a.a.x[i] - a.a.x[j] * a.b.x[i]) / (a.a.x[i] - a.b.x[i]);\n }\n }\n res.x[i] = d / k;\n }\n return res;\n}\n\nvoid initCamera()\n{\n\n camera.x[0] = cos(angleA) * cos(angleB) * cameraR;\n camera.x[1] = sin(angleA) * cameraR;\n camera.x[2] = cos(angleA) * sin(angleB) * cameraR;\n\n cameraY.x[0] = cos(angleA + PI / 2) * cos(angleB) * cameraR;\n cameraY.x[1] = sin(angleA + PI / 2) * cameraR;\n cameraY.x[2] = cos(angleA + PI / 2) * sin(angleB) * cameraR;\n}\n\nvoid drawLine(const int a[2], const int b[2])\n{\n\n if (a[0] == b[0] && a[1] == b[1])\n {\n return;\n }\n int step[2];\n for (int i = 0; i < 2; i++)\n {\n if (a[i] - b[i] > 0)\n {\n step[i] = -1;\n }\n else if (a[i] - b[i] == 0)\n {\n step[i] = 0;\n }\n else\n {\n step[i] = 1;\n }\n }\n if (abs(a[0] - b[0]) > abs(a[1] - b[1]))\n {\n int j = a[1];\n double k = (a[1] - b[1]) * 1.0 / (a[0] - b[0]);\n for (int i = a[0] + step[0]; (b[0] - i) / step[0] > 0; i += step[0])\n {\n if (fabs(1.0 * (j + step[1] - a[1]) / (i - a[0]) - k) < fabs(1.0 * (j - a[1]) / (i - a[0]) - k))\n {\n j += step[1];\n }\n if (displayBuff[i][j] == 0)\n {\n displayBuff[i][j] = '*';\n }\n }\n }\n else\n {\n int j = a[0];\n double k = (a[0] - b[0]) * 1.0 / (a[1] - b[1]);\n for (int i = a[1] + step[1]; (b[1] - i) / step[1] > 0; i += step[1])\n {\n if (fabs(1.0 * (j + step[0] - a[0]) / (i - a[1]) - k) < fabs(1.0 * (j - a[0]) / (i - a[1]) - k))\n {\n j += step[0];\n }\n if (displayBuff[j][i] == 0)\n {\n displayBuff[j][i] = '*';\n }\n }\n }\n}\n\nvoid fswap(double *a, double *b)\n{\n double tmp = *a;\n *a = *b;\n *b = tmp;\n}\n\nvoid fill(int r, int c, char ch)\n{\n if (r < 1 || c < 1 || r >= displayPixelSize || c >= displayPixelWidth)\n {\n return;\n }\n if (displayBuff[r][c] != 0)\n {\n return;\n }\n displayBuff[r][c] = ch;\n fill(r + 1, c, ch);\n fill(r - 1, c, ch);\n fill(r, c + 1, ch);\n fill(r, c - 1, ch);\n}\n\nint sqr(int x)\n{\n return x * 2;\n}\n\nvoid drawCube()\n{\n memset(displayBuff, 0, sizeof(displayBuff));\n double dis[6][2] = {0};\n\n for (int i = 0; i < 6; i++)\n {\n dis[i][0] = i;\n for (int j = 0; j < 4; j++)\n {\n dis[i][1] += getLength(getVector(camera, cubePoint[cubePlaneGroup[i][j]]));\n }\n for (int j = i - 1; j >= 0; j--)\n {\n if (dis[j][1] > dis[j + 1][1])\n {\n fswap(&dis[j][1], &dis[j + 1][1]);\n fswap(&dis[j][0], &dis[j + 1][0]);\n }\n }\n }\n for (int i = 0; i < 6; i++)\n {\n int planeId = (int)dis[i][0];\n int hide = 0;\n int xy[4][2];\n for (int j = 0; j < 4; j++)\n {\n memcpy(xy[j], cubeDisplayPoint[cubePlaneGroup[planeId][j]], sizeof(xy[j]));\n }\n for (int j = 0; j < 4; j++)\n {\n if (displayBuff[xy[j][0]][xy[j][1]] != 0 && displayBuff[xy[j][0]][xy[j][1]] != '+')\n {\n hide = 1;\n }\n }\n if (hide)\n {\n continue;\n }\n\n for (int j = 0; j < 4; j++)\n {\n drawLine(xy[j], xy[(j + 1) % 4]);\n }\n for (int j = 0; j < 4; j++)\n {\n displayBuff[xy[j][0]][xy[j][1]] = '+';\n }\n int center[2];\n if (sqr(xy[0][0] - xy[2][0]) + sqr(xy[0][1] - xy[2][1]) > sqr(xy[1][0] - xy[3][0]) + sqr(xy[1][1] - xy[3][1]))\n {\n center[0] = (xy[0][0] + xy[2][0]) / 2.0 + 0.5;\n center[1] = (xy[0][1] + xy[2][1]) / 2.0 + 0.5;\n }\n else\n {\n center[0] = (xy[1][0] + xy[3][0]) / 2.0 + 0.5;\n center[1] = (xy[1][1] + xy[3][1]) / 2.0 + 0.5;\n }\n fill(center[0], center[1], ' ');\n displayBuff[center[0]][center[1]] = '0' + PlaneNumber[planeId];\n }\n}\n\nvoid randomCast()\n{\n int tableIdx = rand() % 6;\n int offset = rand();\n for (int i = 0; i < 4; i++)\n {\n PlaneNumber[i] = table[tableIdx][(i + offset) % 4];\n }\n for (int i = 4; i < 6; i++)\n {\n PlaneNumber[i] = table[tableIdx][i];\n }\n}\n\nvoid cls()\n{\n#ifdef _WIN32\n COORD pos = {0, 0};\n HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE);\n SetConsoleCursorPosition(out, pos);\n#endif\n#ifndef _WIN32\n printf(\"\\033c\");\n#endif\n}\n\nvoid draw()\n{\n initCamera();\n for (int i = 0; i < 8; i++)\n {\n point p = getPoint((edge){camera, cubePoint[i]}, getDisplayPlane());\n point v = getVector(getDisplayCenter(), p);\n double vlen = getLength(v);\n double cos = innerProduct(v, cameraY) / getLength(cameraY) / vlen;\n double sin = sqrt(fabs(1 - cos * cos));\n int largeThanPi = innerProduct(crossProduct(cameraY, v), camera) < 0;\n double y = cos * vlen;\n double x = -sin * vlen;\n if (largeThanPi)\n {\n x *= -1;\n }\n cube2dPoint[i][0] = x;\n cube2dPoint[i][1] = y;\n cubeDisplayPoint[i][1] = ((x + displayPlaneSize / 2) / displayPlaneSize * displayPixelSize * 2 + 0.5);\n cubeDisplayPoint[i][0] = ((y + displayPlaneSize / 2) / displayPlaneSize * displayPixelSize + 0.5);\n }\n drawCube();\n char output[displayPixelSize * displayPixelSize * 2 + displayPixelSize + 1];\n int idx = 0;\n for (int i = 0; i < displayPixelSize; i++)\n {\n for (int j = 0; j < displayPixelSize * 2; j++)\n {\n if (displayBuff[i][j] == 0)\n {\n displayBuff[i][j] = '.';\n }\n output[idx++] = displayBuff[i][j];\n }\n output[idx++] = '\\n';\n }\n output[idx++] = 0;\n cls();\n printf(\"%s\", output);\n}\nvoid start()\n{\n while (1)\n {\n int key = getch();\n switch (key)\n {\n case 27:\n {\n exit(0);\n }\n case 'w':\n {\n angleA -= speed;\n break;\n }\n case 's':\n {\n angleA += speed;\n break;\n }\n case 'a':\n {\n angleB += speed;\n break;\n }\n case 'd':\n {\n angleB -= speed;\n break;\n }\n case 'r':\n randomCast();\n break;\n };\n draw();\n }\n}\n\nint main()\n{\n#ifdef _WIN32\n system(\"cls\");\n#endif\n srand(time(0));\n randomCast();\n draw();\n start();\n}\n```\n\n```python\nimport requests\nfrom bs4 import BeautifulSoup\nimport re\nvalue = ''\nvalue = str(input('输入搜索标题文字:'))\nif value == '':\n value = \"御坂美琴\"\nprint('''\n------------\n| 1.综合 |\n| 2.播放 |\n| 3.最新 |\n| 4.弹幕 |\n| 5.收藏 |\n------------\n''')\nssfs = 0\n\nssfs = input('请输入排序方式:')\nif ssfs=='':\n ssfs = 2\nfs = [\"\", \"&order=click\", \"&order=pubdate\", \"&order=dm\", \"&order=stow\"]\nif ssfs == 1:\n ssfs = fs[0]\nelif ssfs == 2:\n ssfs = fs[1]\nelif ssfs == 3:\n ssfs = fs[2]\nelif ssfs == 4:\n ssfs = fs[3]\nelif ssfs == 5:\n ssfs = fs[4]\nhead = {\n 'user-agent':\n 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) \\\n Chrome/80.0.3987.88 Safari/537.36'\n}\nurl = 'https://search.bilibili.com/all?keyword='+ \\\n value +ssfs\ndef geturl(url):\n try:\n a = requests.get(url, headers=head)\n if a.status_code == 200:\n return a.text\n except requests.RequestException:\n return None\nhtml = geturl(url)\nbf = BeautifulSoup(html, 'lxml')\ntitles = bf.find_all(\"div\", class_=\"headline clearfix\")\nbfl = bf.find_all(\"span\", class_=\"so-icon watch-num\")\ndm = bf.find_all(\"span\", class_=\"so-icon hide\")\nhref = re.findall('href=\"//(.*?)\"', str(titles))\nnewt = re.findall('title=\"(.*?)\">', str(titles))\nnewb = re.findall(r'(.*?)', str(bfl), re.S)\nnewdm = re.findall(r'(.*?)', str(dm), re.S)\na = ''\nb = ''\nlent = len(newt)\nfor i in range(lent):\n printf = str(newt[i])\n a = a + printf + '\\n'\n sc = str(i + 1) + printf + \"\\n 播放量\" + str(\n newb[i]) + \" 弹幕\" + '\\t' + str(newdm[i]) + \"\\n链接\" + str(href[i])\n print(sc)\n print(\"------------------------------------------------\")\n b += (sc + \"\\n------------------------------------------------\\n\")\ny = input('是否保存?(y,n)')\nif y == 'y':\n with open(value + str(ssfs) + '.txt', 'w+') as f:\n f.write(b)\n print(\"保存成功!\")\n```\n",
menus: {
menus: [ ],
summary: "```c//注释测试#include #include #include #ifdef _WIN32#include #include #endif#include struct point{ double x[3];};struct edge{ str"
}
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76df700bde471cfe5f3a"),
fieldsId: "603e6468dc5d115e3c5071bf",
text: "<html><head></head><body><iframe id=\"test\" width=\"100%\" height=\"1200\" frameborder=\"0\" src=\"https://m.infinitynewtab.com/?i13EJi\" style=\"margin:0px;\"></iframe>\n</body></html>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:19.426Z"),
updatedAt: ISODate("2021-06-01T15:00:41.552Z"),
__v: NumberInt("0"),
mdText: "<iframe id=\"test\" width=\"100%\" height=\"1200\" frameborder=\"0\" src=\"https://m.infinitynewtab.com/?i13EJi\" style=\"margin:0px;\"></iframe>\n",
menus: {
menus: [ ],
summary: "<iframe id=\"test\" width=\"100%\" height=\"1200\" frameborder=\"0\" src=\"https://m.infinitynewtab.com/?i13EJi\" style=\"margin:0px;\"></iframe>"
}
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76df700bde471cfe5f3b"),
fieldsId: "603e6468dc5d115e3c5071c0",
text: "<html><head></head><body><h1 id=\"t0\">Docker自用Docker自用Docker自用</h1>\n<pre><code class=\"language-shell\">service docker start || systemctl start docker\t启动docker\nsystemctl enable docker\t将docker设定为开机自启\n退出容器\n\nexit \t\t\t# 直接退出容器并关闭\nCtrl + P + Q\t# 容器不关闭退出\n删除容器\n\ndocker rm -f 容器id\t\t\t\t\t\t# 删除指定容器\ndocker rm -f $(docker ps -aq)\t\t# 删除所有容器\ndocker ps -a -q|xargs docker rm -f\t# 删除所有的容器\n启动和停止容器的操作\n\ndocker start 容器id\t\t\t# 启动容器\ndocker restart 容器id\t\t\t# 重启容器\ndocker stop 容器id\t\t\t# 停止当前正在运行的容器\ndocker kill 容器id\t\t\t# 强制停止当前的容器\n\n进入当前正在运行的容器\n\n# 我们通常容器使用后台方式运行的, 需要进入容器,修改一些配置\n\n# 命令\ndocker exec -it 容器id /bin/bash\n\n# 测试\n[root@iZ2zeg4ytp0whqtmxbsqiiZ /]# docker exec -it df358bc06b17 /bin/bash\n[root@df358bc06b17 /]# ls \nbin etc lib\t lost+found mnt proc run srv tmp var\ndev home lib64 media opt root sbin sys usr\n[root@df358bc06b17 /]# ps -ef\nUID PID PPID C STIME TTY TIME CMD\nroot 1 0 0 Aug11 pts/0 00:00:00 /bin/bash\nroot 29 0 0 01:06 pts/1 00:00:00 /bin/bash\nroot 43 29 0 01:06 pts/1 00:00:00 ps -ef\n\n# 方式二\ndocker attach 容器id\n\n# docker exec\t\t# 进入容器后开启一个新的终端,可以在里面操作\n# docker attach\t\t# 进入容器正在执行的终端,不会启动新的进程\n使用数据卷\n\n直接使用命令来挂载 -v\n\n```shell\ndocker run -it -v 主机目录:容器目录\n\n\nMySQL的数据持久化的问题!\n\n```shell\n# 获取镜像\n[root@iZ2zeg4ytp0whqtmxbsqiiZ home]# docker pull mysql:5.7\n\n# 运行容器, 需要做数据挂载! # 安装启动mysql,需要配置密码(注意)\n# 官方测试, docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:tag\n\n# 启动我们的\n-d\t\t# 后台运行\n-p\t\t# 端口隐射\n-v\t\t# 卷挂载\n-e\t\t# 环境配置\n--name\t# 容器的名字\n\n# 匿名挂载\n-v 容器内路径\ndocker run -d -P --name nginx01 -v /etc/nginx nginx\t\t# -P 随机指定端口\n\n\n# 具名挂载\n[root@iZ2zeg4ytp0whqtmxbsqiiZ ~]# docker run -d -P --name nginx02 -v juming-nginx:/etc/nginx nginx\n26da1ec7d4994c76e80134d24d82403a254a4e1d84ec65d5f286000105c3da17\n[root@iZ2zeg4ytp0whqtmxbsqiiZ ~]# docker ps\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES\n26da1ec7d499 nginx \"/docker-entrypoint.…\" 3 seconds ago Up 2 seconds 0.0.0.0:32769->80/tcp nginx02\n486de1da03cb nginx \"/docker-entrypoint.…\" 3 minutes ago Up 3 minutes 0.0.0.0:32768->80/tcp nginx01\n[root@iZ2zeg4ytp0whqtmxbsqiiZ ~]# docker volume ls\nDRIVER VOLUME NAME\nlocal 561b81a03506f31d45ada3f9fb7bd8d7c9b5e0f826c877221a17e45d4c80e096\nlocal 36083fb6ca083005094cbd49572a0bffeec6daadfbc5ce772909bb00be760882\nlocal juming-nginx\n\n# 通过-v 卷名:容器内的路径\n# 查看一下这个卷\n# docker volume inspect juming-nginx\n\n[root@iZ2zeg4ytp0whqtmxbsqiiZ ~]# docker volume inspect juming-nginx\n[\n {\n \"CreatedAt\": \"2020-08-12T18:15:21+08:00\",\n \"Driver\": \"local\",\n \"Labels\": null,\n \"Mountpoint\": \"/var/lib/docker/volumes/juming-nginx/_data\",\n \"Name\": \"juming-nginx\",\n \"Options\": null,\n \"Scope\": \"local\"\n }\n]\n所有docker容器内的卷,没有指定目录的情况下都是在/var/lib/docker/volumes/xxxxx/_data\n\n我们通过具名挂载可以方便的找到我们的一个卷,大多数情况下使用的是具名挂载\n\n# 如何确定是具名挂载还是匿名挂载,还是指定路径挂载!\n-v\t容器内路径\t\t\t\t\t# 匿名挂载\n-v\t卷名:容器内路径\t\t\t # 具名挂载\n-v /主机路径:容器内路径\t\t\t # 指定路径挂载\n拓展\n\n# 通过 -v 容器内容路径 ro rw 改变读写权限\nro\treadonly\t# 只读\nrw\treadwrite\t# 可读可写\n\ndocker run -d -P --name nginx02 -v juming-nginx:/etc/nginx:ro nginx\ndocker run -d -P --name nginx02 -v juming-nginx:/etc/nginx:rw nginx\n\n# ro 只要看到ro就说明这个路径只能通过宿主机来操作,容器内容无法操作\n</code></pre>\n</body></html>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:19.781Z"),
updatedAt: ISODate("2021-06-01T15:00:25.436Z"),
__v: NumberInt("0"),
mdText: "# Docker自用Docker自用Docker自用\n\n```shell\nservice docker start || systemctl start docker\t启动docker\nsystemctl enable docker\t将docker设定为开机自启\n退出容器\n\nexit \t\t\t# 直接退出容器并关闭\nCtrl + P + Q\t# 容器不关闭退出\n删除容器\n\ndocker rm -f 容器id\t\t\t\t\t\t# 删除指定容器\ndocker rm -f $(docker ps -aq)\t\t# 删除所有容器\ndocker ps -a -q|xargs docker rm -f\t# 删除所有的容器\n启动和停止容器的操作\n\ndocker start 容器id\t\t\t# 启动容器\ndocker restart 容器id\t\t\t# 重启容器\ndocker stop 容器id\t\t\t# 停止当前正在运行的容器\ndocker kill 容器id\t\t\t# 强制停止当前的容器\n\n进入当前正在运行的容器\n\n# 我们通常容器使用后台方式运行的, 需要进入容器,修改一些配置\n\n# 命令\ndocker exec -it 容器id /bin/bash\n\n# 测试\n[root@iZ2zeg4ytp0whqtmxbsqiiZ /]# docker exec -it df358bc06b17 /bin/bash\n[root@df358bc06b17 /]# ls \nbin etc lib\t lost+found mnt proc run srv tmp var\ndev home lib64 media opt root sbin sys usr\n[root@df358bc06b17 /]# ps -ef\nUID PID PPID C STIME TTY TIME CMD\nroot 1 0 0 Aug11 pts/0 00:00:00 /bin/bash\nroot 29 0 0 01:06 pts/1 00:00:00 /bin/bash\nroot 43 29 0 01:06 pts/1 00:00:00 ps -ef\n\n# 方式二\ndocker attach 容器id\n\n# docker exec\t\t# 进入容器后开启一个新的终端,可以在里面操作\n# docker attach\t\t# 进入容器正在执行的终端,不会启动新的进程\n使用数据卷\n\n直接使用命令来挂载 -v\n\n```shell\ndocker run -it -v 主机目录:容器目录\n\n\nMySQL的数据持久化的问题!\n\n```shell\n# 获取镜像\n[root@iZ2zeg4ytp0whqtmxbsqiiZ home]# docker pull mysql:5.7\n\n# 运行容器, 需要做数据挂载! # 安装启动mysql,需要配置密码(注意)\n# 官方测试, docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:tag\n\n# 启动我们的\n-d\t\t# 后台运行\n-p\t\t# 端口隐射\n-v\t\t# 卷挂载\n-e\t\t# 环境配置\n--name\t# 容器的名字\n\n# 匿名挂载\n-v 容器内路径\ndocker run -d -P --name nginx01 -v /etc/nginx nginx\t\t# -P 随机指定端口\n\n\n# 具名挂载\n[root@iZ2zeg4ytp0whqtmxbsqiiZ ~]# docker run -d -P --name nginx02 -v juming-nginx:/etc/nginx nginx\n26da1ec7d4994c76e80134d24d82403a254a4e1d84ec65d5f286000105c3da17\n[root@iZ2zeg4ytp0whqtmxbsqiiZ ~]# docker ps\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES\n26da1ec7d499 nginx \"/docker-entrypoint.…\" 3 seconds ago Up 2 seconds 0.0.0.0:32769->80/tcp nginx02\n486de1da03cb nginx \"/docker-entrypoint.…\" 3 minutes ago Up 3 minutes 0.0.0.0:32768->80/tcp nginx01\n[root@iZ2zeg4ytp0whqtmxbsqiiZ ~]# docker volume ls\nDRIVER VOLUME NAME\nlocal 561b81a03506f31d45ada3f9fb7bd8d7c9b5e0f826c877221a17e45d4c80e096\nlocal 36083fb6ca083005094cbd49572a0bffeec6daadfbc5ce772909bb00be760882\nlocal juming-nginx\n\n# 通过-v 卷名:容器内的路径\n# 查看一下这个卷\n# docker volume inspect juming-nginx\n\n[root@iZ2zeg4ytp0whqtmxbsqiiZ ~]# docker volume inspect juming-nginx\n[\n {\n \"CreatedAt\": \"2020-08-12T18:15:21+08:00\",\n \"Driver\": \"local\",\n \"Labels\": null,\n \"Mountpoint\": \"/var/lib/docker/volumes/juming-nginx/_data\",\n \"Name\": \"juming-nginx\",\n \"Options\": null,\n \"Scope\": \"local\"\n }\n]\n所有docker容器内的卷,没有指定目录的情况下都是在/var/lib/docker/volumes/xxxxx/_data\n\n我们通过具名挂载可以方便的找到我们的一个卷,大多数情况下使用的是具名挂载\n\n# 如何确定是具名挂载还是匿名挂载,还是指定路径挂载!\n-v\t容器内路径\t\t\t\t\t# 匿名挂载\n-v\t卷名:容器内路径\t\t\t # 具名挂载\n-v /主机路径:容器内路径\t\t\t # 指定路径挂载\n拓展\n\n# 通过 -v 容器内容路径 ro rw 改变读写权限\nro\treadonly\t# 只读\nrw\treadwrite\t# 可读可写\n\ndocker run -d -P --name nginx02 -v juming-nginx:/etc/nginx:ro nginx\ndocker run -d -P --name nginx02 -v juming-nginx:/etc/nginx:rw nginx\n\n# ro 只要看到ro就说明这个路径只能通过宿主机来操作,容器内容无法操作\n```\n",
menus: {
menus: [
{
type: "h1",
target: "#t0",
title: "Docker自用Docker自用Docker自用"
}
],
summary: "# Docker自用Docker自用Docker自用```shellservice docker start || systemctl start docker\t启动dockersystemctl enable docker\t将docker设定为开机自启退出容器exit \t\t\t# 直接"
}
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("603e76e0700bde471cfe5f3c"),
fieldsId: "603e6469dc5d115e3c5071c1",
text: "<html><head></head><body><p><img src=\"http://api.03c3.cn/zb\" alt=\"\"></p>\n</body></html>",
isPublish: true,
allowComment: true,
createdAt: ISODate("2021-03-02T17:33:20.102Z"),
updatedAt: ISODate("2021-06-01T05:59:43.594Z"),
__v: NumberInt("0"),
mdText: "\n",
menus: {
menus: [ ],
summary: ""
}
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("60519b28ab170f1d4875e778"),
text: "这是草稿 aaa",
createdAt: ISODate("2021-03-17T06:01:12.613Z"),
updatedAt: ISODate("2021-03-17T06:01:12.946Z"),
__v: NumberInt("0"),
fieldsId: "60519b28ab170f1d4875e779",
mdText: "这是草稿 aaa",
isPublish: false,
allowComment: true,
menus: null
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("60519b8eab170f1d4875e77a"),
text: "<p>zccs</p>",
createdAt: ISODate("2021-03-17T06:02:54.831Z"),
updatedAt: ISODate("2021-06-01T05:59:01.7Z"),
__v: NumberInt("0"),
fieldsId: "60519b8fab170f1d4875e77b",
mdText: "2021-5-11 20:54:35\n\n@[TOC]\n\n# 一级标题123123\n\n## 二级标题\n\n### 三级标题\n\n#### 四级标题\n\n##### 五级标题\n\n###### 六级标题\n\n# 我展示的是一级标题\n\n## 我展示的是二级标题\n\n*斜体文本*\n\n*斜体文本*\n\n**粗体文本**\n\n**粗体文本**\n\n***粗斜体文本***\n\n***粗斜体文本***\n\n---\n\n---\n\n---\n\n---\n\n---\n\n[RUNOOB.COM](RUNOOB.COM)\n\n[GOOGLE.COM](GOOGLE.COM)\n\n~~[BAIDU.COM](BAIDU.COM)\n\n* 第一项\n* 第二项\n* 第三项\n* 第一项\n* 第二项\n* 第三项\n* 第一项\n* 第二项\n* 第三项\n\n1. 第一项:\n * 第一项嵌套的第一个元素\n * 第一项嵌套的第二个元素\n2. 第二项:\n * 第二项嵌套的第一个元素\n * 第二项嵌套的第二个元素\n\n> 区块引用\n>\n> 菜鸟教程\n>\n> 学的不仅是技术更是梦想\n\n`printf()` 函数\n\n```javascript\n$(document).ready(function () {\n alert('RUNOOB');\n});\n```\n\n这是一个链接 [菜鸟教程](https://www.runoob.com)\n\n[https://www.runoob.com](https://www.runoob.com)\n\n\n\n\n| 表头 | 表头 |\n| -------- | -------- |\n| 单元格 | 单元格 |\n| 单元格 | 单元格 |\n\n\n| 左对齐 | 右对齐 | 居中对齐 |\n| :------- | -------: | :--------: |\n| 单元格 | 单元格 | 单元格 |\n| 单元格 | 单元格 | 单元格 |\n\n使用 Ctrl+Alt+Del 重启电脑\n\n\\ 反斜线\n\n` 反引号\n\n* 星号\n _ 下划线\n {} 花括号\n [] 方括号\n () 小括号\n\n# 井字号\n\n* 加号\n* 减号\n . 英文句点\n ! 感叹号\n\n```c\n//注释测试\n#include \n#include \n#include \n#ifdef _WIN32\n#include \n#include \n#endif\n#include \n\nstruct point\n{\n double x[3];\n};\nstruct edge\n{\n struct point a, b;\n};\nstruct plane\n{\n // k[0]x+k[1]y+k[2]z=d\n double k[3], d;\n};\ntypedef struct point point;\ntypedef struct edge edge;\ntypedef struct plane plane;\n\n#define PI 3.14159265358\npoint cubePoint[8] = {{0.5, 0.5, -0.5}, {0.5, 0.5, 0.5}, {-0.5, 0.5, 0.5}, {-0.5, 0.5, -0.5}, {0.5, -0.5, -0.5}, {0.5, -0.5, 0.5}, {-0.5, -0.5, 0.5}, {-0.5, -0.5, -0.5}};\nint cubePlaneGroup[6][4] = {{0, 1, 5, 4}, {1, 2, 6, 5}, {2, 3, 7, 6}, {3, 0, 4, 7}, {0, 1, 2, 3}, {4, 5, 6, 7}};\nint PlaneNumber[6];\nint table[6][6] = {{2, 4, 5, 3, 1, 6}, {1, 3, 6, 4, 2, 5}, {1, 5, 6, 2, 3, 4}, {2, 6, 5, 1, 4, 3}, {4, 6, 3, 1, 5, 2}, {3, 5, 4, 2, 6, 1}};\ndouble cube2dPoint[8][2];\nint cubeDisplayPoint[8][2];\npoint camera = {2, 1.5, 2};\npoint cameraY = {-2, 2, 2};\nconst double cameraR = 3.5;\ndouble displayPlaneSize = 4;\nconst int displayPixelSize = 30;\n// 终端英文字符宽高比例需要1:2\nconst int displayPixelWidth = 60;\nchar displayBuff[30][60];\ndouble angleA = -PI / 4;\ndouble angleB = PI / 4;\ndouble speed = 0.05;\n\nvoid draw();\n\n#ifndef _WIN32\n#include \n#include \nchar getch()\n{\n char buf = 0;\n struct termios old = {0};\n fflush(stdout);\n if (tcgetattr(0, &old) < 0)\n perror(\"tcsetattr()\");\n old.c_lflag &= ~ICANON; // local modes = Non Canonical mode\n old.c_lflag &= ~ECHO; // local modes = Disable echo.\n old.c_cc[VMIN] = 1; // control chars (MIN value) = 1\n old.c_cc[VTIME] = 0; // control chars (TIME value) = 0 (No time)\n if (tcsetattr(0, TCSANOW, &old) < 0)\n perror(\"tcsetattr ICANON\");\n if (read(0, &buf, 1) < 0)\n perror(\"read()\");\n old.c_lflag |= ICANON; // local modes = Canonical mode\n old.c_lflag |= ECHO; // local modes = Enable echo.\n if (tcsetattr(0, TCSADRAIN, &old) < 0)\n perror(\"tcsetattr ~ICANON\");\n return buf;\n}\n#endif\n\nplane getDisplayPlane()\n{\n double d = 0;\n for (int i = 0; i < 3; i++)\n {\n d += camera.x[i] * camera.x[i];\n }\n return (plane){{camera.x[0], camera.x[1], camera.x[2]}, -d};\n}\n\npoint getDisplayCenter()\n{\n return (point){-camera.x[0], -camera.x[1], -camera.x[2]};\n}\n\npoint getVector(point a, point b)\n{\n return (point){b.x[0] - a.x[0], b.x[1] - a.x[1], b.x[2] - a.x[2]};\n}\n\ndouble innerProduct(point a, point b)\n{\n double res = 0;\n for (int i = 0; i < 3; i++)\n {\n res += a.x[i] * b.x[i];\n }\n return res;\n}\n\npoint crossProduct(point a, point b)\n{\n return (point){a.x[1] * b.x[2] - a.x[2] * b.x[1], a.x[2] * b.x[0] - a.x[0] * b.x[2], a.x[0] * b.x[1] - a.x[1] * b.x[0]};\n}\n\ndouble getLength(point a)\n{\n double sqr = 0;\n for (int i = 0; i < 3; i++)\n {\n sqr += a.x[i] * a.x[i];\n }\n return sqrt(sqr);\n}\n\npoint getPoint(edge a, plane b)\n{\n point res;\n for (int i = 0; i < 3; i++)\n {\n double k = b.k[i];\n double d = b.d;\n for (int j = 0; j < 3; j++)\n {\n if (i != j)\n {\n k += b.k[j] * (a.a.x[j] - a.b.x[j]) / (a.a.x[i] - a.b.x[i]);\n d -= b.k[j] * (a.b.x[j] * a.a.x[i] - a.a.x[j] * a.b.x[i]) / (a.a.x[i] - a.b.x[i]);\n }\n }\n res.x[i] = d / k;\n }\n return res;\n}\n\nvoid initCamera()\n{\n\n camera.x[0] = cos(angleA) * cos(angleB) * cameraR;\n camera.x[1] = sin(angleA) * cameraR;\n camera.x[2] = cos(angleA) * sin(angleB) * cameraR;\n\n cameraY.x[0] = cos(angleA + PI / 2) * cos(angleB) * cameraR;\n cameraY.x[1] = sin(angleA + PI / 2) * cameraR;\n cameraY.x[2] = cos(angleA + PI / 2) * sin(angleB) * cameraR;\n}\n\nvoid drawLine(const int a[2], const int b[2])\n{\n\n if (a[0] == b[0] && a[1] == b[1])\n {\n return;\n }\n int step[2];\n for (int i = 0; i < 2; i++)\n {\n if (a[i] - b[i] > 0)\n {\n step[i] = -1;\n }\n else if (a[i] - b[i] == 0)\n {\n step[i] = 0;\n }\n else\n {\n step[i] = 1;\n }\n }\n if (abs(a[0] - b[0]) > abs(a[1] - b[1]))\n {\n int j = a[1];\n double k = (a[1] - b[1]) * 1.0 / (a[0] - b[0]);\n for (int i = a[0] + step[0]; (b[0] - i) / step[0] > 0; i += step[0])\n {\n if (fabs(1.0 * (j + step[1] - a[1]) / (i - a[0]) - k) < fabs(1.0 * (j - a[1]) / (i - a[0]) - k))\n {\n j += step[1];\n }\n if (displayBuff[i][j] == 0)\n {\n displayBuff[i][j] = '*';\n }\n }\n }\n else\n {\n int j = a[0];\n double k = (a[0] - b[0]) * 1.0 / (a[1] - b[1]);\n for (int i = a[1] + step[1]; (b[1] - i) / step[1] > 0; i += step[1])\n {\n if (fabs(1.0 * (j + step[0] - a[0]) / (i - a[1]) - k) < fabs(1.0 * (j - a[0]) / (i - a[1]) - k))\n {\n j += step[0];\n }\n if (displayBuff[j][i] == 0)\n {\n displayBuff[j][i] = '*';\n }\n }\n }\n}\n\nvoid fswap(double *a, double *b)\n{\n double tmp = *a;\n *a = *b;\n *b = tmp;\n}\n\nvoid fill(int r, int c, char ch)\n{\n if (r < 1 || c < 1 || r >= displayPixelSize || c >= displayPixelWidth)\n {\n return;\n }\n if (displayBuff[r][c] != 0)\n {\n return;\n }\n displayBuff[r][c] = ch;\n fill(r + 1, c, ch);\n fill(r - 1, c, ch);\n fill(r, c + 1, ch);\n fill(r, c - 1, ch);\n}\n\nint sqr(int x)\n{\n return x * 2;\n}\n\nvoid drawCube()\n{\n memset(displayBuff, 0, sizeof(displayBuff));\n double dis[6][2] = {0};\n\n for (int i = 0; i < 6; i++)\n {\n dis[i][0] = i;\n for (int j = 0; j < 4; j++)\n {\n dis[i][1] += getLength(getVector(camera, cubePoint[cubePlaneGroup[i][j]]));\n }\n for (int j = i - 1; j >= 0; j--)\n {\n if (dis[j][1] > dis[j + 1][1])\n {\n fswap(&dis[j][1], &dis[j + 1][1]);\n fswap(&dis[j][0], &dis[j + 1][0]);\n }\n }\n }\n for (int i = 0; i < 6; i++)\n {\n int planeId = (int)dis[i][0];\n int hide = 0;\n int xy[4][2];\n for (int j = 0; j < 4; j++)\n {\n memcpy(xy[j], cubeDisplayPoint[cubePlaneGroup[planeId][j]], sizeof(xy[j]));\n }\n for (int j = 0; j < 4; j++)\n {\n if (displayBuff[xy[j][0]][xy[j][1]] != 0 && displayBuff[xy[j][0]][xy[j][1]] != '+')\n {\n hide = 1;\n }\n }\n if (hide)\n {\n continue;\n }\n\n for (int j = 0; j < 4; j++)\n {\n drawLine(xy[j], xy[(j + 1) % 4]);\n }\n for (int j = 0; j < 4; j++)\n {\n displayBuff[xy[j][0]][xy[j][1]] = '+';\n }\n int center[2];\n if (sqr(xy[0][0] - xy[2][0]) + sqr(xy[0][1] - xy[2][1]) > sqr(xy[1][0] - xy[3][0]) + sqr(xy[1][1] - xy[3][1]))\n {\n center[0] = (xy[0][0] + xy[2][0]) / 2.0 + 0.5;\n center[1] = (xy[0][1] + xy[2][1]) / 2.0 + 0.5;\n }\n else\n {\n center[0] = (xy[1][0] + xy[3][0]) / 2.0 + 0.5;\n center[1] = (xy[1][1] + xy[3][1]) / 2.0 + 0.5;\n }\n fill(center[0], center[1], ' ');\n displayBuff[center[0]][center[1]] = '0' + PlaneNumber[planeId];\n }\n}\n\nvoid randomCast()\n{\n int tableIdx = rand() % 6;\n int offset = rand();\n for (int i = 0; i < 4; i++)\n {\n PlaneNumber[i] = table[tableIdx][(i + offset) % 4];\n }\n for (int i = 4; i < 6; i++)\n {\n PlaneNumber[i] = table[tableIdx][i];\n }\n}\n\nvoid cls()\n{\n#ifdef _WIN32\n COORD pos = {0, 0};\n HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE);\n SetConsoleCursorPosition(out, pos);\n#endif\n#ifndef _WIN32\n printf(\"\\033c\");\n#endif\n}\n\nvoid draw()\n{\n initCamera();\n for (int i = 0; i < 8; i++)\n {\n point p = getPoint((edge){camera, cubePoint[i]}, getDisplayPlane());\n point v = getVector(getDisplayCenter(), p);\n double vlen = getLength(v);\n double cos = innerProduct(v, cameraY) / getLength(cameraY) / vlen;\n double sin = sqrt(fabs(1 - cos * cos));\n int largeThanPi = innerProduct(crossProduct(cameraY, v), camera) < 0;\n double y = cos * vlen;\n double x = -sin * vlen;\n if (largeThanPi)\n {\n x *= -1;\n }\n cube2dPoint[i][0] = x;\n cube2dPoint[i][1] = y;\n cubeDisplayPoint[i][1] = ((x + displayPlaneSize / 2) / displayPlaneSize * displayPixelSize * 2 + 0.5);\n cubeDisplayPoint[i][0] = ((y + displayPlaneSize / 2) / displayPlaneSize * displayPixelSize + 0.5);\n }\n drawCube();\n char output[displayPixelSize * displayPixelSize * 2 + displayPixelSize + 1];\n int idx = 0;\n for (int i = 0; i < displayPixelSize; i++)\n {\n for (int j = 0; j < displayPixelSize * 2; j++)\n {\n if (displayBuff[i][j] == 0)\n {\n displayBuff[i][j] = '.';\n }\n output[idx++] = displayBuff[i][j];\n }\n output[idx++] = '\\n';\n }\n output[idx++] = 0;\n cls();\n printf(\"%s\", output);\n}\nvoid start()\n{\n while (1)\n {\n int key = getch();\n switch (key)\n {\n case 27:\n {\n exit(0);\n }\n case 'w':\n {\n angleA -= speed;\n break;\n }\n case 's':\n {\n angleA += speed;\n break;\n }\n case 'a':\n {\n angleB += speed;\n break;\n }\n case 'd':\n {\n angleB -= speed;\n break;\n }\n case 'r':\n randomCast();\n break;\n };\n draw();\n }\n}\n\nint main()\n{\n#ifdef _WIN32\n system(\"cls\");\n#endif\n srand(time(0));\n randomCast();\n draw();\n start();\n}\n```\n\n```python\nimport requests\nfrom bs4 import BeautifulSoup\nimport re\nvalue = ''\nvalue = str(input('输入搜索标题文字:'))\nif value == '':\n value = \"御坂美琴\"\nprint('''\n------------\n| 1.综合 |\n| 2.播放 |\n| 3.最新 |\n| 4.弹幕 |\n| 5.收藏 |\n------------\n''')\nssfs = 0\n\nssfs = input('请输入排序方式:')\nif ssfs=='':\n ssfs = 2\nfs = [\"\", \"&order=click\", \"&order=pubdate\", \"&order=dm\", \"&order=stow\"]\nif ssfs == 1:\n ssfs = fs[0]\nelif ssfs == 2:\n ssfs = fs[1]\nelif ssfs == 3:\n ssfs = fs[2]\nelif ssfs == 4:\n ssfs = fs[3]\nelif ssfs == 5:\n ssfs = fs[4]\nhead = {\n 'user-agent':\n 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) \\\n Chrome/80.0.3987.88 Safari/537.36'\n}\nurl = 'https://search.bilibili.com/all?keyword='+ \\\n value +ssfs\ndef geturl(url):\n try:\n a = requests.get(url, headers=head)\n if a.status_code == 200:\n return a.text\n except requests.RequestException:\n return None\nhtml = geturl(url)\nbf = BeautifulSoup(html, 'lxml')\ntitles = bf.find_all(\"div\", class_=\"headline clearfix\")\nbfl = bf.find_all(\"span\", class_=\"so-icon watch-num\")\ndm = bf.find_all(\"span\", class_=\"so-icon hide\")\nhref = re.findall('href=\"//(.*?)\"', str(titles))\nnewt = re.findall('title=\"(.*?)\">', str(titles))\nnewb = re.findall(r'(.*?)', str(bfl), re.S)\nnewdm = re.findall(r'(.*?)', str(dm), re.S)\na = ''\nb = ''\nlent = len(newt)\nfor i in range(lent):\n printf = str(newt[i])\n a = a + printf + '\\n'\n sc = str(i + 1) + printf + \"\\n 播放量\" + str(\n newb[i]) + \" 弹幕\" + '\\t' + str(newdm[i]) + \"\\n链接\" + str(href[i])\n print(sc)\n print(\"------------------------------------------------\")\n b += (sc + \"\\n------------------------------------------------\\n\")\ny = input('是否保存?(y,n)')\nif y == 'y':\n with open(value + str(ssfs) + '.txt', 'w+') as f:\n f.write(b)\n print(\"保存成功!\")\n```\n",
isPublish: true,
allowComment: true,
menus: {
menus: [
{
type: "h1",
target: "#t0",
title: "一级标题123123"
},
{
type: "h2",
target: "#t1",
title: "二级标题"
},
{
type: "h3",
target: "#t2",
title: "三级标题"
},
{
type: "h4",
target: "#t3",
title: "四级标题"
},
{
type: "h5",
target: "#t4",
title: "五级标题"
},
{
type: "h6",
target: "#t5",
title: "六级标题"
},
{
type: "h1",
target: "#t6",
title: "我展示的是一级标题"
},
{
type: "h2",
target: "#t7",
title: "我展示的是二级标题"
},
{
type: "h1",
target: "#t8",
title: "井字号"
}
],
summary: "2021-5-11 20:54:35@[TOC]# 一级标题123123## 二级标题### 三级标题#### 四级标题##### 五级标题###### 六级标题# 我展示的是一级标题## 我展示的是二级标题*斜体文本**斜体文本***粗体文本**"
}
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("60a4ca29f934526fa8594919"),
text: "<html><head></head><body><p><img src=\"http://api.03c3.cn/zb\" alt=\"\"></p>\n</body></html>",
createdAt: ISODate("2021-05-19T08:19:53.375Z"),
updatedAt: ISODate("2021-05-19T08:26:26.472Z"),
__v: NumberInt("0"),
fieldsId: "60a4ca29f934526fa859491a",
mdText: "zccs\n",
menus: "",
isPublish: false,
allowComment: false
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("60a4d803a14c5f03d4e7d03b"),
text: "<html><head></head><body><p>2021-5-11 20:54:35</p>\n<p>@[TOC]</p>\n<h1 id=\"t0\">一级标题123123</h1>\n<h2 id=\"t1\">二级标题</h2>\n<h3 id=\"t2\">三级标题</h3>\n<h4 id=\"t3\">四级标题</h4>\n<h5 id=\"t4\">五级标题</h5>\n<h6 id=\"t5\">六级标题</h6>\n<h1 id=\"t6\">我展示的是一级标题</h1>\n<h2 id=\"t7\">我展示的是二级标题</h2>\n<p><em>斜体文本</em></p>\n<p><em>斜体文本</em></p>\n<p><strong>粗体文本</strong></p>\n<p><strong>粗体文本</strong></p>\n<p><em><strong>粗斜体文本</strong></em></p>\n<p><em><strong>粗斜体文本</strong></em></p>\n<hr>\n<hr>\n<hr>\n<hr>\n<hr>\n<p><a href=\"RUNOOB.COM\">RUNOOB.COM</a></p>\n<p><a href=\"GOOGLE.COM\">GOOGLE.COM</a></p>\n<p>~~<a href=\"BAIDU.COM\">BAIDU.COM</a></p>\n<ul>\n<li>第一项</li>\n<li>第二项</li>\n<li>第三项</li>\n<li>第一项</li>\n<li>第二项</li>\n<li>第三项</li>\n<li>第一项</li>\n<li>第二项</li>\n<li>第三项</li>\n</ul>\n<ol>\n<li>第一项:\n<ul>\n<li>第一项嵌套的第一个元素</li>\n<li>第一项嵌套的第二个元素</li>\n</ul>\n</li>\n<li>第二项:\n<ul>\n<li>第二项嵌套的第一个元素</li>\n<li>第二项嵌套的第二个元素</li>\n</ul>\n</li>\n</ol>\n<blockquote>\n<p>区块引用</p>\n<p>菜鸟教程</p>\n<p>学的不仅是技术更是梦想</p>\n</blockquote>\n<p><code>printf()</code> 函数</p>\n<pre><code class=\"language-javascript\">$(document).ready(function () {\n alert('RUNOOB');\n});\n</code></pre>\n<p>这是一个链接 <a href=\"https://www.runoob.com\">菜鸟教程</a></p>\n<p><a href=\"https://www.runoob.com\">https://www.runoob.com</a></p>\n<p><img src=\"http://static.runoob.com/images/runoob-logo.png\" alt=\"RUNOOB 图标\"></p>\n<table>\n<thead>\n<tr>\n<th>表头</th>\n<th>表头</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>单元格</td>\n<td>单元格</td>\n</tr>\n<tr>\n<td>单元格</td>\n<td>单元格</td>\n</tr>\n</tbody>\n</table>\n<table>\n<thead>\n<tr>\n<th align=\"left\">左对齐</th>\n<th align=\"right\">右对齐</th>\n<th align=\"center\">居中对齐</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"left\">单元格</td>\n<td align=\"right\">单元格</td>\n<td align=\"center\">单元格</td>\n</tr>\n<tr>\n<td align=\"left\">单元格</td>\n<td align=\"right\">单元格</td>\n<td align=\"center\">单元格</td>\n</tr>\n</tbody>\n</table>\n<p>使用 Ctrl+Alt+Del 重启电脑</p>\n<p>\\ 反斜线</p>\n<p>` 反引号</p>\n<ul>\n<li>星号<br>\n_ 下划线<br>\n{} 花括号<br>\n[] 方括号<br>\n() 小括号</li>\n</ul>\n<h1 id=\"t8\">井字号</h1>\n<ul>\n<li>加号</li>\n<li>减号<br>\n. 英文句点<br>\n! 感叹号</li>\n</ul>\n<pre><code class=\"language-c\">//注释测试\n#include \n#include \n#include \n#ifdef _WIN32\n#include \n#include \n#endif\n#include \n\nstruct point\n{\n double x[3];\n};\nstruct edge\n{\n struct point a, b;\n};\nstruct plane\n{\n // k[0]x+k[1]y+k[2]z=d\n double k[3], d;\n};\ntypedef struct point point;\ntypedef struct edge edge;\ntypedef struct plane plane;\n\n#define PI 3.14159265358\npoint cubePoint[8] = {{0.5, 0.5, -0.5}, {0.5, 0.5, 0.5}, {-0.5, 0.5, 0.5}, {-0.5, 0.5, -0.5}, {0.5, -0.5, -0.5}, {0.5, -0.5, 0.5}, {-0.5, -0.5, 0.5}, {-0.5, -0.5, -0.5}};\nint cubePlaneGroup[6][4] = {{0, 1, 5, 4}, {1, 2, 6, 5}, {2, 3, 7, 6}, {3, 0, 4, 7}, {0, 1, 2, 3}, {4, 5, 6, 7}};\nint PlaneNumber[6];\nint table[6][6] = {{2, 4, 5, 3, 1, 6}, {1, 3, 6, 4, 2, 5}, {1, 5, 6, 2, 3, 4}, {2, 6, 5, 1, 4, 3}, {4, 6, 3, 1, 5, 2}, {3, 5, 4, 2, 6, 1}};\ndouble cube2dPoint[8][2];\nint cubeDisplayPoint[8][2];\npoint camera = {2, 1.5, 2};\npoint cameraY = {-2, 2, 2};\nconst double cameraR = 3.5;\ndouble displayPlaneSize = 4;\nconst int displayPixelSize = 30;\n// 终端英文字符宽高比例需要1:2\nconst int displayPixelWidth = 60;\nchar displayBuff[30][60];\ndouble angleA = -PI / 4;\ndouble angleB = PI / 4;\ndouble speed = 0.05;\n\nvoid draw();\n\n#ifndef _WIN32\n#include \n#include \nchar getch()\n{\n char buf = 0;\n struct termios old = {0};\n fflush(stdout);\n if (tcgetattr(0, &old) < 0)\n perror(\"tcsetattr()\");\n old.c_lflag &= ~ICANON; // local modes = Non Canonical mode\n old.c_lflag &= ~ECHO; // local modes = Disable echo.\n old.c_cc[VMIN] = 1; // control chars (MIN value) = 1\n old.c_cc[VTIME] = 0; // control chars (TIME value) = 0 (No time)\n if (tcsetattr(0, TCSANOW, &old) < 0)\n perror(\"tcsetattr ICANON\");\n if (read(0, &buf, 1) < 0)\n perror(\"read()\");\n old.c_lflag |= ICANON; // local modes = Canonical mode\n old.c_lflag |= ECHO; // local modes = Enable echo.\n if (tcsetattr(0, TCSADRAIN, &old) < 0)\n perror(\"tcsetattr ~ICANON\");\n return buf;\n}\n#endif\n\nplane getDisplayPlane()\n{\n double d = 0;\n for (int i = 0; i < 3; i++)\n {\n d += camera.x[i] * camera.x[i];\n }\n return (plane){{camera.x[0], camera.x[1], camera.x[2]}, -d};\n}\n\npoint getDisplayCenter()\n{\n return (point){-camera.x[0], -camera.x[1], -camera.x[2]};\n}\n\npoint getVector(point a, point b)\n{\n return (point){b.x[0] - a.x[0], b.x[1] - a.x[1], b.x[2] - a.x[2]};\n}\n\ndouble innerProduct(point a, point b)\n{\n double res = 0;\n for (int i = 0; i < 3; i++)\n {\n res += a.x[i] * b.x[i];\n }\n return res;\n}\n\npoint crossProduct(point a, point b)\n{\n return (point){a.x[1] * b.x[2] - a.x[2] * b.x[1], a.x[2] * b.x[0] - a.x[0] * b.x[2], a.x[0] * b.x[1] - a.x[1] * b.x[0]};\n}\n\ndouble getLength(point a)\n{\n double sqr = 0;\n for (int i = 0; i < 3; i++)\n {\n sqr += a.x[i] * a.x[i];\n }\n return sqrt(sqr);\n}\n\npoint getPoint(edge a, plane b)\n{\n point res;\n for (int i = 0; i < 3; i++)\n {\n double k = b.k[i];\n double d = b.d;\n for (int j = 0; j < 3; j++)\n {\n if (i != j)\n {\n k += b.k[j] * (a.a.x[j] - a.b.x[j]) / (a.a.x[i] - a.b.x[i]);\n d -= b.k[j] * (a.b.x[j] * a.a.x[i] - a.a.x[j] * a.b.x[i]) / (a.a.x[i] - a.b.x[i]);\n }\n }\n res.x[i] = d / k;\n }\n return res;\n}\n\nvoid initCamera()\n{\n\n camera.x[0] = cos(angleA) * cos(angleB) * cameraR;\n camera.x[1] = sin(angleA) * cameraR;\n camera.x[2] = cos(angleA) * sin(angleB) * cameraR;\n\n cameraY.x[0] = cos(angleA + PI / 2) * cos(angleB) * cameraR;\n cameraY.x[1] = sin(angleA + PI / 2) * cameraR;\n cameraY.x[2] = cos(angleA + PI / 2) * sin(angleB) * cameraR;\n}\n\nvoid drawLine(const int a[2], const int b[2])\n{\n\n if (a[0] == b[0] && a[1] == b[1])\n {\n return;\n }\n int step[2];\n for (int i = 0; i < 2; i++)\n {\n if (a[i] - b[i] > 0)\n {\n step[i] = -1;\n }\n else if (a[i] - b[i] == 0)\n {\n step[i] = 0;\n }\n else\n {\n step[i] = 1;\n }\n }\n if (abs(a[0] - b[0]) > abs(a[1] - b[1]))\n {\n int j = a[1];\n double k = (a[1] - b[1]) * 1.0 / (a[0] - b[0]);\n for (int i = a[0] + step[0]; (b[0] - i) / step[0] > 0; i += step[0])\n {\n if (fabs(1.0 * (j + step[1] - a[1]) / (i - a[0]) - k) < fabs(1.0 * (j - a[1]) / (i - a[0]) - k))\n {\n j += step[1];\n }\n if (displayBuff[i][j] == 0)\n {\n displayBuff[i][j] = '*';\n }\n }\n }\n else\n {\n int j = a[0];\n double k = (a[0] - b[0]) * 1.0 / (a[1] - b[1]);\n for (int i = a[1] + step[1]; (b[1] - i) / step[1] > 0; i += step[1])\n {\n if (fabs(1.0 * (j + step[0] - a[0]) / (i - a[1]) - k) < fabs(1.0 * (j - a[0]) / (i - a[1]) - k))\n {\n j += step[0];\n }\n if (displayBuff[j][i] == 0)\n {\n displayBuff[j][i] = '*';\n }\n }\n }\n}\n\nvoid fswap(double *a, double *b)\n{\n double tmp = *a;\n *a = *b;\n *b = tmp;\n}\n\nvoid fill(int r, int c, char ch)\n{\n if (r < 1 || c < 1 || r >= displayPixelSize || c >= displayPixelWidth)\n {\n return;\n }\n if (displayBuff[r][c] != 0)\n {\n return;\n }\n displayBuff[r][c] = ch;\n fill(r + 1, c, ch);\n fill(r - 1, c, ch);\n fill(r, c + 1, ch);\n fill(r, c - 1, ch);\n}\n\nint sqr(int x)\n{\n return x * 2;\n}\n\nvoid drawCube()\n{\n memset(displayBuff, 0, sizeof(displayBuff));\n double dis[6][2] = {0};\n\n for (int i = 0; i < 6; i++)\n {\n dis[i][0] = i;\n for (int j = 0; j < 4; j++)\n {\n dis[i][1] += getLength(getVector(camera, cubePoint[cubePlaneGroup[i][j]]));\n }\n for (int j = i - 1; j >= 0; j--)\n {\n if (dis[j][1] > dis[j + 1][1])\n {\n fswap(&dis[j][1], &dis[j + 1][1]);\n fswap(&dis[j][0], &dis[j + 1][0]);\n }\n }\n }\n for (int i = 0; i < 6; i++)\n {\n int planeId = (int)dis[i][0];\n int hide = 0;\n int xy[4][2];\n for (int j = 0; j < 4; j++)\n {\n memcpy(xy[j], cubeDisplayPoint[cubePlaneGroup[planeId][j]], sizeof(xy[j]));\n }\n for (int j = 0; j < 4; j++)\n {\n if (displayBuff[xy[j][0]][xy[j][1]] != 0 && displayBuff[xy[j][0]][xy[j][1]] != '+')\n {\n hide = 1;\n }\n }\n if (hide)\n {\n continue;\n }\n\n for (int j = 0; j < 4; j++)\n {\n drawLine(xy[j], xy[(j + 1) % 4]);\n }\n for (int j = 0; j < 4; j++)\n {\n displayBuff[xy[j][0]][xy[j][1]] = '+';\n }\n int center[2];\n if (sqr(xy[0][0] - xy[2][0]) + sqr(xy[0][1] - xy[2][1]) > sqr(xy[1][0] - xy[3][0]) + sqr(xy[1][1] - xy[3][1]))\n {\n center[0] = (xy[0][0] + xy[2][0]) / 2.0 + 0.5;\n center[1] = (xy[0][1] + xy[2][1]) / 2.0 + 0.5;\n }\n else\n {\n center[0] = (xy[1][0] + xy[3][0]) / 2.0 + 0.5;\n center[1] = (xy[1][1] + xy[3][1]) / 2.0 + 0.5;\n }\n fill(center[0], center[1], ' ');\n displayBuff[center[0]][center[1]] = '0' + PlaneNumber[planeId];\n }\n}\n\nvoid randomCast()\n{\n int tableIdx = rand() % 6;\n int offset = rand();\n for (int i = 0; i < 4; i++)\n {\n PlaneNumber[i] = table[tableIdx][(i + offset) % 4];\n }\n for (int i = 4; i < 6; i++)\n {\n PlaneNumber[i] = table[tableIdx][i];\n }\n}\n\nvoid cls()\n{\n#ifdef _WIN32\n COORD pos = {0, 0};\n HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE);\n SetConsoleCursorPosition(out, pos);\n#endif\n#ifndef _WIN32\n printf(\"\\033c\");\n#endif\n}\n\nvoid draw()\n{\n initCamera();\n for (int i = 0; i < 8; i++)\n {\n point p = getPoint((edge){camera, cubePoint[i]}, getDisplayPlane());\n point v = getVector(getDisplayCenter(), p);\n double vlen = getLength(v);\n double cos = innerProduct(v, cameraY) / getLength(cameraY) / vlen;\n double sin = sqrt(fabs(1 - cos * cos));\n int largeThanPi = innerProduct(crossProduct(cameraY, v), camera) < 0;\n double y = cos * vlen;\n double x = -sin * vlen;\n if (largeThanPi)\n {\n x *= -1;\n }\n cube2dPoint[i][0] = x;\n cube2dPoint[i][1] = y;\n cubeDisplayPoint[i][1] = ((x + displayPlaneSize / 2) / displayPlaneSize * displayPixelSize * 2 + 0.5);\n cubeDisplayPoint[i][0] = ((y + displayPlaneSize / 2) / displayPlaneSize * displayPixelSize + 0.5);\n }\n drawCube();\n char output[displayPixelSize * displayPixelSize * 2 + displayPixelSize + 1];\n int idx = 0;\n for (int i = 0; i < displayPixelSize; i++)\n {\n for (int j = 0; j < displayPixelSize * 2; j++)\n {\n if (displayBuff[i][j] == 0)\n {\n displayBuff[i][j] = '.';\n }\n output[idx++] = displayBuff[i][j];\n }\n output[idx++] = '\\n';\n }\n output[idx++] = 0;\n cls();\n printf(\"%s\", output);\n}\nvoid start()\n{\n while (1)\n {\n int key = getch();\n switch (key)\n {\n case 27:\n {\n exit(0);\n }\n case 'w':\n {\n angleA -= speed;\n break;\n }\n case 's':\n {\n angleA += speed;\n break;\n }\n case 'a':\n {\n angleB += speed;\n break;\n }\n case 'd':\n {\n angleB -= speed;\n break;\n }\n case 'r':\n randomCast();\n break;\n };\n draw();\n }\n}\n\nint main()\n{\n#ifdef _WIN32\n system(\"cls\");\n#endif\n srand(time(0));\n randomCast();\n draw();\n start();\n}\n</code></pre>\n<pre><code class=\"language-python\">import requests\nfrom bs4 import BeautifulSoup\nimport re\nvalue = ''\nvalue = str(input('输入搜索标题文字:'))\nif value == '':\n value = \"御坂美琴\"\nprint('''\n------------\n| 1.综合 |\n| 2.播放 |\n| 3.最新 |\n| 4.弹幕 |\n| 5.收藏 |\n------------\n''')\nssfs = 0\n\nssfs = input('请输入排序方式:')\nif ssfs=='':\n ssfs = 2\nfs = [\"\", \"&order=click\", \"&order=pubdate\", \"&order=dm\", \"&order=stow\"]\nif ssfs == 1:\n ssfs = fs[0]\nelif ssfs == 2:\n ssfs = fs[1]\nelif ssfs == 3:\n ssfs = fs[2]\nelif ssfs == 4:\n ssfs = fs[3]\nelif ssfs == 5:\n ssfs = fs[4]\nhead = {\n 'user-agent':\n 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) \\\n Chrome/80.0.3987.88 Safari/537.36'\n}\nurl = 'https://search.bilibili.com/all?keyword='+ \\\n value +ssfs\ndef geturl(url):\n try:\n a = requests.get(url, headers=head)\n if a.status_code == 200:\n return a.text\n except requests.RequestException:\n return None\nhtml = geturl(url)\nbf = BeautifulSoup(html, 'lxml')\ntitles = bf.find_all(\"div\", class_=\"headline clearfix\")\nbfl = bf.find_all(\"span\", class_=\"so-icon watch-num\")\ndm = bf.find_all(\"span\", class_=\"so-icon hide\")\nhref = re.findall('href=\"//(.*?)\"', str(titles))\nnewt = re.findall('title=\"(.*?)\">', str(titles))\nnewb = re.findall(r'(.*?)', str(bfl), re.S)\nnewdm = re.findall(r'(.*?)', str(dm), re.S)\na = ''\nb = ''\nlent = len(newt)\nfor i in range(lent):\n printf = str(newt[i])\n a = a + printf + '\\n'\n sc = str(i + 1) + printf + \"\\n 播放量\" + str(\n newb[i]) + \" 弹幕\" + '\\t' + str(newdm[i]) + \"\\n链接\" + str(href[i])\n print(sc)\n print(\"------------------------------------------------\")\n b += (sc + \"\\n------------------------------------------------\\n\")\ny = input('是否保存?(y,n)')\nif y == 'y':\n with open(value + str(ssfs) + '.txt', 'w+') as f:\n f.write(b)\n print(\"保存成功!\")\n</code></pre>\n</body></html>",
mdText: "2021-5-11 20:54:35\n\n@[TOC]\n\n# 一级标题123123\n\n## 二级标题\n\n### 三级标题\n\n#### 四级标题\n\n##### 五级标题\n\n###### 六级标题\n\n# 我展示的是一级标题\n\n## 我展示的是二级标题\n\n*斜体文本*\n\n*斜体文本*\n\n**粗体文本**\n\n**粗体文本**\n\n***粗斜体文本***\n\n***粗斜体文本***\n\n---\n\n---\n\n---\n\n---\n\n---\n\n[RUNOOB.COM](RUNOOB.COM)\n\n[GOOGLE.COM](GOOGLE.COM)\n\n~~[BAIDU.COM](BAIDU.COM)\n\n* 第一项\n* 第二项\n* 第三项\n* 第一项\n* 第二项\n* 第三项\n* 第一项\n* 第二项\n* 第三项\n\n1. 第一项:\n * 第一项嵌套的第一个元素\n * 第一项嵌套的第二个元素\n2. 第二项:\n * 第二项嵌套的第一个元素\n * 第二项嵌套的第二个元素\n\n> 区块引用\n>\n> 菜鸟教程\n>\n> 学的不仅是技术更是梦想\n\n`printf()` 函数\n\n```javascript\n$(document).ready(function () {\n alert('RUNOOB');\n});\n```\n\n这是一个链接 [菜鸟教程](https://www.runoob.com)\n\n[https://www.runoob.com](https://www.runoob.com)\n\n\n\n\n| 表头 | 表头 |\n| -------- | -------- |\n| 单元格 | 单元格 |\n| 单元格 | 单元格 |\n\n\n| 左对齐 | 右对齐 | 居中对齐 |\n| :------- | -------: | :--------: |\n| 单元格 | 单元格 | 单元格 |\n| 单元格 | 单元格 | 单元格 |\n\n使用 Ctrl+Alt+Del 重启电脑\n\n\\ 反斜线\n\n` 反引号\n\n* 星号\n _ 下划线\n {} 花括号\n [] 方括号\n () 小括号\n\n# 井字号\n\n* 加号\n* 减号\n . 英文句点\n ! 感叹号\n\n```c\n//注释测试\n#include \n#include \n#include \n#ifdef _WIN32\n#include \n#include \n#endif\n#include \n\nstruct point\n{\n double x[3];\n};\nstruct edge\n{\n struct point a, b;\n};\nstruct plane\n{\n // k[0]x+k[1]y+k[2]z=d\n double k[3], d;\n};\ntypedef struct point point;\ntypedef struct edge edge;\ntypedef struct plane plane;\n\n#define PI 3.14159265358\npoint cubePoint[8] = {{0.5, 0.5, -0.5}, {0.5, 0.5, 0.5}, {-0.5, 0.5, 0.5}, {-0.5, 0.5, -0.5}, {0.5, -0.5, -0.5}, {0.5, -0.5, 0.5}, {-0.5, -0.5, 0.5}, {-0.5, -0.5, -0.5}};\nint cubePlaneGroup[6][4] = {{0, 1, 5, 4}, {1, 2, 6, 5}, {2, 3, 7, 6}, {3, 0, 4, 7}, {0, 1, 2, 3}, {4, 5, 6, 7}};\nint PlaneNumber[6];\nint table[6][6] = {{2, 4, 5, 3, 1, 6}, {1, 3, 6, 4, 2, 5}, {1, 5, 6, 2, 3, 4}, {2, 6, 5, 1, 4, 3}, {4, 6, 3, 1, 5, 2}, {3, 5, 4, 2, 6, 1}};\ndouble cube2dPoint[8][2];\nint cubeDisplayPoint[8][2];\npoint camera = {2, 1.5, 2};\npoint cameraY = {-2, 2, 2};\nconst double cameraR = 3.5;\ndouble displayPlaneSize = 4;\nconst int displayPixelSize = 30;\n// 终端英文字符宽高比例需要1:2\nconst int displayPixelWidth = 60;\nchar displayBuff[30][60];\ndouble angleA = -PI / 4;\ndouble angleB = PI / 4;\ndouble speed = 0.05;\n\nvoid draw();\n\n#ifndef _WIN32\n#include \n#include \nchar getch()\n{\n char buf = 0;\n struct termios old = {0};\n fflush(stdout);\n if (tcgetattr(0, &old) < 0)\n perror(\"tcsetattr()\");\n old.c_lflag &= ~ICANON; // local modes = Non Canonical mode\n old.c_lflag &= ~ECHO; // local modes = Disable echo.\n old.c_cc[VMIN] = 1; // control chars (MIN value) = 1\n old.c_cc[VTIME] = 0; // control chars (TIME value) = 0 (No time)\n if (tcsetattr(0, TCSANOW, &old) < 0)\n perror(\"tcsetattr ICANON\");\n if (read(0, &buf, 1) < 0)\n perror(\"read()\");\n old.c_lflag |= ICANON; // local modes = Canonical mode\n old.c_lflag |= ECHO; // local modes = Enable echo.\n if (tcsetattr(0, TCSADRAIN, &old) < 0)\n perror(\"tcsetattr ~ICANON\");\n return buf;\n}\n#endif\n\nplane getDisplayPlane()\n{\n double d = 0;\n for (int i = 0; i < 3; i++)\n {\n d += camera.x[i] * camera.x[i];\n }\n return (plane){{camera.x[0], camera.x[1], camera.x[2]}, -d};\n}\n\npoint getDisplayCenter()\n{\n return (point){-camera.x[0], -camera.x[1], -camera.x[2]};\n}\n\npoint getVector(point a, point b)\n{\n return (point){b.x[0] - a.x[0], b.x[1] - a.x[1], b.x[2] - a.x[2]};\n}\n\ndouble innerProduct(point a, point b)\n{\n double res = 0;\n for (int i = 0; i < 3; i++)\n {\n res += a.x[i] * b.x[i];\n }\n return res;\n}\n\npoint crossProduct(point a, point b)\n{\n return (point){a.x[1] * b.x[2] - a.x[2] * b.x[1], a.x[2] * b.x[0] - a.x[0] * b.x[2], a.x[0] * b.x[1] - a.x[1] * b.x[0]};\n}\n\ndouble getLength(point a)\n{\n double sqr = 0;\n for (int i = 0; i < 3; i++)\n {\n sqr += a.x[i] * a.x[i];\n }\n return sqrt(sqr);\n}\n\npoint getPoint(edge a, plane b)\n{\n point res;\n for (int i = 0; i < 3; i++)\n {\n double k = b.k[i];\n double d = b.d;\n for (int j = 0; j < 3; j++)\n {\n if (i != j)\n {\n k += b.k[j] * (a.a.x[j] - a.b.x[j]) / (a.a.x[i] - a.b.x[i]);\n d -= b.k[j] * (a.b.x[j] * a.a.x[i] - a.a.x[j] * a.b.x[i]) / (a.a.x[i] - a.b.x[i]);\n }\n }\n res.x[i] = d / k;\n }\n return res;\n}\n\nvoid initCamera()\n{\n\n camera.x[0] = cos(angleA) * cos(angleB) * cameraR;\n camera.x[1] = sin(angleA) * cameraR;\n camera.x[2] = cos(angleA) * sin(angleB) * cameraR;\n\n cameraY.x[0] = cos(angleA + PI / 2) * cos(angleB) * cameraR;\n cameraY.x[1] = sin(angleA + PI / 2) * cameraR;\n cameraY.x[2] = cos(angleA + PI / 2) * sin(angleB) * cameraR;\n}\n\nvoid drawLine(const int a[2], const int b[2])\n{\n\n if (a[0] == b[0] && a[1] == b[1])\n {\n return;\n }\n int step[2];\n for (int i = 0; i < 2; i++)\n {\n if (a[i] - b[i] > 0)\n {\n step[i] = -1;\n }\n else if (a[i] - b[i] == 0)\n {\n step[i] = 0;\n }\n else\n {\n step[i] = 1;\n }\n }\n if (abs(a[0] - b[0]) > abs(a[1] - b[1]))\n {\n int j = a[1];\n double k = (a[1] - b[1]) * 1.0 / (a[0] - b[0]);\n for (int i = a[0] + step[0]; (b[0] - i) / step[0] > 0; i += step[0])\n {\n if (fabs(1.0 * (j + step[1] - a[1]) / (i - a[0]) - k) < fabs(1.0 * (j - a[1]) / (i - a[0]) - k))\n {\n j += step[1];\n }\n if (displayBuff[i][j] == 0)\n {\n displayBuff[i][j] = '*';\n }\n }\n }\n else\n {\n int j = a[0];\n double k = (a[0] - b[0]) * 1.0 / (a[1] - b[1]);\n for (int i = a[1] + step[1]; (b[1] - i) / step[1] > 0; i += step[1])\n {\n if (fabs(1.0 * (j + step[0] - a[0]) / (i - a[1]) - k) < fabs(1.0 * (j - a[0]) / (i - a[1]) - k))\n {\n j += step[0];\n }\n if (displayBuff[j][i] == 0)\n {\n displayBuff[j][i] = '*';\n }\n }\n }\n}\n\nvoid fswap(double *a, double *b)\n{\n double tmp = *a;\n *a = *b;\n *b = tmp;\n}\n\nvoid fill(int r, int c, char ch)\n{\n if (r < 1 || c < 1 || r >= displayPixelSize || c >= displayPixelWidth)\n {\n return;\n }\n if (displayBuff[r][c] != 0)\n {\n return;\n }\n displayBuff[r][c] = ch;\n fill(r + 1, c, ch);\n fill(r - 1, c, ch);\n fill(r, c + 1, ch);\n fill(r, c - 1, ch);\n}\n\nint sqr(int x)\n{\n return x * 2;\n}\n\nvoid drawCube()\n{\n memset(displayBuff, 0, sizeof(displayBuff));\n double dis[6][2] = {0};\n\n for (int i = 0; i < 6; i++)\n {\n dis[i][0] = i;\n for (int j = 0; j < 4; j++)\n {\n dis[i][1] += getLength(getVector(camera, cubePoint[cubePlaneGroup[i][j]]));\n }\n for (int j = i - 1; j >= 0; j--)\n {\n if (dis[j][1] > dis[j + 1][1])\n {\n fswap(&dis[j][1], &dis[j + 1][1]);\n fswap(&dis[j][0], &dis[j + 1][0]);\n }\n }\n }\n for (int i = 0; i < 6; i++)\n {\n int planeId = (int)dis[i][0];\n int hide = 0;\n int xy[4][2];\n for (int j = 0; j < 4; j++)\n {\n memcpy(xy[j], cubeDisplayPoint[cubePlaneGroup[planeId][j]], sizeof(xy[j]));\n }\n for (int j = 0; j < 4; j++)\n {\n if (displayBuff[xy[j][0]][xy[j][1]] != 0 && displayBuff[xy[j][0]][xy[j][1]] != '+')\n {\n hide = 1;\n }\n }\n if (hide)\n {\n continue;\n }\n\n for (int j = 0; j < 4; j++)\n {\n drawLine(xy[j], xy[(j + 1) % 4]);\n }\n for (int j = 0; j < 4; j++)\n {\n displayBuff[xy[j][0]][xy[j][1]] = '+';\n }\n int center[2];\n if (sqr(xy[0][0] - xy[2][0]) + sqr(xy[0][1] - xy[2][1]) > sqr(xy[1][0] - xy[3][0]) + sqr(xy[1][1] - xy[3][1]))\n {\n center[0] = (xy[0][0] + xy[2][0]) / 2.0 + 0.5;\n center[1] = (xy[0][1] + xy[2][1]) / 2.0 + 0.5;\n }\n else\n {\n center[0] = (xy[1][0] + xy[3][0]) / 2.0 + 0.5;\n center[1] = (xy[1][1] + xy[3][1]) / 2.0 + 0.5;\n }\n fill(center[0], center[1], ' ');\n displayBuff[center[0]][center[1]] = '0' + PlaneNumber[planeId];\n }\n}\n\nvoid randomCast()\n{\n int tableIdx = rand() % 6;\n int offset = rand();\n for (int i = 0; i < 4; i++)\n {\n PlaneNumber[i] = table[tableIdx][(i + offset) % 4];\n }\n for (int i = 4; i < 6; i++)\n {\n PlaneNumber[i] = table[tableIdx][i];\n }\n}\n\nvoid cls()\n{\n#ifdef _WIN32\n COORD pos = {0, 0};\n HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE);\n SetConsoleCursorPosition(out, pos);\n#endif\n#ifndef _WIN32\n printf(\"\\033c\");\n#endif\n}\n\nvoid draw()\n{\n initCamera();\n for (int i = 0; i < 8; i++)\n {\n point p = getPoint((edge){camera, cubePoint[i]}, getDisplayPlane());\n point v = getVector(getDisplayCenter(), p);\n double vlen = getLength(v);\n double cos = innerProduct(v, cameraY) / getLength(cameraY) / vlen;\n double sin = sqrt(fabs(1 - cos * cos));\n int largeThanPi = innerProduct(crossProduct(cameraY, v), camera) < 0;\n double y = cos * vlen;\n double x = -sin * vlen;\n if (largeThanPi)\n {\n x *= -1;\n }\n cube2dPoint[i][0] = x;\n cube2dPoint[i][1] = y;\n cubeDisplayPoint[i][1] = ((x + displayPlaneSize / 2) / displayPlaneSize * displayPixelSize * 2 + 0.5);\n cubeDisplayPoint[i][0] = ((y + displayPlaneSize / 2) / displayPlaneSize * displayPixelSize + 0.5);\n }\n drawCube();\n char output[displayPixelSize * displayPixelSize * 2 + displayPixelSize + 1];\n int idx = 0;\n for (int i = 0; i < displayPixelSize; i++)\n {\n for (int j = 0; j < displayPixelSize * 2; j++)\n {\n if (displayBuff[i][j] == 0)\n {\n displayBuff[i][j] = '.';\n }\n output[idx++] = displayBuff[i][j];\n }\n output[idx++] = '\\n';\n }\n output[idx++] = 0;\n cls();\n printf(\"%s\", output);\n}\nvoid start()\n{\n while (1)\n {\n int key = getch();\n switch (key)\n {\n case 27:\n {\n exit(0);\n }\n case 'w':\n {\n angleA -= speed;\n break;\n }\n case 's':\n {\n angleA += speed;\n break;\n }\n case 'a':\n {\n angleB += speed;\n break;\n }\n case 'd':\n {\n angleB -= speed;\n break;\n }\n case 'r':\n randomCast();\n break;\n };\n draw();\n }\n}\n\nint main()\n{\n#ifdef _WIN32\n system(\"cls\");\n#endif\n srand(time(0));\n randomCast();\n draw();\n start();\n}\n```\n\n```python\nimport requests\nfrom bs4 import BeautifulSoup\nimport re\nvalue = ''\nvalue = str(input('输入搜索标题文字:'))\nif value == '':\n value = \"御坂美琴\"\nprint('''\n------------\n| 1.综合 |\n| 2.播放 |\n| 3.最新 |\n| 4.弹幕 |\n| 5.收藏 |\n------------\n''')\nssfs = 0\n\nssfs = input('请输入排序方式:')\nif ssfs=='':\n ssfs = 2\nfs = [\"\", \"&order=click\", \"&order=pubdate\", \"&order=dm\", \"&order=stow\"]\nif ssfs == 1:\n ssfs = fs[0]\nelif ssfs == 2:\n ssfs = fs[1]\nelif ssfs == 3:\n ssfs = fs[2]\nelif ssfs == 4:\n ssfs = fs[3]\nelif ssfs == 5:\n ssfs = fs[4]\nhead = {\n 'user-agent':\n 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) \\\n Chrome/80.0.3987.88 Safari/537.36'\n}\nurl = 'https://search.bilibili.com/all?keyword='+ \\\n value +ssfs\ndef geturl(url):\n try:\n a = requests.get(url, headers=head)\n if a.status_code == 200:\n return a.text\n except requests.RequestException:\n return None\nhtml = geturl(url)\nbf = BeautifulSoup(html, 'lxml')\ntitles = bf.find_all(\"div\", class_=\"headline clearfix\")\nbfl = bf.find_all(\"span\", class_=\"so-icon watch-num\")\ndm = bf.find_all(\"span\", class_=\"so-icon hide\")\nhref = re.findall('href=\"//(.*?)\"', str(titles))\nnewt = re.findall('title=\"(.*?)\">', str(titles))\nnewb = re.findall(r'(.*?)', str(bfl), re.S)\nnewdm = re.findall(r'(.*?)', str(dm), re.S)\na = ''\nb = ''\nlent = len(newt)\nfor i in range(lent):\n printf = str(newt[i])\n a = a + printf + '\\n'\n sc = str(i + 1) + printf + \"\\n 播放量\" + str(\n newb[i]) + \" 弹幕\" + '\\t' + str(newdm[i]) + \"\\n链接\" + str(href[i])\n print(sc)\n print(\"------------------------------------------------\")\n b += (sc + \"\\n------------------------------------------------\\n\")\ny = input('是否保存?(y,n)')\nif y == 'y':\n with open(value + str(ssfs) + '.txt', 'w+') as f:\n f.write(b)\n print(\"保存成功!\")\n```\n",
isPublish: true,
allowComment: false,
createdAt: ISODate("2021-05-19T09:18:59.194Z"),
updatedAt: ISODate("2021-06-01T15:01:24.169Z"),
__v: NumberInt("0"),
fieldsId: "60a4d803a14c5f03d4e7d03c",
menus: {
menus: [
{
type: "h1",
target: "#t0",
title: "一级标题123123"
},
{
type: "h2",
target: "#t1",
title: "二级标题"
},
{
type: "h3",
target: "#t2",
title: "三级标题"
},
{
type: "h4",
target: "#t3",
title: "四级标题"
},
{
type: "h5",
target: "#t4",
title: "五级标题"
},
{
type: "h6",
target: "#t5",
title: "六级标题"
},
{
type: "h1",
target: "#t6",
title: "我展示的是一级标题"
},
{
type: "h2",
target: "#t7",
title: "我展示的是二级标题"
},
{
type: "h1",
target: "#t8",
title: "井字号"
}
],
summary: "2021-5-11 20:54:35@[TOC]# 一级标题123123## 二级标题### 三级标题#### 四级标题##### 五级标题###### 六级标题# 我展示的是一级标题## 我展示的是二级标题*斜体文本**斜体文本***粗体文本**"
}
} ]);
db.getCollection("contents").insert([ {
_id: ObjectId("60a8e3ab77535e3424b9591c"),
text: "<html><head></head><body><p>2021-5-11 20:54:35</p>\n<p>@[TOC]</p>\n<h1 id=\"t0\">一级标题123123</h1>\n<h2 id=\"t1\">二级标题</h2>\n<h3 id=\"t2\">三级标题</h3>\n<h4 id=\"t3\">四级标题</h4>\n<h5 id=\"t4\">五级标题</h5>\n<h6 id=\"t5\">六级标题</h6>\n<h1 id=\"t6\">我展示的是一级标题</h1>\n<h2 id=\"t7\">我展示的是二级标题</h2>\n<p><em>斜体文本</em></p>\n<p><em>斜体文本</em></p>\n<p><strong>粗体文本</strong></p>\n<p><strong>粗体文本</strong></p>\n<p><em><strong>粗斜体文本</strong></em></p>\n<p><em><strong>粗斜体文本</strong></em></p>\n<hr>\n<hr>\n<hr>\n<hr>\n<hr>\n<p><a href=\"RUNOOB.COM\">RUNOOB.COM</a></p>\n<p><a href=\"GOOGLE.COM\">GOOGLE.COM</a></p>\n<p>~~<a href=\"BAIDU.COM\">BAIDU.COM</a></p>\n<ul>\n<li>第一项</li>\n<li>第二项</li>\n<li>第三项</li>\n<li>第一项</li>\n<li>第二项</li>\n<li>第三项</li>\n<li>第一项</li>\n<li>第二项</li>\n<li>第三项</li>\n</ul>\n<ol>\n<li>第一项:\n<ul>\n<li>第一项嵌套的第一个元素</li>\n<li>第一项嵌套的第二个元素</li>\n</ul>\n</li>\n<li>第二项:\n<ul>\n<li>第二项嵌套的第一个元素</li>\n<li>第二项嵌套的第二个元素</li>\n</ul>\n</li>\n</ol>\n<blockquote>\n<p>区块引用</p>\n<p>菜鸟教程</p>\n<p>学的不仅是技术更是梦想</p>\n</blockquote>\n<p><code>printf()</code> 函数</p>\n<pre><code class=\"language-javascript\">$(document).ready(function () {\n alert('RUNOOB');\n});\n</code></pre>\n<p>这是一个链接 <a href=\"https://www.runoob.com\">菜鸟教程</a></p>\n<p><a href=\"https://www.runoob.com\">https://www.runoob.com</a></p>\n<p><img src=\"http://static.runoob.com/images/runoob-logo.png\" alt=\"RUNOOB 图标\"></p>\n<table>\n<thead>\n<tr>\n<th>表头</th>\n<th>表头</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>单元格</td>\n<td>单元格</td>\n</tr>\n<tr>\n<td>单元格</td>\n<td>单元格</td>\n</tr>\n</tbody>\n</table>\n<table>\n<thead>\n<tr>\n<th align=\"left\">左对齐</th>\n<th align=\"right\">右对齐</th>\n<th align=\"center\">居中对齐</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"left\">单元格</td>\n<td align=\"right\">单元格</td>\n<td align=\"center\">单元格</td>\n</tr>\n<tr>\n<td align=\"left\">单元格</td>\n<td align=\"right\">单元格</td>\n<td align=\"center\">单元格</td>\n</tr>\n</tbody>\n</table>\n<p>使用 Ctrl+Alt+Del 重启电脑</p>\n<p>\\ 反斜线</p>\n<p>` 反引号</p>\n<ul>\n<li>星号<br>\n_ 下划线<br>\n{} 花括号<br>\n[] 方括号<br>\n() 小括号</li>\n</ul>\n<h1 id=\"t8\">井字号</h1>\n<ul>\n<li>加号</li>\n<li>减号<br>\n. 英文句点<br>\n! 感叹号</li>\n</ul>\n<pre><code class=\"language-c\">//注释测试\n#include \n#include \n#include \n#ifdef _WIN32\n#include \n#include \n#endif\n#include \n\nstruct point\n{\n double x[3];\n};\nstruct edge\n{\n struct point a, b;\n};\nstruct plane\n{\n // k[0]x+k[1]y+k[2]z=d\n double k[3], d;\n};\ntypedef struct point point;\ntypedef struct edge edge;\ntypedef struct plane plane;\n\n#define PI 3.14159265358\npoint cubePoint[8] = {{0.5, 0.5, -0.5}, {0.5, 0.5, 0.5}, {-0.5, 0.5, 0.5}, {-0.5, 0.5, -0.5}, {0.5, -0.5, -0.5}, {0.5, -0.5, 0.5}, {-0.5, -0.5, 0.5}, {-0.5, -0.5, -0.5}};\nint cubePlaneGroup[6][4] = {{0, 1, 5, 4}, {1, 2, 6, 5}, {2, 3, 7, 6}, {3, 0, 4, 7}, {0, 1, 2, 3}, {4, 5, 6, 7}};\nint PlaneNumber[6];\nint table[6][6] = {{2, 4, 5, 3, 1, 6}, {1, 3, 6, 4, 2, 5}, {1, 5, 6, 2, 3, 4}, {2, 6, 5, 1, 4, 3}, {4, 6, 3, 1, 5, 2}, {3, 5, 4, 2, 6, 1}};\ndouble cube2dPoint[8][2];\nint cubeDisplayPoint[8][2];\npoint camera = {2, 1.5, 2};\npoint cameraY = {-2, 2, 2};\nconst double cameraR = 3.5;\ndouble displayPlaneSize = 4;\nconst int displayPixelSize = 30;\n// 终端英文字符宽高比例需要1:2\nconst int displayPixelWidth = 60;\nchar displayBuff[30][60];\ndouble angleA = -PI / 4;\ndouble angleB = PI / 4;\ndouble speed = 0.05;\n\nvoid draw();\n\n#ifndef _WIN32\n#include \n#include \nchar getch()\n{\n char buf = 0;\n struct termios old = {0};\n fflush(stdout);\n if (tcgetattr(0, &old) < 0)\n perror(\"tcsetattr()\");\n old.c_lflag &= ~ICANON; // local modes = Non Canonical mode\n old.c_lflag &= ~ECHO; // local modes = Disable echo.\n old.c_cc[VMIN] = 1; // control chars (MIN value) = 1\n old.c_cc[VTIME] = 0; // control chars (TIME value) = 0 (No time)\n if (tcsetattr(0, TCSANOW, &old) < 0)\n perror(\"tcsetattr ICANON\");\n if (read(0, &buf, 1) < 0)\n perror(\"read()\");\n old.c_lflag |= ICANON; // local modes = Canonical mode\n old.c_lflag |= ECHO; // local modes = Enable echo.\n if (tcsetattr(0, TCSADRAIN, &old) < 0)\n perror(\"tcsetattr ~ICANON\");\n return buf;\n}\n#endif\n\nplane getDisplayPlane()\n{\n double d = 0;\n for (int i = 0; i < 3; i++)\n {\n d += camera.x[i] * camera.x[i];\n }\n return (plane){{camera.x[0], camera.x[1], camera.x[2]}, -d};\n}\n\npoint getDisplayCenter()\n{\n return (point){-camera.x[0], -camera.x[1], -camera.x[2]};\n}\n\npoint getVector(point a, point b)\n{\n return (point){b.x[0] - a.x[0], b.x[1] - a.x[1], b.x[2] - a.x[2]};\n}\n\ndouble innerProduct(point a, point b)\n{\n double res = 0;\n for (int i = 0; i < 3; i++)\n {\n res += a.x[i] * b.x[i];\n }\n return res;\n}\n\npoint crossProduct(point a, point b)\n{\n return (point){a.x[1] * b.x[2] - a.x[2] * b.x[1], a.x[2] * b.x[0] - a.x[0] * b.x[2], a.x[0] * b.x[1] - a.x[1] * b.x[0]};\n}\n\ndouble getLength(point a)\n{\n double sqr = 0;\n for (int i = 0; i < 3; i++)\n {\n sqr += a.x[i] * a.x[i];\n }\n return sqrt(sqr);\n}\n\npoint getPoint(edge a, plane b)\n{\n point res;\n for (int i = 0; i < 3; i++)\n {\n double k = b.k[i];\n double d = b.d;\n for (int j = 0; j < 3; j++)\n {\n if (i != j)\n {\n k += b.k[j] * (a.a.x[j] - a.b.x[j]) / (a.a.x[i] - a.b.x[i]);\n d -= b.k[j] * (a.b.x[j] * a.a.x[i] - a.a.x[j] * a.b.x[i]) / (a.a.x[i] - a.b.x[i]);\n }\n }\n res.x[i] = d / k;\n }\n return res;\n}\n\nvoid initCamera()\n{\n\n camera.x[0] = cos(angleA) * cos(angleB) * cameraR;\n camera.x[1] = sin(angleA) * cameraR;\n camera.x[2] = cos(angleA) * sin(angleB) * cameraR;\n\n cameraY.x[0] = cos(angleA + PI / 2) * cos(angleB) * cameraR;\n cameraY.x[1] = sin(angleA + PI / 2) * cameraR;\n cameraY.x[2] = cos(angleA + PI / 2) * sin(angleB) * cameraR;\n}\n\nvoid drawLine(const int a[2], const int b[2])\n{\n\n if (a[0] == b[0] && a[1] == b[1])\n {\n return;\n }\n int step[2];\n for (int i = 0; i < 2; i++)\n {\n if (a[i] - b[i] > 0)\n {\n step[i] = -1;\n }\n else if (a[i] - b[i] == 0)\n {\n step[i] = 0;\n }\n else\n {\n step[i] = 1;\n }\n }\n if (abs(a[0] - b[0]) > abs(a[1] - b[1]))\n {\n int j = a[1];\n double k = (a[1] - b[1]) * 1.0 / (a[0] - b[0]);\n for (int i = a[0] + step[0]; (b[0] - i) / step[0] > 0; i += step[0])\n {\n if (fabs(1.0 * (j + step[1] - a[1]) / (i - a[0]) - k) < fabs(1.0 * (j - a[1]) / (i - a[0]) - k))\n {\n j += step[1];\n }\n if (displayBuff[i][j] == 0)\n {\n displayBuff[i][j] = '*';\n }\n }\n }\n else\n {\n int j = a[0];\n double k = (a[0] - b[0]) * 1.0 / (a[1] - b[1]);\n for (int i = a[1] + step[1]; (b[1] - i) / step[1] > 0; i += step[1])\n {\n if (fabs(1.0 * (j + step[0] - a[0]) / (i - a[1]) - k) < fabs(1.0 * (j - a[0]) / (i - a[1]) - k))\n {\n j += step[0];\n }\n if (displayBuff[j][i] == 0)\n {\n displayBuff[j][i] = '*';\n }\n }\n }\n}\n\nvoid fswap(double *a, double *b)\n{\n double tmp = *a;\n *a = *b;\n *b = tmp;\n}\n\nvoid fill(int r, int c, char ch)\n{\n if (r < 1 || c < 1 || r >= displayPixelSize || c >= displayPixelWidth)\n {\n return;\n }\n if (displayBuff[r][c] != 0)\n {\n return;\n }\n displayBuff[r][c] = ch;\n fill(r + 1, c, ch);\n fill(r - 1, c, ch);\n fill(r, c + 1, ch);\n fill(r, c - 1, ch);\n}\n\nint sqr(int x)\n{\n return x * 2;\n}\n\nvoid drawCube()\n{\n memset(displayBuff, 0, sizeof(displayBuff));\n double dis[6][2] = {0};\n\n for (int i = 0; i < 6; i++)\n {\n dis[i][0] = i;\n for (int j = 0; j < 4; j++)\n {\n dis[i][1] += getLength(getVector(camera, cubePoint[cubePlaneGroup[i][j]]));\n }\n for (int j = i - 1; j >= 0; j--)\n {\n if (dis[j][1] > dis[j + 1][1])\n {\n fswap(&dis[j][1], &dis[j + 1][1]);\n fswap(&dis[j][0], &dis[j + 1][0]);\n }\n }\n }\n for (int i = 0; i < 6; i++)\n {\n int planeId = (int)dis[i][0];\n int hide = 0;\n int xy[4][2];\n for (int j = 0; j < 4; j++)\n {\n memcpy(xy[j], cubeDisplayPoint[cubePlaneGroup[planeId][j]], sizeof(xy[j]));\n }\n for (int j = 0; j < 4; j++)\n {\n if (displayBuff[xy[j][0]][xy[j][1]] != 0 && displayBuff[xy[j][0]][xy[j][1]] != '+')\n {\n hide = 1;\n }\n }\n if (hide)\n {\n continue;\n }\n\n for (int j = 0; j < 4; j++)\n {\n drawLine(xy[j], xy[(j + 1) % 4]);\n }\n for (int j = 0; j < 4; j++)\n {\n displayBuff[xy[j][0]][xy[j][1]] = '+';\n }\n int center[2];\n if (sqr(xy[0][0] - xy[2][0]) + sqr(xy[0][1] - xy[2][1]) > sqr(xy[1][0] - xy[3][0]) + sqr(xy[1][1] - xy[3][1]))\n {\n center[0] = (xy[0][0] + xy[2][0]) / 2.0 + 0.5;\n center[1] = (xy[0][1] + xy[2][1]) / 2.0 + 0.5;\n }\n else\n {\n center[0] = (xy[1][0] + xy[3][0]) / 2.0 + 0.5;\n center[1] = (xy[1][1] + xy[3][1]) / 2.0 + 0.5;\n }\n fill(center[0], center[1], ' ');\n displayBuff[center[0]][center[1]] = '0' + PlaneNumber[planeId];\n }\n}\n\nvoid randomCast()\n{\n int tableIdx = rand() % 6;\n int offset = rand();\n for (int i = 0; i < 4; i++)\n {\n PlaneNumber[i] = table[tableIdx][(i + offset) % 4];\n }\n for (int i = 4; i < 6; i++)\n {\n PlaneNumber[i] = table[tableIdx][i];\n }\n}\n\nvoid cls()\n{\n#ifdef _WIN32\n COORD pos = {0, 0};\n HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE);\n SetConsoleCursorPosition(out, pos);\n#endif\n#ifndef _WIN32\n printf(\"\\033c\");\n#endif\n}\n\nvoid draw()\n{\n initCamera();\n for (int i = 0; i < 8; i++)\n {\n point p = getPoint((edge){camera, cubePoint[i]}, getDisplayPlane());\n point v = getVector(getDisplayCenter(), p);\n double vlen = getLength(v);\n double cos = innerProduct(v, cameraY) / getLength(cameraY) / vlen;\n double sin = sqrt(fabs(1 - cos * cos));\n int largeThanPi = innerProduct(crossProduct(cameraY, v), camera) < 0;\n double y = cos * vlen;\n double x = -sin * vlen;\n if (largeThanPi)\n {\n x *= -1;\n }\n cube2dPoint[i][0] = x;\n cube2dPoint[i][1] = y;\n cubeDisplayPoint[i][1] = ((x + displayPlaneSize / 2) / displayPlaneSize * displayPixelSize * 2 + 0.5);\n cubeDisplayPoint[i][0] = ((y + displayPlaneSize / 2) / displayPlaneSize * displayPixelSize + 0.5);\n }\n drawCube();\n char output[displayPixelSize * displayPixelSize * 2 + displayPixelSize + 1];\n int idx = 0;\n for (int i = 0; i < displayPixelSize; i++)\n {\n for (int j = 0; j < displayPixelSize * 2; j++)\n {\n if (displayBuff[i][j] == 0)\n {\n displayBuff[i][j] = '.';\n }\n output[idx++] = displayBuff[i][j];\n }\n output[idx++] = '\\n';\n }\n output[idx++] = 0;\n cls();\n printf(\"%s\", output);\n}\nvoid start()\n{\n while (1)\n {\n int key = getch();\n switch (key)\n {\n case 27:\n {\n exit(0);\n }\n case 'w':\n {\n angleA -= speed;\n break;\n }\n case 's':\n {\n angleA += speed;\n break;\n }\n case 'a':\n {\n angleB += speed;\n break;\n }\n case 'd':\n {\n angleB -= speed;\n break;\n }\n case 'r':\n randomCast();\n break;\n };\n draw();\n }\n}\n\nint main()\n{\n#ifdef _WIN32\n system(\"cls\");\n#endif\n srand(time(0));\n randomCast();\n draw();\n start();\n}\n</code></pre>\n<pre><code class=\"language-python\">import requests\nfrom bs4 import BeautifulSoup\nimport re\nvalue = ''\nvalue = str(input('输入搜索标题文字:'))\nif value == '':\n value = \"御坂美琴\"\nprint('''\n------------\n| 1.综合 |\n| 2.播放 |\n| 3.最新 |\n| 4.弹幕 |\n| 5.收藏 |\n------------\n''')\nssfs = 0\n\nssfs = input('请输入排序方式:')\nif ssfs=='':\n ssfs = 2\nfs = [\"\", \"&order=click\", \"&order=pubdate\", \"&order=dm\", \"&order=stow\"]\nif ssfs == 1:\n ssfs = fs[0]\nelif ssfs == 2:\n ssfs = fs[1]\nelif ssfs == 3:\n ssfs = fs[2]\nelif ssfs == 4:\n ssfs = fs[3]\nelif ssfs == 5:\n ssfs = fs[4]\nhead = {\n 'user-agent':\n 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) \\\n Chrome/80.0.3987.88 Safari/537.36'\n}\nurl = 'https://search.bilibili.com/all?keyword='+ \\\n value +ssfs\ndef geturl(url):\n try:\n a = requests.get(url, headers=head)\n if a.status_code == 200:\n return a.text\n except requests.RequestException:\n return None\nhtml = geturl(url)\nbf = BeautifulSoup(html, 'lxml')\ntitles = bf.find_all(\"div\", class_=\"headline clearfix\")\nbfl = bf.find_all(\"span\", class_=\"so-icon watch-num\")\ndm = bf.find_all(\"span\", class_=\"so-icon hide\")\nhref = re.findall('href=\"//(.*?)\"', str(titles))\nnewt = re.findall('title=\"(.*?)\">', str(titles))\nnewb = re.findall(r'(.*?)', str(bfl), re.S)\nnewdm = re.findall(r'(.*?)', str(dm), re.S)\na = ''\nb = ''\nlent = len(newt)\nfor i in range(lent):\n printf = str(newt[i])\n a = a + printf + '\\n'\n sc = str(i + 1) + printf + \"\\n 播放量\" + str(\n newb[i]) + \" 弹幕\" + '\\t' + str(newdm[i]) + \"\\n链接\" + str(href[i])\n print(sc)\n print(\"------------------------------------------------\")\n b += (sc + \"\\n------------------------------------------------\\n\")\ny = input('是否保存?(y,n)')\nif y == 'y':\n with open(value + str(ssfs) + '.txt', 'w+') as f:\n f.write(b)\n print(\"保存成功!\")\n</code></pre>\n</body></html>",
mdText: "2021-5-11 20:54:35\n\n@[TOC]\n\n# 一级标题123123\n\n## 二级标题\n\n### 三级标题\n\n#### 四级标题\n\n##### 五级标题\n\n###### 六级标题\n\n# 我展示的是一级标题\n\n## 我展示的是二级标题\n\n*斜体文本*\n\n*斜体文本*\n\n**粗体文本**\n\n**粗体文本**\n\n***粗斜体文本***\n\n***粗斜体文本***\n\n---\n\n---\n\n---\n\n---\n\n---\n\n[RUNOOB.COM](RUNOOB.COM)\n\n[GOOGLE.COM](GOOGLE.COM)\n\n~~[BAIDU.COM](BAIDU.COM)\n\n* 第一项\n* 第二项\n* 第三项\n* 第一项\n* 第二项\n* 第三项\n* 第一项\n* 第二项\n* 第三项\n\n1. 第一项:\n * 第一项嵌套的第一个元素\n * 第一项嵌套的第二个元素\n2. 第二项:\n * 第二项嵌套的第一个元素\n * 第二项嵌套的第二个元素\n\n> 区块引用\n>\n> 菜鸟教程\n>\n> 学的不仅是技术更是梦想\n\n`printf()` 函数\n\n```javascript\n$(document).ready(function () {\n alert('RUNOOB');\n});\n```\n\n这是一个链接 [菜鸟教程](https://www.runoob.com)\n\n[https://www.runoob.com](https://www.runoob.com)\n\n\n\n\n| 表头 | 表头 |\n| -------- | -------- |\n| 单元格 | 单元格 |\n| 单元格 | 单元格 |\n\n\n| 左对齐 | 右对齐 | 居中对齐 |\n| :------- | -------: | :--------: |\n| 单元格 | 单元格 | 单元格 |\n| 单元格 | 单元格 | 单元格 |\n\n使用 Ctrl+Alt+Del 重启电脑\n\n\\ 反斜线\n\n` 反引号\n\n* 星号\n _ 下划线\n {} 花括号\n [] 方括号\n () 小括号\n\n# 井字号\n\n* 加号\n* 减号\n . 英文句点\n ! 感叹号\n\n```c\n//注释测试\n#include \n#include \n#include \n#ifdef _WIN32\n#include \n#include \n#endif\n#include \n\nstruct point\n{\n double x[3];\n};\nstruct edge\n{\n struct point a, b;\n};\nstruct plane\n{\n // k[0]x+k[1]y+k[2]z=d\n double k[3], d;\n};\ntypedef struct point point;\ntypedef struct edge edge;\ntypedef struct plane plane;\n\n#define PI 3.14159265358\npoint cubePoint[8] = {{0.5, 0.5, -0.5}, {0.5, 0.5, 0.5}, {-0.5, 0.5, 0.5}, {-0.5, 0.5, -0.5}, {0.5, -0.5, -0.5}, {0.5, -0.5, 0.5}, {-0.5, -0.5, 0.5}, {-0.5, -0.5, -0.5}};\nint cubePlaneGroup[6][4] = {{0, 1, 5, 4}, {1, 2, 6, 5}, {2, 3, 7, 6}, {3, 0, 4, 7}, {0, 1, 2, 3}, {4, 5, 6, 7}};\nint PlaneNumber[6];\nint table[6][6] = {{2, 4, 5, 3, 1, 6}, {1, 3, 6, 4, 2, 5}, {1, 5, 6, 2, 3, 4}, {2, 6, 5, 1, 4, 3}, {4, 6, 3, 1, 5, 2}, {3, 5, 4, 2, 6, 1}};\ndouble cube2dPoint[8][2];\nint cubeDisplayPoint[8][2];\npoint camera = {2, 1.5, 2};\npoint cameraY = {-2, 2, 2};\nconst double cameraR = 3.5;\ndouble displayPlaneSize = 4;\nconst int displayPixelSize = 30;\n// 终端英文字符宽高比例需要1:2\nconst int displayPixelWidth = 60;\nchar displayBuff[30][60];\ndouble angleA = -PI / 4;\ndouble angleB = PI / 4;\ndouble speed = 0.05;\n\nvoid draw();\n\n#ifndef _WIN32\n#include \n#include \nchar getch()\n{\n char buf = 0;\n struct termios old = {0};\n fflush(stdout);\n if (tcgetattr(0, &old) < 0)\n perror(\"tcsetattr()\");\n old.c_lflag &= ~ICANON; // local modes = Non Canonical mode\n old.c_lflag &= ~ECHO; // local modes = Disable echo.\n old.c_cc[VMIN] = 1; // control chars (MIN value) = 1\n old.c_cc[VTIME] = 0; // control chars (TIME value) = 0 (No time)\n if (tcsetattr(0, TCSANOW, &old) < 0)\n perror(\"tcsetattr ICANON\");\n if (read(0, &buf, 1) < 0)\n perror(\"read()\");\n old.c_lflag |= ICANON; // local modes = Canonical mode\n old.c_lflag |= ECHO; // local modes = Enable echo.\n if (tcsetattr(0, TCSADRAIN, &old) < 0)\n perror(\"tcsetattr ~ICANON\");\n return buf;\n}\n#endif\n\nplane getDisplayPlane()\n{\n double d = 0;\n for (int i = 0; i < 3; i++)\n {\n d += camera.x[i] * camera.x[i];\n }\n return (plane){{camera.x[0], camera.x[1], camera.x[2]}, -d};\n}\n\npoint getDisplayCenter()\n{\n return (point){-camera.x[0], -camera.x[1], -camera.x[2]};\n}\n\npoint getVector(point a, point b)\n{\n return (point){b.x[0] - a.x[0], b.x[1] - a.x[1], b.x[2] - a.x[2]};\n}\n\ndouble innerProduct(point a, point b)\n{\n double res = 0;\n for (int i = 0; i < 3; i++)\n {\n res += a.x[i] * b.x[i];\n }\n return res;\n}\n\npoint crossProduct(point a, point b)\n{\n return (point){a.x[1] * b.x[2] - a.x[2] * b.x[1], a.x[2] * b.x[0] - a.x[0] * b.x[2], a.x[0] * b.x[1] - a.x[1] * b.x[0]};\n}\n\ndouble getLength(point a)\n{\n double sqr = 0;\n for (int i = 0; i < 3; i++)\n {\n sqr += a.x[i] * a.x[i];\n }\n return sqrt(sqr);\n}\n\npoint getPoint(edge a, plane b)\n{\n point res;\n for (int i = 0; i < 3; i++)\n {\n double k = b.k[i];\n double d = b.d;\n for (int j = 0; j < 3; j++)\n {\n if (i != j)\n {\n k += b.k[j] * (a.a.x[j] - a.b.x[j]) / (a.a.x[i] - a.b.x[i]);\n d -= b.k[j] * (a.b.x[j] * a.a.x[i] - a.a.x[j] * a.b.x[i]) / (a.a.x[i] - a.b.x[i]);\n }\n }\n res.x[i] = d / k;\n }\n return res;\n}\n\nvoid initCamera()\n{\n\n camera.x[0] = cos(angleA) * cos(angleB) * cameraR;\n camera.x[1] = sin(angleA) * cameraR;\n camera.x[2] = cos(angleA) * sin(angleB) * cameraR;\n\n cameraY.x[0] = cos(angleA + PI / 2) * cos(angleB) * cameraR;\n cameraY.x[1] = sin(angleA + PI / 2) * cameraR;\n cameraY.x[2] = cos(angleA + PI / 2) * sin(angleB) * cameraR;\n}\n\nvoid drawLine(const int a[2], const int b[2])\n{\n\n if (a[0] == b[0] && a[1] == b[1])\n {\n return;\n }\n int step[2];\n for (int i = 0; i < 2; i++)\n {\n if (a[i] - b[i] > 0)\n {\n step[i] = -1;\n }\n else if (a[i] - b[i] == 0)\n {\n step[i] = 0;\n }\n else\n {\n step[i] = 1;\n }\n }\n if (abs(a[0] - b[0]) > abs(a[1] - b[1]))\n {\n int j = a[1];\n double k = (a[1] - b[1]) * 1.0 / (a[0] - b[0]);\n for (int i = a[0] + step[0]; (b[0] - i) / step[0] > 0; i += step[0])\n {\n if (fabs(1.0 * (j + step[1] - a[1]) / (i - a[0]) - k) < fabs(1.0 * (j - a[1]) / (i - a[0]) - k))\n {\n j += step[1];\n }\n if (displayBuff[i][j] == 0)\n {\n displayBuff[i][j] = '*';\n }\n }\n }\n else\n {\n int j = a[0];\n double k = (a[0] - b[0]) * 1.0 / (a[1] - b[1]);\n for (int i = a[1] + step[1]; (b[1] - i) / step[1] > 0; i += step[1])\n {\n if (fabs(1.0 * (j + step[0] - a[0]) / (i - a[1]) - k) < fabs(1.0 * (j - a[0]) / (i - a[1]) - k))\n {\n j += step[0];\n }\n if (displayBuff[j][i] == 0)\n {\n displayBuff[j][i] = '*';\n }\n }\n }\n}\n\nvoid fswap(double *a, double *b)\n{\n double tmp = *a;\n *a = *b;\n *b = tmp;\n}\n\nvoid fill(int r, int c, char ch)\n{\n if (r < 1 || c < 1 || r >= displayPixelSize || c >= displayPixelWidth)\n {\n return;\n }\n if (displayBuff[r][c] != 0)\n {\n return;\n }\n displayBuff[r][c] = ch;\n fill(r + 1, c, ch);\n fill(r - 1, c, ch);\n fill(r, c + 1, ch);\n fill(r, c - 1, ch);\n}\n\nint sqr(int x)\n{\n return x * 2;\n}\n\nvoid drawCube()\n{\n memset(displayBuff, 0, sizeof(displayBuff));\n double dis[6][2] = {0};\n\n for (int i = 0; i < 6; i++)\n {\n dis[i][0] = i;\n for (int j = 0; j < 4; j++)\n {\n dis[i][1] += getLength(getVector(camera, cubePoint[cubePlaneGroup[i][j]]));\n }\n for (int j = i - 1; j >= 0; j--)\n {\n if (dis[j][1] > dis[j + 1][1])\n {\n fswap(&dis[j][1], &dis[j + 1][1]);\n fswap(&dis[j][0], &dis[j + 1][0]);\n }\n }\n }\n for (int i = 0; i < 6; i++)\n {\n int planeId = (int)dis[i][0];\n int hide = 0;\n int xy[4][2];\n for (int j = 0; j < 4; j++)\n {\n memcpy(xy[j], cubeDisplayPoint[cubePlaneGroup[planeId][j]], sizeof(xy[j]));\n }\n for (int j = 0; j < 4; j++)\n {\n if (displayBuff[xy[j][0]][xy[j][1]] != 0 && displayBuff[xy[j][0]][xy[j][1]] != '+')\n {\n hide = 1;\n }\n }\n if (hide)\n {\n continue;\n }\n\n for (int j = 0; j < 4; j++)\n {\n drawLine(xy[j], xy[(j + 1) % 4]);\n }\n for (int j = 0; j < 4; j++)\n {\n displayBuff[xy[j][0]][xy[j][1]] = '+';\n }\n int center[2];\n if (sqr(xy[0][0] - xy[2][0]) + sqr(xy[0][1] - xy[2][1]) > sqr(xy[1][0] - xy[3][0]) + sqr(xy[1][1] - xy[3][1]))\n {\n center[0] = (xy[0][0] + xy[2][0]) / 2.0 + 0.5;\n center[1] = (xy[0][1] + xy[2][1]) / 2.0 + 0.5;\n }\n else\n {\n center[0] = (xy[1][0] + xy[3][0]) / 2.0 + 0.5;\n center[1] = (xy[1][1] + xy[3][1]) / 2.0 + 0.5;\n }\n fill(center[0], center[1], ' ');\n displayBuff[center[0]][center[1]] = '0' + PlaneNumber[planeId];\n }\n}\n\nvoid randomCast()\n{\n int tableIdx = rand() % 6;\n int offset = rand();\n for (int i = 0; i < 4; i++)\n {\n PlaneNumber[i] = table[tableIdx][(i + offset) % 4];\n }\n for (int i = 4; i < 6; i++)\n {\n PlaneNumber[i] = table[tableIdx][i];\n }\n}\n\nvoid cls()\n{\n#ifdef _WIN32\n COORD pos = {0, 0};\n HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE);\n SetConsoleCursorPosition(out, pos);\n#endif\n#ifndef _WIN32\n printf(\"\\033c\");\n#endif\n}\n\nvoid draw()\n{\n initCamera();\n for (int i = 0; i < 8; i++)\n {\n point p = getPoint((edge){camera, cubePoint[i]}, getDisplayPlane());\n point v = getVector(getDisplayCenter(), p);\n double vlen = getLength(v);\n double cos = innerProduct(v, cameraY) / getLength(cameraY) / vlen;\n double sin = sqrt(fabs(1 - cos * cos));\n int largeThanPi = innerProduct(crossProduct(cameraY, v), camera) < 0;\n double y = cos * vlen;\n double x = -sin * vlen;\n if (largeThanPi)\n {\n x *= -1;\n }\n cube2dPoint[i][0] = x;\n cube2dPoint[i][1] = y;\n cubeDisplayPoint[i][1] = ((x + displayPlaneSize / 2) / displayPlaneSize * displayPixelSize * 2 + 0.5);\n cubeDisplayPoint[i][0] = ((y + displayPlaneSize / 2) / displayPlaneSize * displayPixelSize + 0.5);\n }\n drawCube();\n char output[displayPixelSize * displayPixelSize * 2 + displayPixelSize + 1];\n int idx = 0;\n for (int i = 0; i < displayPixelSize; i++)\n {\n for (int j = 0; j < displayPixelSize * 2; j++)\n {\n if (displayBuff[i][j] == 0)\n {\n displayBuff[i][j] = '.';\n }\n output[idx++] = displayBuff[i][j];\n }\n output[idx++] = '\\n';\n }\n output[idx++] = 0;\n cls();\n printf(\"%s\", output);\n}\nvoid start()\n{\n while (1)\n {\n int key = getch();\n switch (key)\n {\n case 27:\n {\n exit(0);\n }\n case 'w':\n {\n angleA -= speed;\n break;\n }\n case 's':\n {\n angleA += speed;\n break;\n }\n case 'a':\n {\n angleB += speed;\n break;\n }\n case 'd':\n {\n angleB -= speed;\n break;\n }\n case 'r':\n randomCast();\n break;\n };\n draw();\n }\n}\n\nint main()\n{\n#ifdef _WIN32\n system(\"cls\");\n#endif\n srand(time(0));\n randomCast();\n draw();\n start();\n}\n```\n\n```python\nimport requests\nfrom bs4 import BeautifulSoup\nimport re\nvalue = ''\nvalue = str(input('输入搜索标题文字:'))\nif value == '':\n value = \"御坂美琴\"\nprint('''\n------------\n| 1.综合 |\n| 2.播放 |\n| 3.最新 |\n| 4.弹幕 |\n| 5.收藏 |\n------------\n''')\nssfs = 0\n\nssfs = input('请输入排序方式:')\nif ssfs=='':\n ssfs = 2\nfs = [\"\", \"&order=click\", \"&order=pubdate\", \"&order=dm\", \"&order=stow\"]\nif ssfs == 1:\n ssfs = fs[0]\nelif ssfs == 2:\n ssfs = fs[1]\nelif ssfs == 3:\n ssfs = fs[2]\nelif ssfs == 4:\n ssfs = fs[3]\nelif ssfs == 5:\n ssfs = fs[4]\nhead = {\n 'user-agent':\n 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) \\\n Chrome/80.0.3987.88 Safari/537.36'\n}\nurl = 'https://search.bilibili.com/all?keyword='+ \\\n value +ssfs\ndef geturl(url):\n try:\n a = requests.get(url, headers=head)\n if a.status_code == 200:\n return a.text\n except requests.RequestException:\n return None\nhtml = geturl(url)\nbf = BeautifulSoup(html, 'lxml')\ntitles = bf.find_all(\"div\", class_=\"headline clearfix\")\nbfl = bf.find_all(\"span\", class_=\"so-icon watch-num\")\ndm = bf.find_all(\"span\", class_=\"so-icon hide\")\nhref = re.findall('href=\"//(.*?)\"', str(titles))\nnewt = re.findall('title=\"(.*?)\">', str(titles))\nnewb = re.findall(r'(.*?)', str(bfl), re.S)\nnewdm = re.findall(r'(.*?)', str(dm), re.S)\na = ''\nb = ''\nlent = len(newt)\nfor i in range(lent):\n printf = str(newt[i])\n a = a + printf + '\\n'\n sc = str(i + 1) + printf + \"\\n 播放量\" + str(\n newb[i]) + \" 弹幕\" + '\\t' + str(newdm[i]) + \"\\n链接\" + str(href[i])\n print(sc)\n print(\"------------------------------------------------\")\n b += (sc + \"\\n------------------------------------------------\\n\")\ny = input('是否保存?(y,n)')\nif y == 'y':\n with open(value + str(ssfs) + '.txt', 'w+') as f:\n f.write(b)\n print(\"保存成功!\")\n```\n",
isPublish: true,
allowComment: false,
createdAt: ISODate("2021-05-22T10:57:47.747Z"),
updatedAt: ISODate("2021-06-01T14:57:20.935Z"),
__v: NumberInt("0"),
fieldsId: "60a8e3ab77535e3424b9591d",
menus: {
menus: [
{
type: "h1",
target: "#t0",
title: "一级标题123123"
},
{
type: "h2",
target: "#t1",
title: "二级标题"
},
{
type: "h3",
target: "#t2",
title: "三级标题"
},
{
type: "h4",
target: "#t3",
title: "四级标题"
},
{
type: "h5",
target: "#t4",
title: "五级标题"
},
{
type: "h6",
target: "#t5",
title: "六级标题"
},
{
type: "h1",
target: "#t6",
title: "我展示的是一级标题"
},
{
type: "h2",
target: "#t7",
title: "我展示的是二级标题"
},
{
type: "h1",
target: "#t8",
title: "井字号"
}
],
summary: "2021-5-11 20:54:35@[TOC]# 一级标题123123## 二级标题### 三级标题#### 四级标题##### 五级标题###### 六级标题# 我展示的是一级标题## 我展示的是二级标题*斜体文本**斜体文本***粗体文本**"
}
} ]);
// ----------------------------
// Collection structure for fields
// ----------------------------
db.getCollection("fields").drop();
db.createCollection("fields");
db.getCollection("fields").createIndex({
title: NumberInt("1")
}, {
name: "标题",
weights: {
title: NumberInt("1")
},
"default_language": "english",
"language_override": "language",
textIndexVersion: NumberInt("3")
});
// ----------------------------
// Documents of fields
// ----------------------------
db.getCollection("fields").insert([ {
_id: ObjectId("603e645cdc5d115e3c5071a3"),
tag: [
ObjectId("603befa8b139000093003433"),
ObjectId("603bec07b139000093003432")
],
contentsId: ObjectId("603e751045d89d46e830734a"),
title: "标题",
cover: "http://tva1.sinaimg.cn/large/005NWBIgly1gnuiuahnd5j30nk0xce04.jpg",
coverSmall: "http://tva1.sinaimg.cn/large/005NWBIgly1gnjj15c5fsj30w20xc4gt.jpg",
classification: ObjectId("6039284a2684e22ec8291c64"),
createdAt: ISODate("2018-01-22T11:25:06.000Z"),
updatedAt: ISODate("2021-06-01T15:30:32.352Z"),
__v: NumberInt("0"),
commentsNum: 124,
isDraft: false,
view: 1
} ]);
db.getCollection("fields").insert([ {
_id: ObjectId("603e645edc5d115e3c5071a4"),
tag: [
ObjectId("603befa8b139000093003433"),
ObjectId("603bec07b139000093003432")
],
contentsId: ObjectId("603e756b45d89d46e830734b"),
title: "标题",
cover: "http://tva1.sinaimg.cn/large/005NWBIgly1gnuiuahnd5j30nk0xce04.jpg",
coverSmall: "http://tva1.sinaimg.cn/large/005NWBIgly1gnuiuahnd5j30nk0xce04.jpg",
classification: ObjectId("6039284a2684e22ec8291c64"),
createdAt: ISODate("2018-01-22T11:25:06.000Z"),
updatedAt: ISODate("2021-06-01T15:30:35.03Z"),
__v: NumberInt("0"),
commentsNum: 123,
isDraft: false,
view: 1
} ]);
db.getCollection("fields").insert([ {
_id: ObjectId("603e645fdc5d115e3c5071a5"),
tag: [
ObjectId("603befa8b139000093003433"),
ObjectId("603bec07b139000093003432")
],
contentsId: ObjectId("603e76d0700bde471cfe5f20"),
title: "标题",
cover: "http://tva1.sinaimg.cn/large/005NWBIgly1gnuiuahnd5j30nk0xce04.jpg",
coverSmall: "http://tva1.sinaimg.cn/large/005NWBIgly1gnuiuahnd5j30nk0xce04.jpg",
classification: ObjectId("6039284a2684e22ec8291c64"),
createdAt: ISODate("2018-01-22T11:25:06.000Z"),
updatedAt: ISODate("2021-06-01T15:30:37.339Z"),
__v: NumberInt("0"),
commentsNum: 123,
isDraft: false,
view: 1
} ]);
db.getCollection("fields").insert([ {
_id: ObjectId("603e645fdc5d115e3c5071a6"),
tag: [
ObjectId("603befa8b139000093003433"),
ObjectId("603bec07b139000093003432")
],
contentsId: ObjectId("603e76d0700bde471cfe5f21"),
title: "标题",
cover: "http://tva1.sinaimg.cn/large/005NWBIgly1gnz4ieffuxj30i00prhdt.jpg",
coverSmall: "http://tva1.sinaimg.cn/large/005NWBIgly1gnz4ieffuxj30i00prhdt.jpg",
classification: ObjectId("6039284a2684e22ec8291c64"),
createdAt: ISODate("2018-01-22T11:25:06.000Z"),
updatedAt: ISODate("2021-06-01T15:30:39.592Z"),
__v: NumberInt("0"),
commentsNum: 123,
isDraft: false,
view: 1
} ]);
db.getCollection("fields").insert([ {
_id: ObjectId("603e6460dc5d115e3c5071a7"),
tag: [
ObjectId("603befa8b139000093003433"),
ObjectId("603bec07b139000093003432")
],
contentsId: ObjectId("603e76d1700bde471cfe5f22"),
title: "标题",
cover: "http://tva1.sinaimg.cn/large/005NWBIgly1gnz4ieffuxj30i00prhdt.jpg",
coverSmall: "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2917876506,2101419022&fm=26&gp=0.jpg",
classification: ObjectId("6039284a2684e22ec8291c64"),
createdAt: ISODate("2019-02-27T05:29:28.000Z"),
updatedAt: ISODate("2021-06-01T15:30:41.774Z"),
__v: NumberInt("0"),
commentsNum: 123,
isDraft: false,
view: 1
} ]);
db.getCollection("fields").insert([ {
_id: ObjectId("603e6460dc5d115e3c5071a9"),
tag: [
ObjectId("603befa8b139000093003433"),
ObjectId("603bec07b139000093003432")
],
contentsId: ObjectId("603e76d1700bde471cfe5f24"),
title: "标题",
cover: "http://tva1.sinaimg.cn/large/005NWBIgly1gnz4ieffuxj30i00prhdt.jpg",
coverSmall: "http://fp1.fghrsh.net/2021/02/11/9b86f781ed016c5f66bf0334bf6eeb57.jpg",
classification: ObjectId("6039284a2684e22ec8291c64"),
createdAt: ISODate("2019-02-27T05:29:28.000Z"),