forked from indymedia/epicyon
Function for non-mutuals
parent
e70158ed51
commit
bdb5fa5804
19
follow.py
19
follow.py
|
@ -112,8 +112,7 @@ def isFollowingActor(baseDir: str,
|
||||||
|
|
||||||
|
|
||||||
def getMutualsOfPerson(baseDir: str,
|
def getMutualsOfPerson(baseDir: str,
|
||||||
nickname: str, domain: str,
|
nickname: str, domain: str) -> []:
|
||||||
followFile='following.txt') -> []:
|
|
||||||
"""Returns the mutuals of a person
|
"""Returns the mutuals of a person
|
||||||
i.e. accounts which they follow and which also follow back
|
i.e. accounts which they follow and which also follow back
|
||||||
"""
|
"""
|
||||||
|
@ -128,6 +127,22 @@ def getMutualsOfPerson(baseDir: str,
|
||||||
return mutuals
|
return mutuals
|
||||||
|
|
||||||
|
|
||||||
|
def getNonMutualsOfPerson(baseDir: str,
|
||||||
|
nickname: str, domain: str) -> []:
|
||||||
|
"""Returns the followers who are not mutuals of a person
|
||||||
|
i.e. accounts which follow you but you don't follow them
|
||||||
|
"""
|
||||||
|
followers = \
|
||||||
|
getFollowersOfPerson(baseDir, nickname, domain, 'followers')
|
||||||
|
following = \
|
||||||
|
getFollowersOfPerson(baseDir, nickname, domain, 'following')
|
||||||
|
nonMutuals = []
|
||||||
|
for handle in following:
|
||||||
|
if handle not in followers:
|
||||||
|
nonMutuals.append(handle)
|
||||||
|
return nonMutuals
|
||||||
|
|
||||||
|
|
||||||
def getFollowersOfPerson(baseDir: str,
|
def getFollowersOfPerson(baseDir: str,
|
||||||
nickname: str, domain: str,
|
nickname: str, domain: str,
|
||||||
followFile='following.txt') -> []:
|
followFile='following.txt') -> []:
|
||||||
|
|
Loading…
Reference in New Issue