Me 用户操作类

敬告:本类提供的点赞,反对功能,请在使用前三思,并且绝对不要用于批量点赞,批量反对等不甚道德的脚本。和谐知乎,你我共建,谢谢理解。

class zhihu.me.Me(url, name, motto, photo_url, session)[源代码]

封装了相关操作(如点赞,关注问题)的类。 请使用 ZhihuClient.me() 方法获取实例。

add_comment(answer, content)[源代码]

给指定答案添加评论

参数:
  • answer (Answer) – 答案对象
  • content (string) – 评论内容
返回:

成功返回 True,失败返回 False

返回类型:

bool

block(something, block=True)[源代码]

屏蔽某个用户、话题

参数:
  • something (Author/Topic) –
  • block – True–>屏蔽,False–>取消屏蔽
返回:

成功返回 True,失败返回 False

返回类型:

bool

follow(something, follow=True)[源代码]

关注用户、问题、话题或收藏夹

参数:
  • something (Author/Question/Topic) – 需要关注的对象
  • follow (bool) – True–>关注,False–>取消关注
返回:

成功返回True,失败返回False

返回类型:

bool

send_message(author, content)[源代码]

发送私信给一个用户

参数:
  • author (Author) – 接收私信用户对象
  • content (string) – 发送给用户的私信内容
返回:

成功返回 True,失败返回 False

返回类型:

bool

thanks(answer, thanks=True)[源代码]

感谢或取消感谢回答

参数:
  • answer (Answer) – 要感谢或取消感谢的回答
  • thanks – True–>感谢,False–>取消感谢
返回:

成功返回True,失败返回False

返回类型:

bool

unhelpful(answer, unhelpful=True)[源代码]

没有帮助或取消没有帮助回答

参数:
  • answer (Answer) – 要没有帮助或取消没有帮助回答
  • unhelpful – True–>没有帮助,False–>取消没有帮助
返回:

成功返回 True,失败返回 False

返回类型:

bool

vote(something, vote='up')[源代码]

给答案或文章点赞或取消点赞

参数:
  • something (Answer/Post) – 需要点赞的答案或文章对象
  • vote (str) –
    取值 说明 默认值
    up 赞同
    down 反对 X
    clear 既不赞同也不反对 X
返回:

成功返回True,失败返回False

返回类型:

bool