Do not add peers to graph if they have not been processed
This commit is contained in:
parent
bb88bbeb24
commit
717d7ae6c0
32
scrape.py
32
scrape.py
@ -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')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user