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
async function pushpollen() { | |
//Firebaseから位置情報データを受ける | |
let locationsRef = db.collection('locations'); | |
let alllocations = locationsRef.get() | |
.then(snapshot => { | |
snapshot.forEach(doc => { | |
console.log(doc.id, '=>', doc.data()); | |
let lineId = doc.data().line_user_id; | |
let userlat = doc.data().latitude; | |
let userlong = doc.data().longitude; |
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
//飛散予測をプッシュする関数pushpollen() | |
let lineId,user_id; | |
let userlat, userlong; | |
async function pushpollen(userlat,userlong ) { | |
//Firebaseから位置情報データを受ける | |
let usersRef = db.collection('users'); | |
//usersから全てのline_user_idを取得 | |
let allusers = usersRef.get() | |
.then(snapshot => { | |
snapshot.forEach(doc => { |
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
async function pushpollen(userlat,userlong ) { | |
//Firebaseから位置情報データを受ける | |
let usersRef = db.collection('users'); | |
//usersから全てのline_user_idを取得 | |
let allusers = usersRef.get() | |
.then(snapshot => { | |
snapshot.forEach(doc => { | |
// console.log(doc.id, '=>', doc.data()); | |
user_id = doc.id | |
lineId = doc.data().line_user_id; |
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
async function pushpollen(user_id,) { | |
//Firebaseから位置情報データを受ける | |
let locationsRef = db.collection('locations'); | |
let doc1 = await locationsRef.doc(user_id).get(); | |
let usersRef = db.collection('users'); | |
let doc2 = await usersRef.doc(user_id).get(); | |
let location; | |
let user; | |
if (doc1.exists) { | |
location = doc1.data(); |
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
'use strict'; | |
require('dotenv').config(); | |
const express = require('express'); | |
const line = require('@line/bot-sdk'); | |
const PORT = process.env.PORT || 3000; | |
const config = { | |
channelSecret: process.env.CHANNEL_SECRET, | |
channelAccessToken: process.env.CHANNEL_ACCESS_TOKEN | |
}; |
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
'use strict'; | |
// Firebase ///////////////////////////////// | |
var admin = require("firebase-admin"); | |
// var pushweather = require('./pushweather'); | |
// var pushmedicine = require('./pushmedicine'); | |
// var pushseverity = require('./pushseverity'); |
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
'use strict'; | |
// Firebase ///////////////////////////////// | |
var admin = require("firebase-admin"); | |
// var pushweather = require('./pushweather'); | |
// var pushmedicine = require('./pushmedicine'); | |
// var pushseverity = require('./pushseverity'); |
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 pushweather() { | |
//配信対象のuseridを取得 | |
let userRef2 = db.ref("user"); | |
let positionRef2 = db.ref("position"); | |
userRef2.once('value').then(function(dataSnapshot) { | |
if (dataSnapshot.val() == undefined || dataSnapshot.val().userid) { | |
return; | |
} | |
// console.log(dataSnapshot.val()); | |
let items = Object.values(dataSnapshot.val());//オブジェクト(値)の配列が出来る |
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
'use strict'; | |
// Firebase ///////////////////////////////// | |
var admin = require("firebase-admin"); | |
// var pushweather = require('./pushweather'); | |
// var pushmedicine = require('./pushmedicine'); | |
// var pushseverity = require('./pushseverity'); |
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
'use strict'; | |
// Firebase ///////////////////////////////// | |
var admin = require("firebase-admin"); | |
// var pushweather = require('./pushweather'); | |
// var pushmedicine = require('./pushmedicine'); | |
// var pushseverity = require('./pushseverity'); |
NewerOlder