def getOpenSearchLinks():
    """
    Function generating a script to extract all open search links.
    
    @return script to extract all open serach links
    @rtype str
    """
    source = """
(function() {
    var out = [];
    var links = document.getElementsByTagName('link');
    for (var i = 0; i < links.length; ++i) {
        var e = links[i];
        if (e.type == 'application/opensearchdescription+xml') {
            out.push({
                url: e.getAttribute('href'),
                title: e.getAttribute('title')
            });
        }
    }
    return out;
})()"""
    return source
