Пример #1
0
    def GET(self):
        data = SinaDao.getmyinfo()
        # print data
        repost_count = SinaDao.getfriendinfo()
        # print repost_count
        idstr = data['idstr']
        screen_name = data['screen_name']
        allrepost=0
        for i in repost_count:
            allrepost+=i['Repost_Intimacy']
        #把reposts的值存在oldcontroller中  不过这个坏处就是需要每次点击这个方法才会好使
        Ie = data['friends_count']*data['statuses_count']
        Ic = allrepost*data['friends_count']
        Ia = Ie + Ic
        Ib = 1

        # influence = '{u"Ie":'+str(Ie)+',u"Ic":'+str(Ic)+',u"Ia":'+str(Ia)+',u"I":'+str(I)+'}'
        SinaDao.old_save_info(idstr,screen_name,Ie,Ic,Ia,Ib)
        influences = SinaDao.get_old_info()
        data=[]
        
        for influence in influences:
            print "====="
            print influence
            data.append({"screen_name":unicode(str(influence['screen_name']), "utf-8"),
                "Ie":str(influence['Ie']),
                "Ic":str(influence['Ic']),
                "Ia":str(influence['Ia']),
                "I":str(influence["Ib"])})
        # print data
        result={}
        result['data']=data
        return result
Пример #2
0
    def GET(self):
        data = SinaDao.getmyinfo()
        if data['verified']:
            data['verified'] = u'是'
        else:
            data['verified'] = u'否'

        stime = data['created_at'].split(" ")
        

        data['created_at'] = str(stime[5])+u"年"+str(StringUtil.converttime(stime[1]))+u"月"+str(stime[2])+u"日"+StringUtil.convertweek(stime[0])+stime[3]
        print data
        result = {}
        for i in data:
            result[str(i)]=data[i]
        return str(result).replace('\'','\"')
Пример #3
0
    def GET(self):
        data = SinaDao.getmyinfo()
        if data['verified']:
            data['verified'] = u'是'
        else:
            data['verified'] = u'否'

        stime = data['created_at'].split(" ")

        data['created_at'] = str(stime[5]) + u"年" + str(
            StringUtil.converttime(stime[1])) + u"月" + str(
                stime[2]) + u"日" + StringUtil.convertweek(stime[0]) + stime[3]
        print data
        result = {}
        for i in data:
            result[str(i)] = data[i]
        return str(result).replace('\'', '\"')
Пример #4
0
    def GET(self):
        data = SinaDao.getmyinfo()
        # print data
        repost_count = SinaDao.getfriendinfo()
        # print repost_count
        idstr = data['idstr']
        screen_name = data['screen_name']
        allrepost = 0
        for i in repost_count:
            allrepost += i['Repost_Intimacy']
        #把reposts的值存在oldcontroller中  不过这个坏处就是需要每次点击这个方法才会好使
        Ie = data['friends_count'] * data['statuses_count']
        Ic = allrepost * data['friends_count']
        Ia = Ie + Ic
        Ib = 1

        # influence = '{u"Ie":'+str(Ie)+',u"Ic":'+str(Ic)+',u"Ia":'+str(Ia)+',u"I":'+str(I)+'}'
        SinaDao.old_save_info(idstr, screen_name, Ie, Ic, Ia, Ib)
        influences = SinaDao.get_old_info()
        data = []

        for influence in influences:
            print "====="
            print influence
            data.append({
                "screen_name":
                unicode(str(influence['screen_name']), "utf-8"),
                "Ie":
                str(influence['Ie']),
                "Ic":
                str(influence['Ic']),
                "Ia":
                str(influence['Ia']),
                "I":
                str(influence["Ib"])
            })
        # print data
        result = {}
        result['data'] = data
        return result