Beispiel #1
0
    def GET(self):
        web.header('Content-type', 'text/html')
        web.header('Transfer-Encoding', 'chunked')
        
        # Yielding nothing to fill the buffers
        # in browsers.
        yield ' ' * 1024 + '<br>'

        while True:
            notifier_queue.get()
            yield """
                <script type="text/javascript">
                    (function () {
                        var info = %s
                        update(info)
                    })()
                </script>
            """ % (spotify.current_track(), )
Beispiel #2
0
 def GET(self):
     return spotify.current_track()