docs/website: Speedup javascript query
authorAngelo Compagnucci <angelo.compagnucci@gmail.com>
Wed, 22 Feb 2017 20:03:47 +0000 (21:03 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 22 Feb 2017 20:31:03 +0000 (21:31 +0100)
This commit limits results from the javascript query for selecting
messages from the mailing list.  It was not limited before.

Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
docs/website/js/buildroot.js

index da43664162a5a3d63e9d12b81259be96b4980550..a30da633e9779f2a2626416ec04d8e24dce070d1 100644 (file)
@@ -1,7 +1,7 @@
 function load_activity(feedurl, divid) {
     var yqlURL = "https://query.yahooapis.com/v1/public/yql";
-    var yqlQS = "?q=select%20*%20from%20xml%20where%20url%20%3D%20'";
-    var yqlOPTS = "'&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=";
+    var yqlQS = "?q=select%20entry%20from%20xml%20where%20url%20%3D%20'";
+    var yqlOPTS = "'%20limit%2010&format=json&callback=";
     var container = document.getElementById(divid);
     var url = yqlURL + yqlQS + encodeURIComponent(feedurl) + yqlOPTS;
 
@@ -10,8 +10,8 @@ function load_activity(feedurl, divid) {
         var loaded = 0;
         var nb_display = 8;
         if (result==null) return;
-        for (var i = 0; i < result.feed.entry.length; i++) {
-            var entry = result.feed.entry[i];
+        for (var i = 0; i < result.feed.length; i++) {
+            var entry = result.feed[i].entry;
             if (entry.title.indexOf("git commit") != -1)
                 continue;
             loaded += 1;