import json
from .urls import url_follow


def follow(self, user_id):
    if self.login_status:
        url = url_follow % (user_id)
        try:
            follow = self.s.post(url)
            if follow.status_code == 200:
                response = json.loads(follow.text)
                return True, response['result']
        except Exception, e:
            return False, str(e)
        return False, 'fail'

d5f65e72acd0f1fdc12880fae598d48d73103112
import json
from .urls import url_follow


def follow(self, user_id):
    if self.login_status:
        url = url_follow % (user_id)
        try:
            follow = self.s.post(url)
            if follow.status_code == 200:
                response = json.loads(follow.text)
                return True, response['result']
        except Exception, e:
            return False, str(e)
        return False, 'fail'
