-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCompare.py
38 lines (34 loc) · 1.17 KB
/
Compare.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import Youtuber
class Compare():
def __init__(self, yt1, yt2):
self.youtubers = [yt1, yt2]
def CalculateViewDiff(self):
yt1 = self.youtubers[0].getTotalViews()
yt2 = self.youtubers[1].getTotalViews()
if yt1 < yt2:
return self.youtubers[1].getChannelID(), yt2-yt1
elif yt1 > yt2:
return self.youtubers[0].getChannelID(), yt1-yt2
else:
return "same" , 0
def CalculateSubscriberDiff(self):
yt1 = self.youtubers[0].getTotalSubscribers()
yt2 = self.youtubers[1].getTotalSubscribers()
if yt1 < yt2:
return self.youtubers[1].getChannelID(), yt2-yt1
elif yt1 > yt2:
return self.youtubers[0].getChannelID(), yt1-yt2
else:
return "same", 0
def CalculateVideoDiff(self):
yt1 = self.youtubers[0].getTotalVideos()
yt2 = self.youtubers[1].getTotalVideos()
if yt1 < yt2:
return self.youtubers[1].getChannelID(), yt2-yt1
elif yt1 > yt2:
return self.youtubers[0].getChannelID(), yt1-yt2
else:
return same, 0