Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
main.FeedCollector Class Reference
Inheritance diagram for main.FeedCollector:

Public Member Functions

 post (self)
 
 get (self)
 
 fetchn (self, feed, feedId, n, continuation=None)
 

Detailed Description

Definition at line 542 of file main.py.

Member Function Documentation

◆ fetchn()

main.FeedCollector.fetchn (   self,
  feed,
  feedId,
  n,
  continuation = None 
)

Definition at line 558 of file main.py.

558 def fetchn(self, feed, feedId, n, continuation=None):
559 # basic pattern is to read by ARTICLE_COUNT until we hit existing.
560 if continuation is None:
561 apiUrl = '%s/stream/contents/%s?n=%d' % (READER_API, feedId, n)
562 else:
563 apiUrl = '%s/stream/contents/%s?n=%d&c=%s' % (READER_API, feedId, n,
564 continuation)
565
566 logging.info('fetching: %s' % apiUrl)
567 result = urlfetch.fetch(apiUrl)
568
569 if result.status_code == 200:
570 data = json.loads(result.content)
571 collectFeed(feed, data, continuation)
572 elif result.status_code == 401:
573 self.response.out.write('<pre>%s</pre>' % result.content)
574 else:
575 self.response.out.write(result.status_code)
576
577

◆ get()

main.FeedCollector.get (   self)

Definition at line 547 of file main.py.

547 def get(self):
548 feedId = self.request.get('id')
549 feed = Feed.get_or_insert(feedId)
550
551 if feed.lastUpdated is None:
552 self.fetchn(feed, feedId, INITIAL_COUNT)
553 else:
554 self.fetchn(feed, feedId, UPDATE_COUNT)
555
556 self.response.headers['Content-Type'] = "text/plain"
557

◆ post()

main.FeedCollector.post (   self)

Definition at line 544 of file main.py.

544 def post(self):
545 return self.get()
546

The documentation for this class was generated from the following file: