Commits

Evgeniy Tatarkin committed 9a1d250

fix examples

Comments (0)

Files changed (2)

examples/livejournal.py

     QS = '?socconns=pfriends&mode_full_socconns=1'
     BASE_URL = 'http://{0}.livejournal.com/profile/friendlist' + QS
 
-    ENTRY_URL = (
+    ENTRY_REQUESTS = (
         FriendLevelRequest(
             BASE_URL.format('grrm'),
             username='grrm'
         """
         self.max_level = max_level
         self.friend_limit = friends_limit
-        self.next_requests = []
+        self._next_requests = []
         super(LJFriendSpider, self).__init__()
 
 
             if response.request.level < self.max_level and k < self.friend_limit:
                 # generate new url to follow
                 url = i.get('href') + self.QS
-                self.next_requests.append(FriendLevelRequest(
+                self._next_requests.append(FriendLevelRequest(
                     url,
                     username=item.username,
                     level=response.request.level + 1
                 k += 1
         return items
 
-    def next_url(self, response):
+    def next_requests(self, response):
         # when users parsed pomp call next_url method for getting next targets
         def _urls():
-            if self.next_requests:
-                yield self.next_requests.pop()
+            if self._next_requests:
+                yield self._next_requests.pop()
         return list(_urls())
 
 

examples/pythonnews.py

 
 
 class PythonNewsCrawler(BaseCrawler):
-    ENTRY_URL = 'http://python.org/news/'
+    ENTRY_REQUESTS = 'http://python.org/news/'
 
     def extract_items(self, response):
         for i in news_re.findall(response.body.decode('utf-8')):
             item.title, item.published = i[0], i[2]
             yield item
 
-    def next_url(self, response):
+    def next_requests(self, response):
         return None # one page crawler