Add a note about the timing percentage of findLatestTreatedCommentsForChannelsBeingTreated.py going backward

This commit is contained in:
Benjamin Loison 2023-01-07 15:35:12 +01:00
parent 71e4bd95a9
commit 3758405f52
Signed by: Benjamin_Loison
SSH Key Fingerprint: SHA256:BtnEgYTlHdOg1u+RmYcDE0mnfz1rhv5dSbQ2gyxW8B8

View File

@ -26,7 +26,7 @@ for channelId in list(os.walk('.'))[1]:
data = json.loads(content) data = json.loads(content)
channelCreationDate = data['items'][0]['snippet']['publishedAt'] channelCreationDate = data['items'][0]['snippet']['publishedAt']
#print(channelCreationDate) #print(channelCreationDate)
# Timing percentage not taking into account the not uniform in time distribution of comments. # Timing percentage not taking into account the not uniform in time distribution of comments. Note that in the case of the last request is to list replies to a comment, the percentage might goes a bit backward, as replies are posted after the initial comment.
currentTimestamp = int(time.time()) currentTimestamp = int(time.time())
timingPercentage = round(100 * (currentTimestamp - getTimestampFromDateString(latestTreatedCommentDate)) / (currentTimestamp - getTimestampFromDateString(channelCreationDate)), 3) timingPercentage = round(100 * (currentTimestamp - getTimestampFromDateString(latestTreatedCommentDate)) / (currentTimestamp - getTimestampFromDateString(channelCreationDate)), 3)
print(f'{channelId} {latestTreatedCommentDate} / {channelCreationDate} ({timingPercentage}%)') print(f'{channelId} {latestTreatedCommentDate} / {channelCreationDate} ({timingPercentage}%)')