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 11#!/usr/bin/env python3
22import argparse
33import json
4+ import re
45import sys
56from pathlib import Path
67
4344 for ii in content .splitlines ()
4445 if not any (ii .startswith (char ) for char in skip_lines )
4546 )
47+
4648 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+
4853 if "author" not in meta :
4954 meta ["author" ] = "Project Pythia Team"
5055 meta ["content" ] = meta .get ("description" , words )
5156 posts .append (meta )
5257posts = pd .DataFrame (posts )
53- posts ["date" ] = pd .to_datetime (posts ["date" ])
58+ posts ["date" ] = pd .to_datetime (posts ["date" ]). dt . tz_localize ( "UTC" )
5459posts = posts .dropna (subset = ["date" ])
5560posts = posts .sort_values ("date" , ascending = False )
5661
You can’t perform that action at this time.
0 commit comments