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
package com.example.fcm; | |
import android.app.Notification; | |
import android.app.NotificationManager; | |
import android.app.PendingIntent; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.graphics.Color; |
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> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0,viewport-fit=cover"> | |
<title>LIFF Plugin</title> | |
<link rel="stylesheet" href="css/plugin.css"> | |
</head> | |
<body> | |
<div id="container"> |
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
class BMIPlugin { | |
constructor() { | |
this.name = "bmi"; | |
} | |
install(context, option) { | |
return { | |
today: this.localDate(context.liff.getLanguage(), option.date), | |
greet: this.greeting, | |
cal: this.calculate |
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> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0,viewport-fit=cover"> | |
<title>Listing files in Cloud Storage for Firebase</title> | |
<link rel="shortcut icon" href="favicon.ico"> | |
<style> | |
ul { list-style-type: none; padding:0 } | |
li { float: left; width:200px; height:232px; margin:8px; text-align:center; border:1px solid #ddd } |
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 main = async() => { | |
let result = {} | |
let next = '' | |
const valueArray = [] | |
let round = 0 | |
do { | |
result = await getFollowerIds(next) | |
for (const userId of result.userIds) { | |
valueArray.push(userId) |
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 main = async() => { | |
const valueArray = [] | |
let result = {} | |
let next = '' | |
// 23794 คือค่า targetedReaches ที่ได้มาจาก Get Number of Followers API | |
const rounds = Math.ceil(23794/1000); | |
for (i = 0; i < rounds; i++) { | |
result = await getFollowerIds(next) |
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 main = async() => { | |
const valueArray = [] | |
let result = {} | |
let next = '' | |
let round = 0 | |
while(next != undefined) { | |
result = await getFollowerIds(next) | |
for (const userId of result.userIds) { | |
valueArray.push(userId) |
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 axios = require('axios') | |
const LINE_MESSAGING_API = "https://api.line.me/v2/bot" | |
const LINE_HEADER = { | |
"Content-Type": "application/json", | |
Authorization: `Bearer ${config.CHANNEL_ACCESS_TOKEN}` | |
} | |
const getFollowerIds = async(next) => { | |
try { | |
const json = await axios({ |
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": "text", | |
"text": "เชื่อว่านักพัฒนาที่เป็นแฟนพันธุ์แท้ของ LINE ต่างรอคอยการมาของฟีเจอร์ใหม่ๆใน Flex Message เพื่อมาเติมเต็มจินตนาการในการแสดงผลข้อความใน LINE แบบ \"Think out of the box\" ทั้งการส่งผ่าน LINE Chatbot ก็ดี หรือส่งผ่าน LIFF app ก็เกร๋\n\nสำหรับใครที่เปิดมาเจอบทความนี้ แล้วได้ยินคำว่า Flex Message เป็นครั้งแรก ก็อยากแนะนำให้ไปทำความรู้จักกับความสามารถของมันที่บทความนี้ก่อนนะครับ", | |
"wrap": true, |
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": "box", | |
"layout": "horizontal", | |
"contents": [ |