mirror of
https://github.com/tcsenpai/mysides.git
synced 2025-06-06 19:15:23 +00:00
Added archiver
This commit is contained in:
parent
e6e6e29b9e
commit
7f3f153429
11
archiver.sh
Executable file
11
archiver.sh
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
DSTRING=$(date +%F)
|
||||||
|
# first, strip underscores
|
||||||
|
CLEAN=${DSTRING//_/}
|
||||||
|
# next, replace spaces with underscores
|
||||||
|
CLEAN=${CLEAN// /_}
|
||||||
|
# now, clean out anything that's not alphanumeric or an underscore
|
||||||
|
CLEAN=${CLEAN//[^a-zA-Z0-9_]/}
|
||||||
|
# finally, lowercase with TR
|
||||||
|
CLEAN=`echo -n $CLEAN | tr A-Z a-z`
|
||||||
|
cp allsides.html archive/$CLEAN.html
|
3
main.py
3
main.py
@ -116,6 +116,9 @@ def main():
|
|||||||
with open("allsides.html", "w+") as f:
|
with open("allsides.html", "w+") as f:
|
||||||
f.write(html)
|
f.write(html)
|
||||||
|
|
||||||
|
# Archiving (skip if causes errors)
|
||||||
|
os.system("./archiver.sh")
|
||||||
|
|
||||||
print("Total articles: ", len(all_data))
|
print("Total articles: ", len(all_data))
|
||||||
# Do some math to find the number of articles per bias rating
|
# Do some math to find the number of articles per bias rating
|
||||||
bias_ratings = {}
|
bias_ratings = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user