Do not add peers to graph if they have not been processed

This commit is contained in:
Thomas Wade 2018-09-29 13:29:38 +09:30
parent bb88bbeb24
commit 717d7ae6c0

View File

@ -430,20 +430,28 @@ for _, user in user_dict.items():
)
print(' Followers:')
for follower in user.followers:
print(' ' + str(follower))
graph.add_edge( \
follower, \
user.url_username, \
label='follows'
)
if follower in user_dict.keys():
if not user_dict[follower].processed:
continue
print(' ' + str(follower))
graph.add_edge( \
follower, \
user.url_username, \
label='follows'
)
print(' Following:')
for following in user.following:
print(' ' + str(following))
graph.add_edge( \
user.url_username, \
following, \
label='follows'
)
if following in user_dict.keys():
if not user_dict[following].processed:
continue
print(' ' + str(following))
graph.add_edge( \
user.url_username, \
following, \
label='follows'
)
print('Making graph...')
nx.write_gexf(graph, 'graph.gexf')