Read the statement by Michael Teeuw here.
Updating Compliments using a spreadsheet
-
Google being very through with their JSON…
{ "version": "1.0", "encoding": "UTF-8", "feed": { "xmlns": "http://www.w3.org/2005/Atom", "xmlns$openSearch": "http://a9.com/-/spec/opensearchrss/1.0/", "xmlns$gsx": "http://schemas.google.com/spreadsheets/2006/extended", "id": { "$t": "https://spreadsheets.google.com/feeds/list/YOUR_SECRET_SHEET_LINK_ID/od6/public/values" }, "updated": { "$t": "2017-08-14T03:28:11.565Z" }, "category": [ { "scheme": "http://schemas.google.com/spreadsheets/2006", "term": "http://schemas.google.com/spreadsheets/2006#list" } ], "title": { "type": "text", "$t": "Sheet1" }, "link": [ { "rel": "alternate", "type": "application/atom+xml", "href": "https://docs.google.com/spreadsheets/d/YOUR_SECRET_SHEET_LINK_ID/pubhtml" }, { "rel": "http://schemas.google.com/g/2005#feed", "type": "application/atom+xml", "href": "https://spreadsheets.google.com/feeds/list/YOUR_SECRET_SHEET_LINK_ID/od6/public/values" }, { "rel": "http://schemas.google.com/g/2005#post", "type": "application/atom+xml", "href": "https://spreadsheets.google.com/feeds/list/YOUR_SECRET_SHEET_LINK_ID/od6/public/values" }, { "rel": "self", "type": "application/atom+xml", "href": "https://spreadsheets.google.com/feeds/list/YOUR_SECRET_SHEET_LINK_ID/od6/public/values?alt=json" } ], "author": [ { "name": { "$t": "bwente" }, "email": { "$t": "bwente@email.com" } } ], "openSearch$totalResults": { "$t": "3" }, "openSearch$startIndex": { "$t": "1" }, "entry": [ { "id": { "$t": "https://spreadsheets.google.com/feeds/list/YOUR_SECRET_SHEET_LINK_ID/od6/public/values/cokwr" }, "updated": { "$t": "2017-08-14T03:28:11.565Z" }, "category": [ { "scheme": "http://schemas.google.com/spreadsheets/2006", "term": "http://schemas.google.com/spreadsheets/2006#list" } ], "title": { "type": "text", "$t": "How you doing?" }, "content": { "type": "text", "$t": "morning: Good morning, sunshine!, afternoon: Hitting your stride!, evening: You made someone smile today, I know it." }, "link": [ { "rel": "self", "type": "application/atom+xml", "href": "https://spreadsheets.google.com/feeds/list/YOUR_SECRET_SHEET_LINK_ID/od6/public/values/cokwr" } ], "gsx$anytime": { "$t": "How you doing?" }, "gsx$morning": { "$t": "Good morning, sunshine!" }, "gsx$afternoon": { "$t": "Hitting your stride!" }, "gsx$evening": { "$t": "You made someone smile today, I know it." } }, { "id": { "$t": "https://spreadsheets.google.com/feeds/list/YOUR_SECRET_SHEET_LINK_ID/od6/public/values/cpzh4" }, "updated": { "$t": "2017-08-14T03:28:11.565Z" }, "category": [ { "scheme": "http://schemas.google.com/spreadsheets/2006", "term": "http://schemas.google.com/spreadsheets/2006#list" } ], "title": { "type": "text", "$t": "Row: 3" }, "content": { "type": "text", "$t": "morning: Who needs coffee when you have your smile?, afternoon: You are making a difference!, evening: You are making a difference." }, "link": [ { "rel": "self", "type": "application/atom+xml", "href": "https://spreadsheets.google.com/feeds/list/YOUR_SECRET_SHEET_LINK_ID/od6/public/values/cpzh4" } ], "gsx$anytime": { "$t": "" }, "gsx$morning": { "$t": "Who needs coffee when you have your smile?" }, "gsx$afternoon": { "$t": "You are making a difference!" }, "gsx$evening": { "$t": "You are making a difference." } }, { "id": { "$t": "https://spreadsheets.google.com/feeds/list/YOUR_SECRET_SHEET_LINK_ID/od6/public/values/cre1l" }, "updated": { "$t": "2017-08-14T03:28:11.565Z" }, "category": [ { "scheme": "http://schemas.google.com/spreadsheets/2006", "term": "http://schemas.google.com/spreadsheets/2006#list" } ], "title": { "type": "text", "$t": "Row: 4" }, "content": { "type": "text", "$t": "morning: Go get 'em, Tiger!, afternoon: You're more fun than bubble wrap!, evening: The day was better for your efforts." }, "link": [ { "rel": "self", "type": "application/atom+xml", "href": "https://spreadsheets.google.com/feeds/list/YOUR_SECRET_SHEET_LINK_ID/od6/public/values/cre1l" } ], "gsx$anytime": { "$t": "" }, "gsx$morning": { "$t": "Go get 'em, Tiger!" }, "gsx$afternoon": { "$t": "You're more fun than bubble wrap!" }, "gsx$evening": { "$t": "The day was better for your efforts." } } ] } }
-
Hi, where did you write this code ? When I try write on “compliments.js” my console does not recognize ‘require’ tag. Could you please share fullcode ?
-
@emrah_asl the modulename.js does not allow require(). as it runs inside the browser. anything needing require() must be done in the node_helper.js, and the two parts must send data back and forth with socketNotifications per the mm spec.
-
Hi @sdetweil thanks I missed up
, so what should I customize compliment.js ?
Here is my change on compliement.js
remoteFile: "remotefile.json",
I created my json link and create node_helper.js file and put my folder with these codes.
But I think I missed somethings, it doesn’t work, and there is no file creation on folder called “remotefile.json”
-
@emrah_asl well, what does the node_helper do? there is a specific structure to that file, as it is a program under mm as part of a module. if u created it as a standalone pgm, then it won’t work like u want.
-
@sdetweil after I created node__helper.js manually, then I typed ‘npm start’ , the file has created, bu this time there was electron error (MM closed) interesting.
-
@emrah_asl yeh, that won’t work
-
@sdetweil so, what is formula to run this ? what do you think acording your experience ?
-
@emrah_asl well, the problem is coming up w something u have the skills to do.
-
so, thinking more.
do you have a js routine that will download the sheet in json and convert to the proper format now? you would execute it with
node ???whatever your script name is???
if so, you could add it to the installers/mm.sh script that is used by pm2 to start mm.
this way every time mm is started, you would download the new compliments file sheet and convert it