Commit graph

12 commits

Author SHA1 Message Date
Dax
fcbeaf3114 [Tweets] Fix tweet age calc for TZ!=UTC
dt is a naive datetime object, so its timezone is assumed to be the system timezone. However, the actual timezone from the API is UTC. Therefore, we need to set tzinfo before doing the calculation. See the note at https://docs.python.org/3/library/datetime.html#datetime.datetime.timestamp for more info.

Ideally this would be fixed in tweepy, but there's a report of this on forums from 7 years ago so let's just fix it in BitBot.

This bug found by an anonymous contributor. Thank you 😺!
2020-11-05 06:00:45 +00:00
jesopo
49d9cbdb87 exports.get_one() -> exports.get() 2020-03-08 14:14:00 +00:00
jesopo
8f9c063114 only do to_pretty_time as relative when requested 2020-02-24 10:18:55 +00:00
jesopo
d0d5cc4d08 split utils.datetime out in to .parse and .format 2020-01-30 21:20:56 +00:00
jesopo
a4e827cbb5 switch tweets to use utils.datetime.to_pretty_time() 2020-01-28 15:31:49 +00:00
jesopo
5d01db8514 move all datetime-related code from utils/__init__ to utils.datetime 2019-11-15 13:59:09 +00:00
jesopo
0331b763ff refactor multi-line-to-line normalisation to utils.parse.line_normalise(), use it in rss.py
closes #174
2019-10-10 10:33:18 +01:00
jesopo
5aba3f509e format multi-line tweets on a single line using things like double spaces 2019-10-09 15:35:20 +01:00
jesopo
1b3ee1cb89 only show twitter url when one was not provided initially 2019-10-08 14:21:15 +01:00
jesopo
5b1b26160a use "extended" tweet mode so long tweets are not truncated 2019-07-15 14:27:37 +01:00
jesopo
12181bfec6 Add system to have multiple url shorteners and chose which to use 2019-06-25 17:53:00 +01:00
jesopo
76b268e60e Switch to using tweepy for tweets module 2019-05-27 14:52:08 +01:00