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()
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
  • 序言:七十年代末涤垫,一起剝皮案震驚了整個濱河市苟鸯,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌钾军,老刑警劉巖工腋,帶你破解...
    沈念sama閱讀 211,194評論 6 490
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件写半,死亡現(xiàn)場離奇詭異,居然都是意外死亡九昧,警方通過查閱死者的電腦和手機绊袋,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,058評論 2 385
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來耽装,“玉大人愤炸,你說我怎么就攤上這事〉粞伲” “怎么了规个?”我有些...
    開封第一講書人閱讀 156,780評論 0 346
  • 文/不壞的土叔 我叫張陵,是天一觀的道長姓建。 經(jīng)常有香客問我诞仓,道長,這世上最難降的妖魔是什么速兔? 我笑而不...
    開封第一講書人閱讀 56,388評論 1 283
  • 正文 為了忘掉前任墅拭,我火速辦了婚禮,結果婚禮上涣狗,老公的妹妹穿的比我還像新娘谍婉。我一直安慰自己,他們只是感情好镀钓,可當我...
    茶點故事閱讀 65,430評論 5 384
  • 文/花漫 我一把揭開白布穗熬。 她就那樣靜靜地躺著,像睡著了一般丁溅。 火紅的嫁衣襯著肌膚如雪唤蔗。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 49,764評論 1 290
  • 那天窟赏,我揣著相機與錄音妓柜,去河邊找鬼。 笑死涯穷,一個胖子當著我的面吹牛棍掐,可吹牛的內容都是我干的。 我是一名探鬼主播拷况,決...
    沈念sama閱讀 38,907評論 3 406
  • 文/蒼蘭香墨 我猛地睜開眼塌衰,長吁一口氣:“原來是場噩夢啊……” “哼诉稍!你這毒婦竟也來了?” 一聲冷哼從身側響起最疆,我...
    開封第一講書人閱讀 37,679評論 0 266
  • 序言:老撾萬榮一對情侶失蹤杯巨,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后努酸,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體服爷,經(jīng)...
    沈念sama閱讀 44,122評論 1 303
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 36,459評論 2 325
  • 正文 我和宋清朗相戀三年获诈,在試婚紗的時候發(fā)現(xiàn)自己被綠了仍源。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 38,605評論 1 340
  • 序言:一個原本活蹦亂跳的男人離奇死亡舔涎,死狀恐怖笼踩,靈堂內的尸體忽然破棺而出,到底是詐尸還是另有隱情亡嫌,我是刑警寧澤嚎于,帶...
    沈念sama閱讀 34,270評論 4 329
  • 正文 年R本政府宣布,位于F島的核電站挟冠,受9級特大地震影響于购,放射性物質發(fā)生泄漏。R本人自食惡果不足惜知染,卻給世界環(huán)境...
    茶點故事閱讀 39,867評論 3 312
  • 文/蒙蒙 一肋僧、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧控淡,春花似錦嫌吠、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,734評論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至竹伸,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間簇宽,已是汗流浹背勋篓。 一陣腳步聲響...
    開封第一講書人閱讀 31,961評論 1 265
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留魏割,地道東北人譬嚣。 一個月前我還...
    沈念sama閱讀 46,297評論 2 360
  • 正文 我出身青樓,卻偏偏與公主長得像钞它,于是被迫代替她去往敵國和親拜银。 傳聞我的和親對象是個殘疾皇子殊鞭,可洞房花燭夜當晚...
    茶點故事閱讀 43,472評論 2 348

推薦閱讀更多精彩內容