def vote direction, id
      logged_in?
      post('/api/vote', body: {id: id, dir: direction, uh: @modhash, api_type: 'json'})
    end
def vote direction, id
      logged_in?
      post('/api/vote', body: {id: id, dir: direction, uh: @modhash, api_type: 'json'})
    end
Vote on a comment or link

 @param direction [-1, 0, 1] The direction to vote in. -1 is a downvote, 1 is an upvote, 0 cancels any vote
 @param id [String] The thing to target.
 @return (see #clear_sessions)