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 doRequestAndCreateSchedule(){ | |
createTrigger(); | |
doRequest(); | |
} |
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 createTrigger(){ | |
deleteAllTrigger(); | |
ScriptApp.newTrigger("doRequest") | |
.timeBased() | |
.after(5 * 60 * 1000) | |
.create(); | |
} |
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 doRequest(){ | |
var response = UrlFetchApp.fetch("https://api.bitkub.com/api/market/ticker"); | |
var body = JSON.parse(response); | |
const {last} = body.THB_XRP; | |
if(last > 11){ | |
// sendLineNotify(last); | |
Logger.log(`push notification XRP: ${last}`); | |
} | |
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 sendLineNotify(value) { | |
var messages = { | |
"message": `ราคา XRP น้อยกว่า 11, ราคาปัจจุบัน ${value}` | |
}; | |
var url = "https://notify-api.line.me/api/notify"; | |
var token = "ใส่ line noti token"; | |
var options = { | |
"method": "post", |
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 deleteAllTrigger() { | |
var triggers = ScriptApp.getProjectTriggers(); | |
for (var i = 0; i < triggers.length; i++) { | |
ScriptApp.deleteTrigger(triggers[i]); | |
} | |
} |
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
let sum = 0; | |
$("html body app-root app-layouts div app-history div div table tbody tr").each((d,i)=>{ | |
sum += +i.lastElementChild.textContent | |
}) | |
console.log(sum) |
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
#!/usr/bin/env bash | |
#inside docker container | |
HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') | |
CONTAINER_IP=$(curl "$HOST_IP:8000" 2>/dev/null) | |
echo "container ip is $CONTAINER_IP" |
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
let cards = []; | |
let amountOfCard = 7; | |
multiple = 1; | |
cards.push([1]); | |
for (let i = 1; i < amountOfCard; i++) { | |
// create main number | |
// create card | |
multiple = multiple * 2; | |
let prepare = multiple; |
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
let data1 = [] | |
let data2 = [] | |
//let data3 = data1.concat(data2); | |
let uqi = data2.filter(data=>{ | |
return !data1.find(x=>x.courseId == data.courseId) | |
}) | |
let data3 = data1.concat(uqi) |
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 header = Array(); | |
var jsonData = {}; | |
var temp_courseId,temp_coureCode,temp_courseName; | |
var courseObject = []; | |
$("html body table tbody tr td table tbody tr td font").each(function (i, v) { | |
if ($(this).attr("size") == "2") { | |
let data = $(this).first().context.textContent; | |
if (data.length < 15) { | |
let url = $(this).context.innerHTML | |
let arrObj = url.split("&"); |