AutoPagerizeTwitterFilter

By swdyh Last update May 7, 2009 — Installed 1,317 times. Daily Installs: 4, 0, 5, 4, 2, 9, 8, 4, 2, 1, 2, 2, 8, 1, 1, 3, 1, 2, 6, 5, 5, 7, 6, 2, 3, 2, 4, 4, 3, 5, 1, 4
// ==UserScript==
// @name           AutoPagerizeTwitterFilter
// @namespace      http://relucks.org/
// @include        http://twitter.com/
// ==/UserScript==

(function() {
    var reqfl = function(opt) {
        opt['headers'] = opt['headers'] || {}
        opt['headers']['Accept'] = 'application/json, text/javascript, */*'
    }
    var resfl = function(res, url) {
        var r = eval('(' + res.responseText + ')')
        res.responseText = '<html><body><div>' +
            r['#pagination'] + r['#timeline'] +
            '</div></body></html>'
        res.finalUrl = null
    }
    setTimeout(function() {
        if (window.AutoPagerize) {
            if (window.AutoPagerize.addResponseFilter) {
                window.AutoPagerize.addResponseFilter(resfl)
            }
            if (window.AutoPagerize.addRequestFilter) {
                window.AutoPagerize.addRequestFilter(reqfl)
            }
        }
    }, 0)
})()