moda20 / facebook-scraper

Scrape Facebook public pages without an API key
MIT License
60 stars 23 forks source link

parse_datetime for post within 24 hour #37

Open Raymondkltse opened 4 months ago

Raymondkltse commented 4 months ago

the code look for the aabr element inside a post/comment. somehow for post recently added (within 24 hour) the aabr shown as example: 1 hour ago 34 minutes ago 20 hrs

there is a missing ago in the last example, and also the parse_datetime would do the 1 hour ago by assuming now at today midnight.

Raymondkltse commented 4 months ago

my workaround now to replace the following code in utils.py

settings = {
    #'RELATIVE_BASE': datetime.today().replace(minute=0, hour=0, second=0, microsecond=0)
    'RELATIVE_BASE': datetime.now()
}
moda20 commented 4 months ago

@Raymondkltse can you create a PR for that ?

KazimierzLipski commented 1 month ago

Thanks for the fix :)