hackthon代码

from zhihu_oauth import ZhihuClient

client = ZhihuClient()
client.load_token('token.pkl')
# replace it  as user input

# topic
internet = client.from_url('https://www.zhihu.com/topic/19550517')
political = client.from_url('https://www.zhihu.com/topic/19551424')
computer = client.from_url('https://www.zhihu.com/topic/19555547')
occupation = client.from_url('https://www.zhihu.com/topic/19552488')
fishing = client.from_url('https://www.zhihu.com/topic/20022251')
society = client.from_url('https://www.zhihu.com/topic/19566933')

# internet
print(internet.best_answer_count)
print(internet.best_answers_count)
#我也不知道这是啥
for answer in internet.best_answers:

    print('internet')
    print(answer.question.title)
    print(answer.author.name)
    print(answer.content)

    for comments in answer.comments:
        print(comments.content)
        print(comments.vote_count)

# political
for answer in political.best_answers:

    print('political')
    print(answer.question.title)
    print(answer.author.name)
    print(answer.content)

    for comments in answer.comments:
        print(comments.content)
        print(comments.vote_count)

# computer
for answer in computer.best_answers:
    print('computer')
    print(answer.question.title)
    print(answer.author.name)
    print(answer.content)

    for comments in answer.comments:
        print(comments.content)
        print(comments.vote_count)

# occupation
for answer in occupation.best_answers:
    print('occupation')
    print(answer.question.title)
    print(answer.author.name)
    print(answer.content)

    for comments in answer.comments:
        print(comments.content)
        print(comments.vote_count)

# fishing
for answer in fishing.best_answers:
    print('fishing')
    print(answer.question.title)
    print(answer.author.name)
    print(answer.content)

    for comments in answer.comments:
        print(comments.content)
        print(comments.vote_count)

# society
for answer in society.best_answers:
    print('society')
    print(answer.question.title)
    print(answer.author.name)
    print(answer.content)

    for comments in answer.comments:
        print(comments.content)
        print(comments.vote_count)



##the pic data of radar
# internet
print(internet.id)
print(internet.best_answer_count)
print(internet.best_answers_count)
print(internet.follower_count)
print(internet.followers_count)
print(internet.question_count)
print(internet.questions_count)
print(internet.unanswered_count)

# political
print(political.id)
print(political.best_answer_count)
print(political.best_answers_count)
print(political.follower_count)
print(political.followers_count)
print(political.question_count)
print(political.questions_count)
print(political.unanswered_count)

# computer
print(computer.id)
print(computer.best_answer_count)
print(computer.best_answers_count)
print(computer.follower_count)
print(computer.followers_count)
print(computer.question_count)
print(computer.questions_count)
print(computer.unanswered_count)
# occupation
print(occupation.id)
print(occupation.best_answer_count)
print(occupation.best_answers_count)
print(occupation.follower_count)
print(occupation.followers_count)
print(occupation.question_count)
print(occupation.questions_count)
print(occupation.unanswered_count)
# fishing
print(fishing.id)
print(fishing.best_answer_count)
print(fishing.best_answers_count)
print(fishing.follower_count)
print(fishing.followers_count)
print(fishing.question_count)
print(fishing.questions_count)
print(fishing.unanswered_count)
# society
print(society.id)
print(society.best_answer_count)
print(society.best_answers_count)
print(society.follower_count)
print(society.followers_count)
print(society.question_count)
print(society.questions_count)
print(society.unanswered_count)



##the pic data of map

people = client.from_url('https://www.zhihu.com/people/mrfoxlr')

for location in people.locations:

   print(location.'name')
dfs()

你可能感兴趣的:(hackthon代码)