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
// fork from https://gist.github.com/takien/4077195 | |
function YouTubeGetID(url){ | |
var ID = ''; | |
url = url.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/); | |
if(url[2] !== undefined) { | |
ID = url[2].split(/[^0-9a-z_\-]/i); | |
ID = ID[0]; | |
} | |
else { | |
ID = url.toString(); |
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
exports.sendNewsMessagePromise = (id, res) => { | |
const resData = res.extractorData.data[0].group; | |
const newResults = resData.map(function(item) { | |
return { | |
title: item.titleText[0].text, | |
buttons: [{ | |
type: "web_url", | |
url: item.titleLink[0].href, | |
title: '看詳情', | |
}] |
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 GEO_LOCATION = { | |
watchID: null, | |
callback: null | |
}; | |
GEO_LOCATION.mySpot = function(position){ | |
var lat = (position.coords) ? new String(position.coords.latitude) : position.x; | |
var lon = (position.coords) ? new String(position.coords.longitude) : position.y; | |
return GEO_LOCATION.callback(lat, lon); | |
} |
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 org.sample.pubsub | |
import com.redis._ | |
import akka.actor.ActorSystem | |
import akka.actor.Actor._ | |
import akka.actor.Props | |
object Sub { | |
val actorSystem = ActorSystem("PubSubActorSystem") | |
println("starting subscription service...") |
NewerOlder