From 17430a06a9b9038c5905229429aa9d3ceca06338 Mon Sep 17 00:00:00 2001 From: rugantio Date: Tue, 29 Jan 2019 22:26:01 +0100 Subject: [PATCH] fixed datetime parser --- .gitignore | 3 +++ .~lock.trump.csv# | 1 + fbcrawl/__pycache__/items.cpython-37.pyc | Bin 2920 -> 3002 bytes fbcrawl/items.py | 5 ++--- 4 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 .~lock.trump.csv# diff --git a/.gitignore b/.gitignore index 61f2dc9..6bdbbfe 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ **/__pycache__/ + + .* +!.gitignore diff --git a/.~lock.trump.csv# b/.~lock.trump.csv# new file mode 100644 index 0000000..3c69793 --- /dev/null +++ b/.~lock.trump.csv# @@ -0,0 +1 @@ +,rugantio,alice,29.01.2019 22:19,file:///home/rugantio/.config/libreoffice/4; \ No newline at end of file diff --git a/fbcrawl/__pycache__/items.cpython-37.pyc b/fbcrawl/__pycache__/items.cpython-37.pyc index f42abddab7542bfdcadb9a5570e3e8797bd99692..faccde44181ae5bdd2f7b1829b9c6e59a4a71833 100644 GIT binary patch delta 363 zcmaDMwo9DXiI7>o4~Iwvp|Md8pZ z%NR9z52K}i3)D_#uwEFC1;i`b0Fnc_0_Y~Ne9?xH-Ys-8`rz$77; zcL3su1)K{RCNLFgK$O6EKqcnFb0CI+#8RYyTA7OGOuogWC|Og(R>NMyA;Dn5P|KDl zSHn@mp3MT3UA9?-*^Pk+FR9d=3sK#;(aLxOTHTS0{}jTWqAMq delta 292 zcmdlb{z8n`iIihS1}K`s3{qVTo#N-1^yn>8Hw;(bLI2SSi?Y;$+F&FlOm;n+? zkpk*qD)O7G!K^5$SHo7rUc({5V8Kw!mM2%kQNy0i0+fx|oW$(L#1qBhnOc;2i!tLD zqt)astOprOCYP~!F|qqhKE^hWv2=4Pdp9Fv#paJ3988SelYepTX3gYa<`4z|ag|Y6 diff --git a/fbcrawl/items.py b/fbcrawl/items.py index c07d25c..11c6be3 100644 --- a/fbcrawl/items.py +++ b/fbcrawl/items.py @@ -74,9 +74,8 @@ def parse_date(date): if len(date) == 0: return 'Error: no data' - #no check for today - #elif len(date) == 1 or date[1] == 'h': - #pass + elif len(date) == 2 and date[1] == 'h' and int(str(datetime.now().time()).split(sep=':')[0]) - int(date[0]) >= 0: + pass #yesterday elif date[0] == 'Ieri' or (date[1] == 'h' and int(str(datetime.now().time()).split(sep=':')[0]) - int(date[0]) < 0):