File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
2
import argparse
3
3
import json
4
+ import re
4
5
import sys
5
6
from pathlib import Path
6
7
43
44
for ii in content .splitlines ()
44
45
if not any (ii .startswith (char ) for char in skip_lines )
45
46
)
47
+
46
48
N_WORDS = 50
47
- words = " " .join (content .split (" " )[:N_WORDS ])
49
+ content_no_links = re .sub (r"\[([^\]]+)\]\([^)]+\)" , r"\1" , content )
50
+ content_no_bold = re .sub (r"\*\*" , "" , content_no_links )
51
+ words = " " .join (content_no_bold .split (" " )[:N_WORDS ])
52
+
48
53
if "author" not in meta :
49
54
meta ["author" ] = "Project Pythia Team"
50
55
meta ["content" ] = meta .get ("description" , words )
51
56
posts .append (meta )
52
57
posts = pd .DataFrame (posts )
53
- posts ["date" ] = pd .to_datetime (posts ["date" ])
58
+ posts ["date" ] = pd .to_datetime (posts ["date" ]). dt . tz_localize ( "UTC" )
54
59
posts = posts .dropna (subset = ["date" ])
55
60
posts = posts .sort_values ("date" , ascending = False )
56
61
You can’t perform that action at this time.
0 commit comments