Compare commits
2 Commits
3ca58b2466
...
b60bb22112
Author | SHA1 | Date | |
---|---|---|---|
b60bb22112 | |||
654769b80b |
@ -9,7 +9,7 @@ path = 'channels/'
|
|||||||
os.chdir(path)
|
os.chdir(path)
|
||||||
|
|
||||||
def getTimestampFromDateString(dateString):
|
def getTimestampFromDateString(dateString):
|
||||||
return int(time.mktime(datetime.datetime.strptime(dateString, "%Y-%m-%dT%H:%M:%SZ").timetuple()))
|
return int(time.mktime(datetime.datetime.strptime(dateString, '%Y-%m-%dT%H:%M:%SZ').timetuple()))
|
||||||
|
|
||||||
for channelId in list(os.walk('.'))[1]:
|
for channelId in list(os.walk('.'))[1]:
|
||||||
channelId = channelId[2:]
|
channelId = channelId[2:]
|
||||||
@ -26,8 +26,7 @@ for channelId in list(os.walk('.'))[1]:
|
|||||||
snippet = snippet['topLevelComment']['snippet']
|
snippet = snippet['topLevelComment']['snippet']
|
||||||
latestTreatedCommentDate = snippet['publishedAt']
|
latestTreatedCommentDate = snippet['publishedAt']
|
||||||
url = f'https://yt.lemnoslife.com/noKey/channels?part=snippet&id={channelId}'
|
url = f'https://yt.lemnoslife.com/noKey/channels?part=snippet&id={channelId}'
|
||||||
content = requests.get(url).text
|
data = requests.get(url).json()
|
||||||
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. 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.
|
# 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.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
import os, requests, json
|
import os, requests
|
||||||
|
|
||||||
channelIds = [channelId.replace('.zip', '') for channelId in next(os.walk('channels/'))[2]]
|
channelIds = [channelId.replace('.zip', '') for channelId in next(os.walk('channels/'))[2]]
|
||||||
maxResults = 50
|
maxResults = 50
|
||||||
@ -11,8 +11,7 @@ mostSubscriberChannel = None
|
|||||||
|
|
||||||
for channelIds in channelIdsChunks:
|
for channelIds in channelIdsChunks:
|
||||||
url = 'https://yt.lemnoslife.com/noKey/channels?part=statistics&id=' + ','.join(channelIds)
|
url = 'https://yt.lemnoslife.com/noKey/channels?part=statistics&id=' + ','.join(channelIds)
|
||||||
content = requests.get(url).text
|
data = requests.get(url).json()
|
||||||
data = json.loads(content)
|
|
||||||
items = data['items']
|
items = data['items']
|
||||||
for item in items:
|
for item in items:
|
||||||
subscriberCount = int(item['statistics']['subscriberCount'])
|
subscriberCount = int(item['statistics']['subscriberCount'])
|
||||||
|
Loading…
Reference in New Issue
Block a user