diff --git a/resources/assets/js/scriptResultPage.js b/resources/assets/js/scriptResultPage.js index 83355e35ba01560e31e29f99cd4d0eba5a486e3b..aba8f4f3250638847b958a6c7aaad33da5f72de5 100644 --- a/resources/assets/js/scriptResultPage.js +++ b/resources/assets/js/scriptResultPage.js @@ -570,6 +570,7 @@ function loadQuicktips (search, locale, sprueche) { } const QUICKTIP_SERVER = 'https://quicktips.metager3.de'; +//const QUICKTIP_SERVER = 'http://localhost:63825'; /** * Requests quicktips from the quicktip server and passes them to the loadedHandler @@ -586,15 +587,16 @@ function getQuicktips (search, locale, blacklist, loadedHandler) { }); $.get(getString, function (data, status) { if (status === 'success') { - var quicktips = $(data).find('entry').map(function () { + var quicktips = $(data).children('feed').children('entry').map(function () { + console.log(this); return quicktip = { - type: $(this).children('type').text(), + type: $(this).children('mg\\:type').text(), title: $(this).children('title').text(), - summary: $(this).children('summary').text(), - url: $(this).children('url').text(), + summary: $(this).children('content').text(), + url: $(this).children('link').text(), gefVon: $(this).children('gefVon').text(), - priority: $(this).children('priority').text(), - details: $(this).children('details').map(function () { + score: $(this).children('relevance\\:score').text(), + details: $(this).children('mg\\:details').children('entry').map(function () { return { title: $(this).children('title').text(), text: $(this).children('text').text(), @@ -603,6 +605,7 @@ function getQuicktips (search, locale, blacklist, loadedHandler) { }).toArray() }; }).toArray(); + console.log(quicktips); loadedHandler(quicktips); } else { console.error('Loading quicktips failed with status ' + status); @@ -636,7 +639,7 @@ function getQuicktips (search, locale, blacklist, loadedHandler) { function createQuicktips (quicktips, sprueche) { var quicktipsDiv = $('#quicktips'); quicktips.sort(function (a, b) { - return b.priority - a.priority; + return b.score - a.score; }).forEach(function (quicktip) { var mainElem; if (quicktip.details.length > 0) {