':param Answer/Post something: éèŠç¹èµçç­æ¡ææç« å¯¹è±¡
:param str vote:
up    èµå              â
down  åå¯¹              X
clear æ¢äžèµåä¹äžåå¯¹  X
:return: æåè¿åTrueïŒå€±èŽ¥è¿åFalse
:rtype: bool'

def vote(self, something, vote='up'):

    from .answer import Answer
    from zhihu import Post
    if isinstance(something, Answer):
        mapping = {'up': 'vote_up', 'clear': 'vote_neutral', 'down': 'vote_down'}
        if (vote not in mapping.keys()):
            raise ValueError('Invalid    vote    value:    {0}'.format(vote))
        if (something.author.url == self.url):
            return False
        params = {'answer_id': str(something.aid)}
        data = {'_xsrf': something.xsrf, 'method': mapping[vote], 'params': json.dumps(params)}
        headers = dict(Default_Header)
        headers['Referer'] = something.question.url[:(-1)]
        res = self._session.post(Upvote_Answer_Url, headers=headers, data=data)
        return (res.json()['r'] == 0)
    elif isinstance(something, Post):
        mapping = {'up': 'like', 'clear': 'none', 'down': 'dislike'}
        if (vote not in mapping.keys()):
            raise ValueError('Invalid    vote    value:    {0}'.format(vote))
        if (something.author.url == self.url):
            return False
        put_url = Upvote_Article_Url.format(something.column_in_name, something.slug)
        data = {'value': mapping[vote]}
        headers = {'Content-Type': 'application/json;charset=utf-8', 'Host': 'zhuanlan.zhihu.com', 'Referer': something.url[:(-1)], 'User-Agent': 'Mozilla/5.0    (X11;    Ubuntu;    Linux    x86_64;    rv:39.0)    Gecko/20100101    Firefox/39.0', 'X-XSRF-TOKEN': self._session.cookies.get('XSRF-TOKEN')}
        res = self._session.put(put_url, json.dumps(data), headers=headers)
        return (res.status_code == 204)
    else:
        raise ValueError('argument    something    need    to    be    zhihu.Answer    or    zhihu.Post    object.')
