Beispiel #1
0
    def referrers_post_detail(self, post, days=3, _callback=None, **kwargs):
        url = post.url if hasattr(post, 'url') else post
        dates = self._format_date_args(**kwargs)
        options = {'days': days, 'url': url}

        handler = self._build_callback(
            lambda res: [Referrer.new_from_json_dict(x) for x in res['data']],
            _callback)
        res = self.conn._request_endpoint('/referrers/post/detail',
                                          dict(options.items() + dates.items()),
                                          _callback=handler if _callback else None)
        return handler(res) if not _callback else None
Beispiel #2
0
    def referrers_post_detail(self, post, days=3, _callback=None, **kwargs):
        url = post.url if hasattr(post, 'url') else post
        dates = self._format_date_args(**kwargs)
        options = {'days': days, 'url': url}

        handler = self._build_callback(
            lambda res: [Referrer.new_from_json_dict(x) for x in res['data']],
            _callback)
        res = self.conn._request_endpoint(
            '/referrers/post/detail',
            dict(options.items() + dates.items()),
            _callback=handler if _callback else None)
        return handler(res) if not _callback else None
Beispiel #3
0
 def inner(res):
     for r in res['data']:
         r['ref_type'] = ref_type
     return [Referrer.new_from_json_dict(x) for x in res['data']]
Beispiel #4
0
 def inner(res):
     for r in res['data']:
         r['ref_type'] = ref_type
     return [Referrer.new_from_json_dict(x) for x in res['data']]