this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Build out feed_serve_debug and wire up rapidfire.py into it

+23
+5
feeds/__init__.py
··· 63 63 if feed is not None: 64 64 return feed.serve_feed(limit, offset, langs) 65 65 66 + def serve_feed_debug(self, feed_uri, limit, offset, langs): 67 + feed = self.feeds.get(feed_uri) 68 + if feed is not None: 69 + return feed.serve_feed_debug(limit, offset, langs) 70 + 66 71 def run_tasks_minute(self): 67 72 for feed in self.feeds.values(): 68 73 feed.run_tasks_minute()
+12
feeds/rapidfire.py
··· 1 1 import os 2 2 import apsw 3 + import apsw.ext 3 4 import logging 4 5 5 6 from . import BaseFeed ··· 86 87 [*lang_values, limit, offset] 87 88 ) 88 89 return [uri for (uri, create_ts) in cur] 90 + 91 + def serve_feed_debug(self, limit, offset, langs): 92 + query = ( 93 + "select count(*) from posts;" 94 + "select *, unixepoch('now') from posts order by create_ts desc limit :limit offset :offset;" 95 + ) 96 + bindings = dict(limit=limit, offset=offset) 97 + return apsw.ext.format_query_table( 98 + self.db_cnx, query, bindings, 99 + string_sanitize=2, text_width=9999, use_unicode=False, quote=True 100 + )
+6
feedweb.py
··· 29 29 feed_uri = request.args['feed'] 30 30 31 31 langs = request.accept_languages 32 + 33 + if request.args.get('debug', '0') == '1': 34 + headers = {'Content-Type': 'text/plain; charset=utf-8'} 35 + debug = manager.serve_feed_debug(feed_uri, limit, offset, langs) 36 + return debug, headers 37 + 32 38 posts = manager.serve_feed(feed_uri, limit, offset, langs) 33 39 offset += len(posts) 34 40