Esempio n. 1
0
def getGodSocialInfo(god):
    '''
    create by bigzhu at 15/11/27 10:37:14 取社交信息
    '''
    god.twitter_user = public_db.getTwitterUser(god.twitter)
    god.github_user = public_db.getGithubUser(god.github)
    god.instagram_user = public_db.getInstagramUser(god.instagram)
    return god
Esempio n. 2
0
def getGodSocialInfo(god):
    '''
    create by bigzhu at 15/11/27 10:37:14 取社交信息
    '''
    god.twitter_user = public_db.getTwitterUser(god.twitter)
    god.github_user = public_db.getGithubUser(god.github)
    god.instagram_user = public_db.getInstagramUser(god.instagram)
    return god
Esempio n. 3
0
def getGods(user_id):
    '''
    create by bigzhu at 15/07/12 23:43:54 显示所有的大神, 关联twitter
    modify by bigzhu at 15/07/17 15:20:26 关联其他的,包括 github
    '''
    gods = list(public_db.getGodInfoFollow(user_id))
    will_del = []
    for god in gods:
        god.twitter_user = public_db.getTwitterUser(god.twitter)
        god.github_user = public_db.getGithubUser(god.github)
        god.instagram_user = public_db.getInstagramUser(god.instagram)
        if god.twitter_user is None and god.github_user is None and god.instagram_user is None:
            will_del.append(god)
    for god in will_del:
        gods.remove(god)
    return gods
Esempio n. 4
0
def getGods(user_id, recommand=False):
    '''
    create by bigzhu at 15/07/12 23:43:54 显示所有的大神, 关联twitter
    modify by bigzhu at 15/07/17 15:20:26 关联其他的,包括 github
    modify by bigzhu at 15/08/28 17:05:54 可以查出没关注的,和随机的
    '''
    gods = list(public_db.getGodInfoFollow(user_id, recommand=recommand))
    #will_del = []
    for god in gods:
        god.twitter_user = public_db.getTwitterUser(god.twitter)
        god.github_user = public_db.getGithubUser(god.github)
        god.instagram_user = public_db.getInstagramUser(god.instagram)
        #if god.twitter_user is None and god.github_user is None and god.instagram_user is None:
        #    print god
        #    will_del.append(god)
    #for god in will_del:
    #    gods.remove(god)
    return gods
Esempio n. 5
0
def makeSurePicture(user_info):
    '''
    create by bigzhu at 15/08/03 16:31:00 从各种用户里找头像
    modify by bigzhu at 15/08/03 16:58:52 同时把描述也找了
    '''
    if user_info.picture:
        return

    github_user = public_db.getGithubUser(user_info.user_name)
    if github_user:
        user_info.picture = github_user.avatar_url
        return
    twitter_user = public_db.getTwitterUser(user_info.user_name)
    if twitter_user:
        user_info.picture = twitter_user.profile_image_url_https
        if not user_info.slogan:
            user_info.slogan = twitter_user.description
        return
    instagram_user = public_db.getInstagramUser(user_info.user_name)
    if instagram_user:
        user_info.picture = instagram_user.profile_picture
        return
Esempio n. 6
0
def makeSurePicture(user_info):
    '''
    create by bigzhu at 15/08/03 16:31:00 从各种用户里找头像
    modify by bigzhu at 15/08/03 16:58:52 同时把描述也找了
    '''
    if user_info.picture:
        return

    github_user = public_db.getGithubUser(user_info.user_name)
    if github_user:
        user_info.picture = github_user.avatar_url
        return
    twitter_user = public_db.getTwitterUser(user_info.user_name)
    if twitter_user:
        user_info.picture = twitter_user.profile_image_url_https
        if not user_info.slogan:
            user_info.slogan = twitter_user.description
        return
    instagram_user = public_db.getInstagramUser(user_info.user_name)
    if instagram_user:
        user_info.picture = instagram_user.profile_picture
        return