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
@import url("https://fonts.googleapis.com/css2?family=Mitr&display=swap"); | |
* { | |
margin: 0; | |
padding: 0; | |
font-family: "Mitr", sans-serif; | |
box-sizing: border-box; | |
} | |
body { |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Thailand Address Search</title> | |
<link rel="stylesheet" href="style.css" /> |
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
const searchInput = document.getElementById("search"); | |
const results = document.getElementById("results"); | |
const lists = document.querySelectorAll("li"); | |
let searchTerm = ""; | |
let thailandAddress; | |
async function fetchAddress() { | |
const url = | |
"<YOUR API Link URL>?sheet=address"; |
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) { | |
const ssURL = "ํYour Google Sheet URL"; | |
const ss = SpreadsheetApp.openByUrl(ssURL); | |
let response = []; | |
const sheetName = e.parameter.sheet; | |
if (sheetName === "address") { |
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
// send email message to line notify | |
function sendMessageToLineNotify(message, accesssToken) { | |
const lineNotifyEndPoint = "https://notify-api.line.me/api/notify"; | |
const options = { | |
"method": "POST", | |
"headers": { | |
"Authorization": "Bearer " + accesssToken, | |
"Content-Type": " application/x-www-form-urlencoded" | |
}, |
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
// get priority unread emails | |
function getPriorityUnreadEmails() { | |
let priorityUnreadEmails = []; | |
// priority inbox unread emails | |
const priorityInboxUnread = GmailApp.getPriorityInboxUnreadCount(); | |
Logger.log("Priority inbox unread : " + priorityInboxUnread); | |
// new priority inbox emails | |
if (priorityInboxUnread) { |
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 main() { | |
// get unread emails from priority contact list | |
const priorityUnreadEmails = getPriorityUnreadEmails(); | |
// if priority unread emails is not empty send emails message to line notify | |
if (priorityUnreadEmails.length !== 0) { | |
priorityUnreadEmails.forEach(unreadEmail => sendMessageToLineNotify(unreadEmail, lineNotifyToken)); | |
} | |
} |
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
// google drive attachments folder id | |
const attachmentFolderId = "Your Google Drive Attachments folder ID"; | |
// line notify access token | |
const lineNotifyToken = "Your LINE Notify Access Token"; | |
// bitly token | |
const bitlyToken = "Your Bitly Token"; | |
// priority contact list emails |
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
pdfMake.fonts = { | |
THSarabunNew: { | |
normal: "THSarabunNew.ttf", | |
bold: "THSarabunNew Bold.ttf", | |
italics: "THSarabunNew Italic.ttf", | |
bolditalics: "THSarabunNew BoldItalic.ttf", | |
}, | |
Roboto: { | |
normal: "Roboto-Regular.ttf", | |
bold: "Roboto-Medium.ttf", |
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
const modal = document.getElementById("imgModal"); | |
const imgages = document.querySelectorAll(".gallery_img"); | |
const modalImg = document.querySelector(".modal-content"); | |
function getImages() { | |
imgages.forEach((src, index) => { | |
src.src = `/images/${index + 1}.jpg`; | |
}); | |
} |
NewerOlder