A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
Read the statement by Michael Teeuw here.
New to building modules. plz help
-
@sdetweil how do I make it JSON format
-
@sdetweil or how do I make the module take whatever format the urlApi is
-
@Djninja926 >how do I make it JSON format
the data is already in json format (old and new) JSON is just a structure, like a spreadsheet, it doesn’t control the actual content
how do I make the module take whatever format the urlApi is
good luck with that… i don’t know of any software learning that would be capable of that
old data{ "userId": 1, "id": 1, "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit", "body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto" }
new data
{"wus": 18, "rank": 0, "total_users": 2656615, "active_50": 1, "path": "donor/Apia_Okorafor", "wus_cert": "https://apps.foldingathome.org/awards?user=72700656&type=wus", "id": 72700656, "credit_cert": "https://apps.foldingathome.org/awards?user=72700656&type=score", "last": "2020-04-28 02:35:06", "name": "Apia_Okorafor", "teams": [{"wus": 18, "last": "2020-04-28 02:35:06", "uid": 72700656, "active_50": 1, "active_7": 1, "credit": 31157, "team": 223518, "name": "LinusTechTips_Team"}], "active_7": 1, "credit": 31157}
the code only used the title field from the data, but there is no title field at all in the new data
if (this.dataRequest) { var wrapperDataRequest = document.createElement("div"); // check format https://jsonplaceholder.typicode.com/posts/1 wrapperDataRequest.innerHTML = this.dataRequest.title; var labelDataRequest = document.createElement("label"); // Use translate function // this id defined in translations files labelDataRequest.innerHTML = this.translate("TITLE"); wrapper.appendChild(labelDataRequest); wrapper.appendChild(wrapperDataRequest); }
-
@sdetweil I got it working. thank you for your help
-
@Djninja926 cool…