mirror of
https://github.com/sys-nyx/red-arch.git
synced 2025-05-06 08:45:31 -04:00
styled search, had to modify several templates to ponit to it correctly
This commit is contained in:
parent
2d105f25c4
commit
8003b64c9f
11 changed files with 496 additions and 47 deletions
|
@ -5,6 +5,7 @@ import json
|
|||
import argparse
|
||||
import configparser
|
||||
from lunr import lunr
|
||||
from datetime import datetime
|
||||
from urllib.parse import urlparse
|
||||
from write_html import generate_html
|
||||
from watchful import return_redd_objects
|
||||
|
@ -52,7 +53,9 @@ def get_thread_meta(thread: dict) -> dict:
|
|||
'score': thread['score'],
|
||||
'replies': str(len(thread['comments'])),
|
||||
'body_short': thread['selftext'][:200],
|
||||
'date': thread['created_utc'],
|
||||
'date': datetime.utcfromtimestamp(int(thread['created_utc'])).strftime('%Y-%m-%d'),
|
||||
'author': thread['author'],
|
||||
'subreddit': thread['subreddit']
|
||||
}
|
||||
|
||||
|
||||
|
@ -63,7 +66,8 @@ def get_comment_meta(comment: dict) -> dict:
|
|||
'title': comment['title'],
|
||||
'score': comment['score'],
|
||||
'body_short': comment['selftext'][:200],
|
||||
'date': comment['created_utc'],
|
||||
'date': datetime.utcfromtimestamp(int(comment['created_utc'])).strftime('%Y-%m-%d'),
|
||||
'author': comment['author']
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue