From fb07b0e40ec770265b5065ea47d31592d3401024 Mon Sep 17 00:00:00 2001 From: DenisovichDev Date: Tue, 18 Oct 2022 23:45:57 +0530 Subject: [PATCH 1/2] Added links to papa parse --- 039_madlibs/P5/index.html | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/039_madlibs/P5/index.html b/039_madlibs/P5/index.html index a9ee86c..e93e5c9 100644 --- a/039_madlibs/P5/index.html +++ b/039_madlibs/P5/index.html @@ -1,14 +1,20 @@ + - - - - - - - - - + + + + + + + + + + + + +

MadLibs

_____________! they said ________ as they jumped into their _____________ and flew off with their __________ __________."

- + + From 2440cfccedfb716c64c5a3520838396f4b8e01c7 Mon Sep 17 00:00:00 2001 From: DenisovichDev Date: Tue, 18 Oct 2022 23:47:14 +0530 Subject: [PATCH 2/2] Fixed the generator using papa parse --- 039_madlibs/P5/sketch.js | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/039_madlibs/P5/sketch.js b/039_madlibs/P5/sketch.js index c0d8177..77851bc 100644 --- a/039_madlibs/P5/sketch.js +++ b/039_madlibs/P5/sketch.js @@ -10,11 +10,28 @@ var txt = function setup() { noCanvas(); - Tabletop.init({ - key: '15WyEmfu6B1UCzzqeacYnzI8lutrxF6uWvFDiSteBqTs', - callback: gotData, - simpleSheet: true - }); + // Tabletop.init({ + // key: '15WyEmfu6B1UCzzqeacYnzI8lutrxF6uWvFDiSteBqTs', + // callback: gotData, + // simpleSheet: true + // }); + + // Unfortunately since 2020 tabletop.js has been deprecated + // because of some changes that Google had made. To learn + // more about it, visit https://github.com/jsoma/tabletop + + // In this example, the library Papa Parse has been used + // in a very similar fashion, so do something like this + // instead. Keep in mind that the Google Sheet link has + // to a CSV link, rather than a web page! + Papa.parse('https://docs.google.com/spreadsheets/d/e/2PACX-1vSiJDczupcvlAJxd70RJ9hZina9cqweCiTj1EkYrH_17FhFBjdMFTEY2TOMmhwGBHGR05y7QRXLNbo6/pub?output=csv', { + download: true, + header: true, + complete: function(results) { + var stuff = results.data + data = stuff + } + }) var button = createButton('generate madlib'); button.mousePressed(generate); @@ -31,6 +48,6 @@ function generate() { createP(madlib); } -function gotData(stuff, tabletop) { - data = stuff; -} +// function gotData(stuff, tabletop) { +// data = stuff; +// }