This file contains 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 sendMsg() { | |
let token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" //token ที่ได้จาก line notify | |
let message = 'This is message sent form NotifyApp Library' | |
NotifyApp.sendNotify(token,message) | |
} |
This file contains 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 onOpen() { | |
let ui = SpreadsheetApp.getUi() | |
ui.createMenu("PDF") | |
.addItem("สร้าง PDF", "pdfForm") | |
.addItem("สร้าง PDF ทั้งหมด", "pdfFormAll") | |
.addToUi() | |
} | |
function pdfFormAll(){ | |
let docId = 'ID ของ Google Docs'; | |
let sheetId = 'ID ของ Google Spreadsheet'; |
This file contains 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 scraper() { | |
let ss = SpreadsheetApp.openById('1dXDdhTG-3ppO5ybMPTocrkO2y4T222zC1iVCVZuLfIg') | |
let sheets = ss.getSheets() | |
if (sheets.length > 1) { | |
sheets.forEach(function a(s) { | |
if (s.getRange(1, 1).getValue() == '') ss.deleteSheet(s) | |
}) | |
} | |
let reglevel = /<divclass="hidden-xssm-small\b\S+?\bdiv>/gm |
This file contains 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 onSubmit() { | |
let ss = SpreadsheetApp.getActiveSpreadsheet() | |
let sheet = ss.getSheetByName("Form responses 1") | |
let sheetData = sheet.getRange(sheet.getLastRow(), 1, 1, sheet.getLastColumn()).getDisplayValues() | |
let date = sheetData[0][0] | |
let name = sheetData[0][1] | |
let level = sheetData[0][2] |
This file contains 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(e) { | |
var op = e.parameter.action; | |
var ss = SpreadsheetApp.openByUrl("ใส่ url ชีต"); | |
var sheet = ss.getSheetByName("ใส่ชื่อแผ่นงาน"); | |
if (op == "insert") | |
return insert_value(e, sheet); | |
if (op == "read") |
This file contains 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 myFunction() { | |
var id = '102005004' //รหัสสมมุติ | |
var ss = SpreadsheetApp.getActiveSpreadsheet() | |
var sheet = ss.getSheetByName('Sheet1') // เรียกชีทที่เราต้องการออกมาครับ | |
var data = sheet.getDataRange().getDisplayValues() // รับข้อมูลทั้งหมดในชีท ไปไว้ในตัวแปร data (เป็น array) นะครับ แบบนี้ [[แถวที่1เซล1,แถวที่1เซล2,...],[แถวที่2เซล1,แถวที่2เซล2,...],...] | |
//วิ่งหาใน data ก่อนรอบนึง ถ้าเจอข้มููลที่ตรงกับ id ก็เอาเลขของแถวมาเก็บในตัวแปร filterData ซึ่งก็เป็น array เหมือนกันครับ แต่ผมที่ได้คือใน array นี้ จะมีแต่แถวที่ตรงกับ id ครับ | |
var filterData = data.filter(function a(row) { |
This file contains 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
var token = [token1,token2,token3] //ใส่ token แต่ละกลุ่มแทน token1 2 3..... | |
for(var i in token){ | |
var options = { | |
"method": "post", | |
"payload": "ข้อความ", | |
"headers": { | |
"Authorization": "Bearer " + token[i] | |
} | |
}; | |
UrlFetchApp.fetch("https://notify-api.line.me/api/notify", options); |
This file contains 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 doPost(e) { | |
var data = JSON.parse(e.postData.contents) | |
var intentName = data.queryResult.intent.displayName | |
var result | |
if (intentName == "studentID") { | |
result = gradeBOT(data) | |
} else { | |
result = timeTableBOT(data) | |
} |
This file contains 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
{ | |
"type": "bubble", | |
"body": { | |
"type": "box", | |
"layout": "vertical", | |
"contents": [ | |
{ | |
"type": "image", | |
"url": "https://drive.google.com/uc?export=view&id=1olPS5GDsbzJzaNN7rrKZ_hMZob8rMuuc", | |
"size": "full" |
This file contains 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
{ | |
"type": "bubble", | |
"body": { | |
"type": "box", | |
"layout": "vertical", | |
"contents": [ | |
{ | |
"type": "image", | |
"url": "https://drive.google.com/uc?export=view&id=1olPS5GDsbzJzaNN7rrKZ_hMZob8rMuuc", | |
"size": "full" |