def source_user(self, response): uid = response.meta["uid"] resp = json.loads(response.body) items = resp2item_v1(resp) user = items[0] request = Request(FOLLOWERS_UID_URL.format(uid=uid), callback=self.parse_followers) request.meta["source_user"] = user yield request
def source_user(self, response): uid = response.meta['uid'] resp = json.loads(response.body) items = resp2item_v1(resp) user = items[0] request = Request(FRIENDS_UID_URL.format(uid=uid), callback=self.parse_friends) request.meta['source_user'] = user yield request
def source_user(self, response): uid = response.meta['uid'] resp = json.loads(response.body) items = resp2item_v1(resp) user = items[0] request = Request(FOLLOWERS_UID_URL.format(uid=uid), callback=self.parse_followers) request.meta['source_user'] = user yield request
def parse(self, response): page = response.meta['page'] uid = response.meta['uid'] resp = json.loads(response.body) results = [] if resp == []: raise ShouldNotEmptyError() for status in resp: items = resp2item_v1(status) results.extend(items) if self.mode == 'allpages': page += 1 request = Request(BASE_URL.format(uid=uid, page=page)) request.meta['page'] = page request.meta['uid'] = uid results.append(request) return results
def parse(self, response): page = response.meta["page"] uid = response.meta["uid"] resp = json.loads(response.body) results = [] if resp == []: raise ShouldNotEmptyError() for status in resp: items = resp2item_v1(status) results.extend(items) if self.mode == "allpages": page += 1 request = Request(BASE_URL.format(uid=uid, page=page)) request.meta["page"] = page request.meta["uid"] = uid results.append(request) return results
def parse(self, response): resp = json.loads(response.body) items = resp2item_v1(resp) return items