Exemplo n.º 1
0
 def get(self):
     """
     Demonstrates synchronous use of the Parsely client library
     """
     p = Parsely(API_KEY, secrets[API_KEY])
     res = p.analytics(aspect="authors")
     self.write(res)
     self.finish()
Exemplo n.º 2
0
 def get(self):
     """
     Demonstrates synchronous use of the Parsely client library
     """
     p = Parsely(API_KEY, secrets[API_KEY])
     res = p.analytics(aspect="authors")
     self.write(res)
     self.finish()
Exemplo n.º 3
0
    def get(self):
        """
        Demonstrates asynchronous use of the Parsely client via a callback function

        Caller must be wrapped in @tornado.web.asynchronous
        Call to client method must include the _callback kwarg
        """
        def callback(result):
            self.write(result)
            self.finish()
        p = Parsely(API_KEY, secrets[API_KEY])
        p.analytics(aspect="authors", _callback=callback)
Exemplo n.º 4
0
    def get(self):
        """
        Demonstrates asynchronous use of the Parsely client via a callback function

        Caller must be wrapped in @tornado.web.asynchronous
        Call to client method must include the _callback kwarg
        """
        def callback(result):
            self.write(result)
            self.finish()

        p = Parsely(API_KEY, secrets[API_KEY])
        p.analytics(aspect="authors", _callback=callback)