-
Notifications
You must be signed in to change notification settings - Fork 1
/
global_context.py
125 lines (104 loc) · 2.69 KB
/
global_context.py
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
import time
from colorist import ColorRGB
CURRENT_PROJECT = 'qian-wu-blog'
PATH_TO_LINKS = './res/sitemaplinks/links.txt'
PATH_TO_POSTS = './res/posts'
PATH_TO_MDPOSTS = './res/md_posts'
# префікс для генератора MD. Працює в обі сторони
MD_PREFIX = ''
# звідки брати пости для трансформації в markdown, яку дату сетати їм, куди зберігати
# MD_SET_DATE = time.strftime("%Y-%m-%d")
MD_SET_DATE = '2023-05-21'
POSTS_TO_MD = PATH_TO_POSTS + MD_PREFIX + "/" + MD_SET_DATE + "/"
# чи фетчити без тегів
FETCH_NO_TAGS = False
# ліміт по словам для фільтрації
MIN_WORDS_LIMIT = 250
MAX_WORDS_LIMIT = 9000
# скільки разів пінгувати при обриві відповіді chatGPT. Оптимально - від 2 до 4, щоб виключити 0
MAX_PING_TRIES = 3
TITLE_SELECTOR = 'h1'
DEL_PHRASES = [
"Thank you for reading this article.",
"Thank you for reading this article!",
"Thank you for reading this article!!",
"Thank you for reading this article",
"Thank you for reading this blog.",
"Thank you for reading this blog!",
"Thank you for reading this blog!!",
"Thank you for reading this blog",
"Thank you.",
"Thank you",
"Thank you.",
"<p>Press<Enter>. </p>",
"<p>Press Enter\>. </p>",
"<p>Press Enter>. </p>",
"<p>Press<Enter>. </p>",
"<p>Press\<Enter\>. </p>",
"<span>css</span>",
"<span>vbnet</span>",
"Happy coding!",
"vbnet Copy code",
"css Copy code",
"less Copy code",
"python Copy code",
"javascript Copy code",
"php Copy code",
"vbnet Copy code",
"vbnet\nCopy code",
"css\nCopy code",
"less\nCopy code",
"python\nCopy code",
"javascript\nCopy code",
"php\nCopy code",
"vbnet\nCopy code",
"vbnet\n Copy code",
"css\n Copy code",
"less\n Copy code",
"python\n Copy code",
"javascript\n Copy code",
"php\n Copy code",
"vbnet\n Copy code",
]
DEL_CLASS = [
"itemhead",
"ml-auto",
]
DEL_TAGS = [
"h6",
"u",
"script",
"footer",
"iframe",
"img",
"bloquote",
"figure",
"audio",
"video",
"svg",
"form",
"textarea",
"input",
"noscript",
"button",
"progress",
"style"]
STRIP_TAGS = [
"a",
"span",
"article",
"section",
"header",
"html",
"head",
"body",
"main",
"div",
"strong",
"tt",
"i",]
MD_PROPS = ['layout: post']
C_RED = ColorRGB(222, 79, 84)
C_GREEN = ColorRGB(121, 220, 154)
C_BLUE = ColorRGB(114, 159, 207)
TODAY_DATE = time.strftime("%Y-%m-%d")