[Koha-bugs] [Bug 14994] Add RSS/Atom feed proxy

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Oct 22 14:24:35 CEST 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14994

--- Comment #3 from Martin Persson <xarragon at gmail.com> ---
For a working example which puts the first three posts from two separate Atom
feeds on the OPAC front page via jQuery, add this code to the system
preferences. It is used with the example URLs used in the test plan:

URL1: http://hyltebiblioteken.blogspot.se/feeds/posts/default
URL2: http://bokbastisarna.blogspot.com/feeds/posts/default

OpacNavRight
============
<div class="rss-widget-container">
<div class="rss-widget-head">
Rubriker från bloggen
</div>
<div class="rss-widget-body" id="bloggen">
<ul class="rss-items"></ul>
<div class="loading">
Laddar innehåll från bloggen. Detta kräver Javascript aktiverat i din
webbläsare.
</div>
</div>
</div>

<div class="rss-widget-container">
<div class="rss-widget-head">
Bokbästisarna
</div>
<div class="rss-widget-body" id="bokbastisarna">
<ul class="rss-items"></ul>
<div class="loading">
Laddar innehåll från bloggen. Detta kräver Javascript aktiverat i din
webbläsare.
</div>
</div>
</div> 
============

OPACUserJS
==========
$('#bloggen').ready(function() {
    var url = 'http://127.0.1.1/cgi-bin/koha/opac-proxy.pl?id=1';
    $.ajax(url, {
        dataType: 'xml',
        success: function(xmldata) {
            var item_html = '';
            var xml = $(xmldata).find('entry').slice(0,3).each(function(index,
value) {
                var title = $(this).children('title');
                var link = $(this).children('link');
                item_html += '<li><a href="' + link.text() + '">' +
title.text() + "</a></li>\n";
            });
            $('#bloggen div.loading').fadeOut('slow', function () {
                $(this).html(item_html);
                $(this).slideDown('slow');
            });
        }
    });
});


$('#bokbastisarna').ready(function() {
    var url = 'http://127.0.1.1/cgi-bin/koha/opac-proxy.pl?id=2';
    $.ajax(url, {
        dataType: 'xml',
        success: function(xmldata) {
            var item_html = '';
            var xml = $(xmldata).find('entry').slice(0,3).each(function(index,
value) {
                var title = $(this).children('title');
                var link = $(this).children('link');
                item_html += '<li><a href="' + link.text() + '">' +
title.text() + "</a></li>\n";
            });
            $('#bokbastisarna div.loading').fadeOut('slow', function () {
                $(this).html(item_html);
                $(this).slideDown('slow');
            });
        }
    });
});
==========

These examples are in Swedish, based on real-life usage.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list