Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] docs/website: fixing query.yahooapis.com shutdown
@ 2019-02-04 13:30 Angelo Compagnucci
  2019-02-04 13:47 ` Thomas Petazzoni
  2019-02-04 14:06 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Angelo Compagnucci @ 2019-02-04 13:30 UTC (permalink / raw)
  To: buildroot

This patch rework the use of query.yahooapis.com to do the conversion
from xml to json required by our script and moves to the use of a js
library. Datas are therefore now converted in json format on the client.

Unfortunately, cause of the CORS restriction on nabble and
buildroot.org, we cannot retrieve directly the xml data from these
servers and we need a CORS proxy to do that.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
I'm in contact with anbble system administrator to give us access to
cors request for their mailing archive so hopefully we can remove the
call to an external service in a not so distant future.

 docs/website/footer.html     |  1 +
 docs/website/js/buildroot.js | 19 +++++++++----------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/docs/website/footer.html b/docs/website/footer.html
index 5b18047..820c269 100644
--- a/docs/website/footer.html
+++ b/docs/website/footer.html
@@ -1,6 +1,7 @@
 	<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
 	<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
 	<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js" integrity="sha256-Daf8GuI2eLKHJlOWLRR/zRy9Clqcj4TUSumbxYH9kGI=" crossorigin="anonymous"></script>
+	<script src="https://cdnjs.cloudflare.com/ajax/libs/x2js/1.2.0/xml2json.min.js" integrity="sha384-pEpOtyRrTt7XzQzg30fXkhig417px5mP0UbPdI8mjl2KehUX2bDT807mfjJkg1H2" crossorigin="anonymous"></script>
 	<script type="text/javascript" src="js/buildroot.js"></script>
 </body>
 </html>
diff --git a/docs/website/js/buildroot.js b/docs/website/js/buildroot.js
index ec28cbb..fa5ad9a 100644
--- a/docs/website/js/buildroot.js
+++ b/docs/website/js/buildroot.js
@@ -1,17 +1,16 @@
 function load_activity(feedurl, divid) {
-    var yqlURL = "https://query.yahooapis.com/v1/public/yql";
-    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;
-
-    $.getJSON(url, function(data){
-        var result = data.query.results;
+    $.ajax({
+      url: "https://cors.io/?" + feedurl
+    })
+    .done(function(data){
+        var x2js = new X2JS();
+        var result = x2js.xml_str2json(data);
         var loaded = 0;
         var nb_display = 8;
         if (result==null) return;
-        for (var i = 0; i < result.feed.length; i++) {
-            var entry = result.feed[i].entry;
+        for (var i = 0; i < result.feed.entry.length; i++) {
+            var entry = result.feed.entry[i];
             if (entry.title.indexOf("git commit") != -1)
                 continue;
             loaded += 1;
@@ -24,7 +23,7 @@ function load_activity(feedurl, divid) {
             var text = document.createTextNode(data);
             link.appendChild(text);
             link.title = entry.title;
-            link.href = entry.link.href;
+            link.href = entry.link._href;
             div.appendChild(link);
             container.appendChild(div);
         }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] docs/website: fixing query.yahooapis.com shutdown
  2019-02-04 13:30 [Buildroot] [PATCH] docs/website: fixing query.yahooapis.com shutdown Angelo Compagnucci
@ 2019-02-04 13:47 ` Thomas Petazzoni
  2019-02-04 14:06 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2019-02-04 13:47 UTC (permalink / raw)
  To: buildroot

On Mon,  4 Feb 2019 14:30:04 +0100
Angelo Compagnucci <angelo@amarulasolutions.com> wrote:

> This patch rework the use of query.yahooapis.com to do the conversion
> from xml to json required by our script and moves to the use of a js
> library. Datas are therefore now converted in json format on the client.
> 
> Unfortunately, cause of the CORS restriction on nabble and
> buildroot.org, we cannot retrieve directly the xml data from these
> servers and we need a CORS proxy to do that.
> 
> Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>

This patch doesn't apply to master.. because it depends on:

  http://patchwork.ozlabs.org/patch/1035811/

which is not yet applied. When you have such dependencies, sending a
series is preferred, as it makes the dependency obvious.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] docs/website: fixing query.yahooapis.com shutdown
  2019-02-04 13:30 [Buildroot] [PATCH] docs/website: fixing query.yahooapis.com shutdown Angelo Compagnucci
  2019-02-04 13:47 ` Thomas Petazzoni
@ 2019-02-04 14:06 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2019-02-04 14:06 UTC (permalink / raw)
  To: buildroot

>>>>> "Angelo" == Angelo Compagnucci <angelo@amarulasolutions.com> writes:

 > This patch rework the use of query.yahooapis.com to do the conversion
 > from xml to json required by our script and moves to the use of a js
 > library. Datas are therefore now converted in json format on the client.

 > Unfortunately, cause of the CORS restriction on nabble and
 > buildroot.org, we cannot retrieve directly the xml data from these
 > servers and we need a CORS proxy to do that.

 > Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>

Committed after changing the integrity tag to use sha256 for consistency
with the others, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-04 14:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-04 13:30 [Buildroot] [PATCH] docs/website: fixing query.yahooapis.com shutdown Angelo Compagnucci
2019-02-04 13:47 ` Thomas Petazzoni
2019-02-04 14:06 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox