This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function createstickerpayload(packageId='123',stickerId='123'){ | |
| //create line payload according to https://developers.line.biz/en/reference/messaging-api/#sticker-message | |
| var linepayload = {} | |
| linepayload['type'] = 'sticker' | |
| linepayload['packageId'] = packageId | |
| linepayload['stickerId'] = stickerId | |
| // create botnoi payload format on top of line payload | |
| var botnoipayload = { | |
| "line_payload":[ | |
| linepayload | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function doGet(request){ | |
| //push noti api | |
| var lntoken = request.parameter.lntoken | |
| var messagefrom = request.parameter.messagefrom | |
| var message = request.parameter.message | |
| message = '\nmessage from: '+messagefrom+'\n\nmessage: '+message | |
| var result = sendLineNotify(lntoken,message) | |
| result = JSON.stringify(result); | |
| return ContentService.createTextOutput(result).setMimeType(ContentService.MimeType.JSON); | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function getmultipleflex(mlist,ncol=3) { | |
| //let ncol = 3 | |
| let nrow = Math.floor(mlist.length/ncol) | |
| Logger.log(ncol) | |
| Logger.log(nrow) | |
| let lpayloadList = [] | |
| for (i = 0; i < nrow; i++){ | |
| let mltemp = [] | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function getproductdata(category='ข้าวจานเดียว'){ | |
| var sheeturl = 'https://docs.google.com/spreadsheets/d/14pizU99vniqfIuDiJo4QKfg_c00KS723NwLA0QQ5sbE/edit?usp=sharing' | |
| var sheetname = 'สินค้า' | |
| var psheet = gspandas.gsdataframe(sheeturl,sheetname) | |
| var pinfo = psheet.getrowdict('หมวด',category) | |
| //Logger.log(pinfo) | |
| return pinfo | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | gspandas id -> 1IITpJn58pMjlJ8M-KqVinnbQAyEGcYy5m44vo1gHfh7_Hvs-TKDESE5C | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | for i in range(iter): | |
| h = w * x | |
| dj_by_dw = np.mean((h - y) * x) | |
| w = w - alpha * dj_by_dw | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function doGet(request){ | |
| // Change Spread Sheet url | |
| var ss = SpreadsheetApp.openByUrl("your sheet"); | |
| var sheet = ss.getActiveSheet(); | |
| var total = sheet.getRange(sheet.getLastRow(), sheet.getLastColumn()).getValue(); | |
| var jo = {}; | |
| jo.result = total | |
| var result = JSON.stringify(jo); | |
| return ContentService.createTextOutput(result).setMimeType(ContentService.MimeType.JSON); | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | if msgType == "location": | |
| lat = event["message"]["latitude"] | |
| lng = event["message"]["longitude"] | |
| txtresult = handle_location(lat,lng,casedata,3) | |
| replyObj = TextSendMessage(text=msg) | |
| line_bot_api.reply_message(rtoken, replyObj) |