Add compare algorithm for newest method
This commit is contained in:
parent
2860cd8800
commit
b78fc7cd6b
25
compare.py
25
compare.py
@ -2,7 +2,12 @@
|
|||||||
#
|
#
|
||||||
# Ferit Yiğit BALABAN <fyb@duck.com>, 2022
|
# Ferit Yiğit BALABAN <fyb@duck.com>, 2022
|
||||||
#
|
#
|
||||||
|
import urllib.request
|
||||||
|
|
||||||
|
|
||||||
|
# noinspection PyUnreachableCode
|
||||||
def main():
|
def main():
|
||||||
|
if False:
|
||||||
follower_path = '/home/ferit/Downloads/followers.csv'
|
follower_path = '/home/ferit/Downloads/followers.csv'
|
||||||
following_path = '/home/ferit/Downloads/following.csv'
|
following_path = '/home/ferit/Downloads/following.csv'
|
||||||
|
|
||||||
@ -17,11 +22,23 @@ def main():
|
|||||||
following_list.remove(following_list[0])
|
following_list.remove(following_list[0])
|
||||||
|
|
||||||
follower_list = [line.split(',')[1] for line in follower_list]
|
follower_list = [line.split(',')[1] for line in follower_list]
|
||||||
following_list = [line.split(',')[4] for line in following_list]
|
following_list = [line.split(',')[1] for line in following_list]
|
||||||
|
else:
|
||||||
|
follower_path = '/home/ferit/scripts/follower'
|
||||||
|
followed_path = '/home/ferit/scripts/followed'
|
||||||
|
with open(follower_path, 'r') as f:
|
||||||
|
follower_list = f.readlines()
|
||||||
|
f.close()
|
||||||
|
with open(followed_path, 'r') as f:
|
||||||
|
followed_list = f.readlines()
|
||||||
|
f.close()
|
||||||
|
|
||||||
for following in following_list:
|
follower_list = [x.removesuffix('\n') for x in follower_list]
|
||||||
if following not in follower_list:
|
followed_list = [x.removesuffix('\n') for x in followed_list]
|
||||||
print(f'{following} is not following you back.')
|
|
||||||
|
for followed in followed_list:
|
||||||
|
if followed not in follower_list:
|
||||||
|
print(followed, 'doesn\'t follow you.')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user