import dblp

fout = open("author_graph_sample.txt", "w")

authors = dblp.search('Fugang Wang')

visitedAuth = []
authCount = 0

# for auth in authors:
#     print >>fout,auth.name

for auth in authors:
    print(auth.name, file=fout)
    print(70 * '=', file=fout)
    for pub in auth.publications:
        for a in pub.authors:
            if a not in visitedAuth and a != auth.name:
                visitedAuth.append(a)
                authCount += 1

print(visitedAuth, file=fout)
fout.write('Author count:' + str(authCount))
        
