Exemplo n.º 1
0
    def get_friends_statuses(self, *site, **params):
        """
        获取好友的动态信息

        params里面要定义好size字段来指定要获取的内容数量,默认为40

        **params:请求参数
        
        """
        if 'size' in params:
            size = params['size']
        else:
            size = 40

        services = {}

        for sname in self.site_handlers:
            #如果site为空,或者sname在site列表里面
            if (not site) or (sname in site):
                services[sname] = self.site_handlers[sname].statusService

        retdata = data_integration(
            services,
            "get_friends_statuses",
            key="created_at",
            data_size=size,
            **params
        )

        return retdata
Exemplo n.º 2
0
    def get_topics(self, *site, **params):
        """
        获取所有订阅的话题
        """
        if 'size' in params:
            size = params['size']
        else:
            size = 15

        services = {}

        for sname in self.site_handlers:
            #如果site为空,或者sname在site列表里面
            if (not site) or (sname in site):
                services[sname] = self.site_handlers[sname].favoriteService

        retdata = data_integration(
            services,
            "get_topics",
            key="created_at",
            data_size=size,
            **params
        )

        return retdata