Beispiel #1
0
 def post(self):
     test = self.request.get('test')
     if test == 'source':
         type = self.request.get('type')
         from api import ensure_source
         url = self.request.get('url')
         source = ensure_source(url, suppress_immediate_fetch=True)
         if type == 'content':
             from source_fetch import _source_fetch
             self.response.headers.add_header('Content-Type', 'text/plain')
             pprint(_source_fetch(source), self.response.out)
         elif type == 'json':
             from source_fetch import source_fetch
             source_fetch(source)
             send_json(self, source.json())
Beispiel #2
0
 def fetch_now(self):
     source_fetch(self)