Initial import from local backup (Documents-Playground/pakerpale)
This commit is contained in:
102
src/LocalClient.js
Normal file
102
src/LocalClient.js
Normal file
@@ -0,0 +1,102 @@
|
||||
const fetch = require("node-fetch")
|
||||
|
||||
|
||||
|
||||
|
||||
class LocalClient {
|
||||
|
||||
constructor() {
|
||||
this.localhost = 'http://localhost:21117'
|
||||
}
|
||||
|
||||
getToken() {
|
||||
return fetch(this.localhost + '/key', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
saveChtodayNews(data) {
|
||||
return fetch(this.localhost + '/article', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data),
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
saveYoutubeVideo(data) {
|
||||
return fetch(this.localhost + '/youtube', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data),
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
saveYoutubeVideoCuration(data) {
|
||||
return fetch(this.localhost + '/youtube/curation', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data),
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
}).then(res => res.text())
|
||||
}
|
||||
|
||||
deleteYoutubeVideoCuration(data) {
|
||||
return fetch(this.localhost + '/youtube/delete', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data),
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
}).then(res => res.text())
|
||||
}
|
||||
|
||||
getYoutubeVideo(data) {
|
||||
return fetch(this.localhost + '/youtube/video', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data),
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
savePodbbangStation(data) {
|
||||
return fetch(this.localhost + '/pod/station', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data),
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
saveNaverPlace(data) {
|
||||
return fetch(this.localhost + '/place/save', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data),
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
getChannel() {
|
||||
return fetch(this.localhost + '/youtube/channel', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
}).then(res => res.json())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module.exports = new LocalClient;
|
||||
27
src/Naver.js
Normal file
27
src/Naver.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const cheerio = require('cheerio')
|
||||
, fetch = require("node-fetch")
|
||||
, naverPlace = require("./naverPlace")
|
||||
|
||||
|
||||
|
||||
|
||||
class Place {
|
||||
|
||||
constructor() {
|
||||
this.remotehost = 'https://api.place.naver.com'
|
||||
}
|
||||
|
||||
getData(params) {
|
||||
naverPlace[0].variables.input.start = params.start
|
||||
return fetch(this.remotehost + '/place/graphql', {
|
||||
body: JSON.stringify(naverPlace),
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
}).then(res => res.json())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module.exports = {place:new Place};
|
||||
23
src/NewsFeed.js
Normal file
23
src/NewsFeed.js
Normal file
@@ -0,0 +1,23 @@
|
||||
const cheerio = require('cheerio')
|
||||
, fetch = require("node-fetch")
|
||||
|
||||
|
||||
|
||||
|
||||
class CtNews {
|
||||
|
||||
constructor() {
|
||||
this.remotehost = 'http://retreatcenter.christiantoday.co.kr'
|
||||
}
|
||||
|
||||
getLatest(token) {
|
||||
return fetch(this.remotehost + '/app/feed/article', {
|
||||
headers: {
|
||||
ctaccesstoken: token
|
||||
}
|
||||
}).then(res => res.json())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module.exports = {ct:new CtNews};
|
||||
59
src/Podbbang.js
Normal file
59
src/Podbbang.js
Normal file
@@ -0,0 +1,59 @@
|
||||
const cheerio = require('cheerio')
|
||||
, fetch = require("node-fetch")
|
||||
, TimeAgo = require('javascript-time-ago')
|
||||
, ko = require('javascript-time-ago/locale/ko')
|
||||
, fs = require('fs');
|
||||
|
||||
class Podbbang {
|
||||
|
||||
constructor() {
|
||||
this.remotehost = 'http://192.168.6.63:8050/execute'
|
||||
TimeAgo.addLocale(ko)
|
||||
this.timeAgo = new TimeAgo('ko-KR')
|
||||
}
|
||||
|
||||
getLatest(params) {
|
||||
return fetch(this.remotehost, {
|
||||
body: JSON.stringify(params),
|
||||
method: 'POST',
|
||||
timeout: 3000000,
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
}).then(res => res.text()).then(async body => {
|
||||
// console.log($(".podcast-list li a.title").text())
|
||||
|
||||
// fs.writeFile("podbbang.html", body, function (err) {
|
||||
// if (err) {
|
||||
// return console.log(err);
|
||||
// }
|
||||
// console.log("The file was saved!");
|
||||
// });
|
||||
let doc = cheerio.load(body)
|
||||
|
||||
|
||||
let data = []
|
||||
let studio = {}
|
||||
doc(".podcast-list li").map((k, v) => {
|
||||
studio = {}
|
||||
studio.Image = doc(v).find('.thumb img').attr('src')
|
||||
studio.Title = doc(v).find('.title').text()
|
||||
studio.Link = doc(v).find('.title').attr('href')
|
||||
studio.Description = doc(v).find('.description').text()
|
||||
studio.UpdatedAtStr = ((a) => {
|
||||
studio.UpdatedAt = Date.now() - Math.abs(a) * 3600000
|
||||
return this.timeAgo.format(studio.UpdatedAt)
|
||||
})(doc(v).find('.updated-at').text().match(/\d+/)[0] - 8)
|
||||
studio.Likes = doc(v).find('.likes dd').text()
|
||||
studio.Subscribes = doc(v).find('.subscribes dd').text()
|
||||
data.push(studio)
|
||||
})
|
||||
// console.log(data)
|
||||
return data
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module.exports = new Podbbang;
|
||||
253
src/Service.js
Normal file
253
src/Service.js
Normal file
@@ -0,0 +1,253 @@
|
||||
const newsFeed = require('./NewsFeed'),
|
||||
localClient = require('./LocalClient'),
|
||||
youtubeClient = require("./YoutubeServiceClient"),
|
||||
targetChannels = require("./targetChannels"),
|
||||
podbbang = require("./Podbbang"),
|
||||
naver = require('./Naver'),
|
||||
logger = require('logops');
|
||||
|
||||
|
||||
class Service {
|
||||
|
||||
constructor() {
|
||||
this.init()
|
||||
}
|
||||
|
||||
shuffle(a) {
|
||||
for (let i = a.length - 1; i > 0; i--) {
|
||||
const j = Math.floor(Math.random() * (i + 1));
|
||||
[a[i], a[j]] = [a[j], a[i]];
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
async init() {
|
||||
// await localClient.getChannel().then(res => {
|
||||
// targetChannels.map(targetChannel => {
|
||||
// targetChannel.youtubeChannels = []
|
||||
// res.data.map(cm => {
|
||||
// if (cm.CategoryId == targetChannel.cmCategoryId) {
|
||||
// targetChannel.youtubeChannels.push({
|
||||
// title: cm.EditorName,
|
||||
// url: cm.YtChannelId,
|
||||
// editor: cm.EditorId
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// console.log(JSON.stringify(targetChannels))
|
||||
// this.targetChannels = targetChannels
|
||||
}
|
||||
|
||||
getNaverPlaceChurch(params) {
|
||||
if (params.page == 'auto' || params.auto == true) {
|
||||
params.page = params.page == 'auto' ? 0 : params.page
|
||||
if (86518 > params.page * 30 + 50000) {
|
||||
return naver.place.getData({ start: params.page * 30 + 50000 }).then(body => localClient.saveNaverPlace(body)).then(localRes => {
|
||||
params.page++
|
||||
params.auto = true
|
||||
this.getNaverPlaceChurch(params)
|
||||
return localRes
|
||||
})
|
||||
}
|
||||
} else {
|
||||
return naver.place.getData({ start: page * 30 + 1 }).then(body => localClient.saveNaverPlace(body))
|
||||
}
|
||||
}
|
||||
|
||||
getChtodayNews() {
|
||||
return localClient.getToken().then(body => newsFeed.ct.getLatest(body.token).then(body => localClient.saveChtodayNews(body)))
|
||||
}
|
||||
|
||||
youtubeVideoStats(loops = 250) {
|
||||
for (var i = 0; i < loops; i++) {
|
||||
localClient.getYoutubeVideo({
|
||||
"offset": i * 10,
|
||||
"limit": 10
|
||||
}).then(data => {
|
||||
if (data.data.length) {
|
||||
let promises = []
|
||||
data.data.map((v, k) => {
|
||||
promises.push(youtubeClient.getVideo(v.VideoId, {
|
||||
"part": "statistics"
|
||||
}))
|
||||
})
|
||||
Promise.all(promises).then(data => {
|
||||
let yt = { deleted: [], videos: [] }
|
||||
data.map((body, k) => {
|
||||
if (body.code == 200) {
|
||||
yt.videos.push({
|
||||
VideoId: body.data.id,
|
||||
Likes: body.data.raw.statistics.likeCount,
|
||||
Views: body.data.raw.statistics.viewCount,
|
||||
Comments: body.data.raw.statistics.commentCount,
|
||||
Subscribes: body.data.raw.statistics.favoriteCount
|
||||
})
|
||||
} else {
|
||||
logger.info(body.message)
|
||||
if (body.code == 404) {
|
||||
yt.deleted.push({ VideoId: body.data.id })
|
||||
}
|
||||
}
|
||||
})
|
||||
return yt;
|
||||
}).then(yt => {
|
||||
localClient.saveYoutubeVideoCuration({ action: 'update', videos: yt.videos })
|
||||
.then(body => console.log('Update video result :', body))
|
||||
if (yt.deleted.length) {
|
||||
localClient.deleteYoutubeVideoCuration({ action: 'delete', videos: yt.deleted })
|
||||
.then(body => console.log('Delete video result :', body))
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
getVideoByChannelId(channel) {
|
||||
if (channel.indexOf('UC') > -1) {
|
||||
youtubeClient.getRecentVideo({
|
||||
"limit": 20,
|
||||
"order": "date",
|
||||
"channelId": channel
|
||||
}).then(body => {
|
||||
res.json(body)
|
||||
})
|
||||
} else {
|
||||
// channel user custom name
|
||||
youtubeClient.getChannel({
|
||||
"forUsername": channel
|
||||
}).then(body => {
|
||||
youtubeClient.getRecentVideo({
|
||||
"limit": 20,
|
||||
"order": "date",
|
||||
"channelId": body.id
|
||||
}).then(body => {
|
||||
res.json(body)
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
checkVideoDeleted(req, res) {
|
||||
youtubeClient.getVideo(req.params.id, {
|
||||
"part": "statistics"
|
||||
}).then(data => {
|
||||
if (data.code == 403) {
|
||||
res.json({ code: 200, message: 'Daily Limit Exceeded' })
|
||||
} else if (data.code == 404) {
|
||||
localClient.deleteYoutubeVideoCuration({ action: 'delete', videos: [{ VideoId: req.params.id }] }).then(body => res.send(body))
|
||||
} else res.json({ code: 200, data: data })
|
||||
})
|
||||
}
|
||||
|
||||
getPlaylistVideo() {
|
||||
let videoCount = 0;
|
||||
targetChannels.forEach((category) => {
|
||||
category.youtubeChannels.forEach((yt) => {
|
||||
let ytChannel = yt.url.split('/').pop()
|
||||
if (ytChannel.indexOf('playlist') > -1) {
|
||||
let ytPlaylist = ytChannel.split('=').pop()
|
||||
youtubeClient.getPlaylistItem(ytPlaylist, {
|
||||
"part": "snippet",
|
||||
"maxResults": 100
|
||||
}).then(body => {
|
||||
if (!body.code) {
|
||||
let data = {
|
||||
categoryTitle: yt.subcat,
|
||||
videos: body
|
||||
}
|
||||
videoCount = videoCount + body.length
|
||||
localClient.saveYoutubeVideoCuration(data)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
getChannelVideo(singleChannel) {
|
||||
let videoCount = 0;
|
||||
targetChannels.forEach((category) => {
|
||||
this.shuffle(category.youtubeChannels).forEach((yt) => {
|
||||
let ytChannel = yt.url.split('/').pop()
|
||||
if (ytChannel.indexOf('UC') > -1) {
|
||||
if (typeof singleChannel == 'undefined' || (typeof singleChannel != 'undefined' && ytChannel == singleChannel)) {
|
||||
this.requestYtAndSave(category, yt, ytChannel)
|
||||
}
|
||||
} else {
|
||||
youtubeClient.getChannel({
|
||||
"forUsername": ytChannel
|
||||
}).then(body => {
|
||||
if (body.id) {
|
||||
if (typeof singleChannel == 'undefined' || (typeof singleChannel != 'undefined' && body.id == singleChannel)) {
|
||||
this.requestYtAndSave(category, yt, body.id)
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
requestYtAndSave(category, yt, channelId) {
|
||||
youtubeClient.getRecentVideo({
|
||||
limit: 120,
|
||||
order: "date",
|
||||
// videoEmbeddable: true,
|
||||
channelId: channelId
|
||||
}).then(channelVideos => {
|
||||
if (Array.isArray(channelVideos)) {
|
||||
let promises = []
|
||||
channelVideos.map((v, k) => {
|
||||
promises.push(youtubeClient.getVideo(v.id, {
|
||||
"part": "snippet"
|
||||
}))
|
||||
})
|
||||
Promise.all(promises).then(data => {
|
||||
data.map((body, k) => {
|
||||
if (body.code == 200) {
|
||||
for (let j in channelVideos) {
|
||||
if (body.data.id == channelVideos[j].id) {
|
||||
channelVideos[j].description = body.data.description;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
return channelVideos
|
||||
}).then(channelVideos => {
|
||||
localClient.saveYoutubeVideo({
|
||||
categoryId: category.cmCategoryId,
|
||||
categoryTitle: category.cmCategoryTitle,
|
||||
editorId: yt.editor,
|
||||
videos: channelVideos
|
||||
}).then(body => logger.info(body))
|
||||
})
|
||||
} else {
|
||||
console.log('No recent videos from youtube API with ' + JSON.stringify(yt))
|
||||
console.log('Instead received data is ' + channelVideos)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
getPodbbangChristianRecent(params, scrolls = 100) {
|
||||
params = params ? params : {
|
||||
"timeout": 3600,
|
||||
"timezone": "Asia/Seoul",
|
||||
"lua_source": "function main(a,b)a.images_enabled=false;a:go('http://www.podbbang.com/categories/1033?sort=update')for c=0," + scrolls + ",1 do a.scroll_position={y=200000}a:wait(1.5)end;a:set_result_content_type('text/html; charset=utf-8')return a:html()end"
|
||||
}
|
||||
return podbbang.getLatest(params).then(body => localClient.savePodbbangStation(body))
|
||||
}
|
||||
|
||||
responseKey(callback) {
|
||||
return (err, stdout, stderr) => {
|
||||
callback(JSON.parse(stdout))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
module.exports = new Service
|
||||
45
src/YoutubeServiceClient.js
Normal file
45
src/YoutubeServiceClient.js
Normal file
@@ -0,0 +1,45 @@
|
||||
const fetch = require("node-fetch")
|
||||
|
||||
class YoutubeClient {
|
||||
|
||||
constructor() {
|
||||
this.host = 'http://localhost:20116'
|
||||
}
|
||||
|
||||
getChannel(body) {
|
||||
return fetch(this.host + '/v1/search.channel', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(body),
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
getPlaylistItem(id, body) {
|
||||
return fetch(this.host + '/v1/search.playlist/' + id, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(body),
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
getRecentVideo(body) {
|
||||
this.channels
|
||||
return fetch(this.host + '/v1/search.video', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(body),
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
getVideo(id, body) {
|
||||
this.channels
|
||||
return fetch(this.host + '/v1/search.video/' + id, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(body),
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
}).then(res => res.json())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module.exports = new YoutubeClient;
|
||||
211
src/lua/channelcached.json
Normal file
211
src/lua/channelcached.json
Normal file
@@ -0,0 +1,211 @@
|
||||
[{
|
||||
"cmCategoryTitle": "찬양",
|
||||
"cmCategoryId": 38,
|
||||
"youtubeChannels": [{
|
||||
"title": "MARKERS WORSHIP",
|
||||
"url": "https://www.youtube.com/channel/UCrnxDS-QclED-ej-MFxr8tA",
|
||||
"editor": "81"
|
||||
},
|
||||
{
|
||||
"title": "Jsus4",
|
||||
"url": "https://www.youtube.com/user/ccmjhoon",
|
||||
"editor": "92"
|
||||
},
|
||||
{
|
||||
"title": "CCM Factory 찬양공방",
|
||||
"url": "https://www.youtube.com/channel/UCXKFYknV16Cg5V2lD84KYeQ\r",
|
||||
"editor": "82"
|
||||
},
|
||||
{
|
||||
"title": "PROSKUNEO WORSHIP",
|
||||
"url": "https://www.youtube.com/channel/UC76QouhhGXEsYG76xf2KtYg\r",
|
||||
"editor": "93"
|
||||
},
|
||||
{
|
||||
"title": "제이어스",
|
||||
"url": "https://www.youtube.com/user/JUSministry",
|
||||
"editor": "80"
|
||||
},
|
||||
{
|
||||
"title": "burning bush",
|
||||
"url": "https://www.youtube.com/channel/UCYl6OOZr2TPb1MvySkokFYw\r",
|
||||
"editor": "95"
|
||||
},
|
||||
{
|
||||
"title": "예수전도단 서울 화요모임",
|
||||
"url": "https://www.youtube.com/channel/UCn5qdSP9lz6BIl4bPwM41qg\r",
|
||||
"editor": "96"
|
||||
},
|
||||
{
|
||||
"title": "RUACh 호흡. CCM Playlist",
|
||||
"url": "https://www.youtube.com/channel/UCJ95HYaEBPMNr9ZK5z_r1sg\r",
|
||||
"editor": "97"
|
||||
},
|
||||
{
|
||||
"title": "Jesus Road_CCM전문채널",
|
||||
"url": "https://www.youtube.com/channel/UCOHrcxpxsL026NiHzafIHzQ\r",
|
||||
"editor": "98"
|
||||
},
|
||||
{
|
||||
"title": "레위지파 뮤직",
|
||||
"url": "https://www.youtube.com/channel/UCaTL5Hq8WdrGKibZ0qNY-LA\r",
|
||||
"editor": "99"
|
||||
},
|
||||
{
|
||||
"title": "버스킹예배자",
|
||||
"url": "https://www.youtube.com/channel/UChtdWlEuS4bOXNAx_B1jbEQ\r",
|
||||
"editor": "100"
|
||||
},
|
||||
{
|
||||
"title": "SARANG ON MUSIC",
|
||||
"url": "https://www.youtube.com/channel/UCbIW7tSUlO0PJosNCKcHCKg\r",
|
||||
"editor": "101"
|
||||
},
|
||||
{
|
||||
"title": "예수전도단 캠퍼스워십",
|
||||
"url": "https://www.youtube.com/channel/UCB6oCUPiiKkXcmjORXe9R6w\r",
|
||||
"editor": "102"
|
||||
},
|
||||
{
|
||||
"title": "홀리조이워십",
|
||||
"url": "https://www.youtube.com/channel/UCijT0yHHmwhmdWuUfZX9Q-w",
|
||||
"editor": "94"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"cmCategoryTitle": "TV방송",
|
||||
"cmCategoryId": 41,
|
||||
"youtubeChannels": [{
|
||||
"title": "극동방송",
|
||||
"url": "https://www.youtube.com/channel/UCTwQ9iAIojmsw_mFlYj54SA\r",
|
||||
"editor": "91"
|
||||
},
|
||||
{
|
||||
"title": "CTS기독교TV",
|
||||
"url": "https://www.youtube.com/channel/UCjpIl-p9sFNPXfcuoU2KS-g\r",
|
||||
"editor": "90"
|
||||
},
|
||||
{
|
||||
"title": "크리스천투데이",
|
||||
"url": "https://www.youtube.com/user/christiantodaynews\r",
|
||||
"editor": "89"
|
||||
},
|
||||
{
|
||||
"title": "기독일보",
|
||||
"url": "https://www.youtube.com/channel/UCLy7KqnLkWNossx66Vw9Nng\r",
|
||||
"editor": "103"
|
||||
},
|
||||
{
|
||||
"title": "아무리 바빠도 가정예배",
|
||||
"url": "https://www.youtube.com/channel/UC7P2lDApo6kvokMDtPomO_g\r",
|
||||
"editor": "104"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"cmCategoryTitle": "말씀/QT",
|
||||
"cmCategoryId": 40,
|
||||
"youtubeChannels": [{
|
||||
"title": "말씀노트",
|
||||
"url": "https://www.youtube.com/channel/UCpek2YxX2YFfw6WAijw3CqQ",
|
||||
"editor": "87"
|
||||
},
|
||||
{
|
||||
"title": "C채널설교",
|
||||
"url": "https://www.youtube.com/user/cchannelsermon",
|
||||
"editor": "86"
|
||||
},
|
||||
{
|
||||
"title": "말씀충전",
|
||||
"url": "https://www.youtube.com/channel/UCWsLHWzNGb2bsmuJbMZjmTA\r",
|
||||
"editor": "88"
|
||||
},
|
||||
{
|
||||
"title": "잘 믿고 잘 사는 법",
|
||||
"url": "https://www.youtube.com/channel/UCRv5biV9lv-yImBR3tj0dIA",
|
||||
"editor": "105"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"cmCategoryTitle": "소셜",
|
||||
"cmCategoryId": 39,
|
||||
"youtubeChannels": [{
|
||||
"title": "말씀의검",
|
||||
"url": "https://www.youtube.com/channel/UCA1KioPB0419qcI_sFqf8gA\r",
|
||||
"editor": "85"
|
||||
},
|
||||
{
|
||||
"title": "worthking",
|
||||
"url": "https://www.youtube.com/channel/UCZi0MJsmUx-8oWn3GZCX6Nw\r",
|
||||
"editor": "84"
|
||||
},
|
||||
{
|
||||
"title": "예믿청TV",
|
||||
"url": "https://www.youtube.com/channel/UCOOhK3ILkKKlokz9Acjk-lg\r",
|
||||
"editor": "106"
|
||||
},
|
||||
{
|
||||
"title": "양치기 소년",
|
||||
"url": "https://www.youtube.com/channel/UCaQahd4t-RHMPy-nHTP2saA\r",
|
||||
"editor": "83"
|
||||
},
|
||||
{
|
||||
"title": "kei is loved",
|
||||
"url": "https://www.youtube.com/channel/UCKye33AihrDsSS_7hsjTQIA\r",
|
||||
"editor": "107"
|
||||
},
|
||||
{
|
||||
"title": "오늘의 신학공부",
|
||||
"url": "https://www.youtube.com/channel/UCOSJRrtx0Gq5Y_SGRRz-3jA\r",
|
||||
"editor": "108"
|
||||
},
|
||||
{
|
||||
"title": "미션라이프",
|
||||
"url": "https://www.youtube.com/channel/UCOLfDu_Bt20rv4r3ULlnuVQ\r",
|
||||
"editor": "109"
|
||||
},
|
||||
{
|
||||
"title": "Damascus TV",
|
||||
"url": "https://www.youtube.com/channel/UCFedtwqkwPCAI5oh1XO2NHA\r",
|
||||
"editor": "112"
|
||||
},
|
||||
{
|
||||
"title": "On the road to Damascus",
|
||||
"url": "https://www.youtube.com/channel/UC779CFbAQK7DYu9rjhTSHOA\r",
|
||||
"editor": "111"
|
||||
},
|
||||
{
|
||||
"title": "오븐 기독교",
|
||||
"url": "https://www.youtube.com/channel/UCr_g7sS1TD4TH5PVdOCyDjw\r",
|
||||
"editor": "113"
|
||||
},
|
||||
{
|
||||
"title": "우군woogoon",
|
||||
"url": "https://www.youtube.com/channel/UCeAycTXCgUAviTvDHmce_3Q\r",
|
||||
"editor": "110"
|
||||
},
|
||||
{
|
||||
"title": "붓소핸섭-ButsoHandsUp",
|
||||
"url": "https://www.youtube.com/channel/UCsD4qHGC9SxK2567sg3V8oQ",
|
||||
"editor": "115"
|
||||
},
|
||||
{
|
||||
"title": "KNOCK노크",
|
||||
"url": "https://www.youtube.com/channel/UClLfeGqYIROod6D_ux7k2wQ",
|
||||
"editor": "116"
|
||||
},
|
||||
{
|
||||
"title": "NAM D",
|
||||
"url": "https://www.youtube.com/channel/UCWgyCh92781HaX_ue0r8Vng\r",
|
||||
"editor": "117"
|
||||
},
|
||||
{
|
||||
"title": "디브리즈 스튜디오",
|
||||
"url": "https://www.youtube.com/channel/UCRnU7eMOyxyYWZ0938VpoDg",
|
||||
"editor": "118"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
13
src/lua/facebook.lua
Normal file
13
src/lua/facebook.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
function main(splash, args)
|
||||
splash.images_enabled = true
|
||||
splash:go('https://m.facebook.com/pg/ilikeyoujesus/posts/?ref=page_internal&mt_nav=0')
|
||||
for i=0,5,1
|
||||
do
|
||||
splash.scroll_position = {y=200000}
|
||||
splash:wait(3)
|
||||
end
|
||||
-- splash:set_result_content_type('text/html; charset=utf-8')
|
||||
-- local title = splash:evaljs('document.title')
|
||||
-- return {title = title}
|
||||
return splash:html()
|
||||
end
|
||||
10
src/lua/plain.js
Normal file
10
src/lua/plain.js
Normal file
@@ -0,0 +1,10 @@
|
||||
(function (selector) {
|
||||
return Array.prototype.slice.call(document.querySelectorAll(selector), 0);
|
||||
})('#pages_msite_body_contents #page_suggestions_on_liking').map(function (el) {
|
||||
return {
|
||||
likes: el.nextSibling.querySelector('.like_def').innerText.match(/\d/g).join(''),
|
||||
comments: el.nextSibling.querySelector('.cmt_def').innerText.match(/\d/g).join(''),
|
||||
date: el.nextSibling.querySelector('abbr').innerText,
|
||||
summary: el.nextSibling.querySelector('header').nextSibling.querySelector('span').innerText
|
||||
};
|
||||
})
|
||||
13
src/lua/podbbang.lua
Normal file
13
src/lua/podbbang.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
function main(splash, args)
|
||||
splash.images_enabled = false
|
||||
splash:go('http://www.podbbang.com/categories/1033?sort=update')
|
||||
for i=0,30,1
|
||||
do
|
||||
splash.scroll_position = {y=200000}
|
||||
splash:wait(1.5)
|
||||
end
|
||||
-- splash:set_result_content_type('text/html; charset=utf-8')
|
||||
-- local title = splash:evaljs('document.title')
|
||||
-- return {title = title}
|
||||
return splash:html()
|
||||
end
|
||||
22
src/naverPlace.js
Normal file
22
src/naverPlace.js
Normal file
@@ -0,0 +1,22 @@
|
||||
const church = [
|
||||
{
|
||||
"operationName": "getPlacesList",
|
||||
"variables": {
|
||||
"input": {
|
||||
"query": "교회",
|
||||
"start": 50000,
|
||||
"display": 30,
|
||||
"adult": false,
|
||||
"spq": false,
|
||||
"queryRank": "",
|
||||
"x": "127.9783880",
|
||||
"y": "35.5666100",
|
||||
"deviceType": "mobile"
|
||||
},
|
||||
"isNmap": false
|
||||
},
|
||||
"query": "query getPlacesList($input: PlacesInput, $isNmap: Boolean!) { places: places(input: $input) { total items { id name category dbType distance roadAddress address commonAddress bookingUrl phone virtualPhone businessHours daysOff imageUrl imageCount x y polyline { departure arrival distance __typename } subwayId markerLabel @include(if: $isNmap) { text style __typename } imageMarker @include(if: $isNmap) { marker markerSelected __typename } oilPrice @include(if: $isNmap) { gasoline diesel lpg __typename } isPublicGas __typename } __typename }}"
|
||||
}
|
||||
]
|
||||
|
||||
module.exports = church;
|
||||
263
src/targetChannels.js
Normal file
263
src/targetChannels.js
Normal file
@@ -0,0 +1,263 @@
|
||||
const targetChannels = [{
|
||||
"cmCategoryTitle": "찬양",
|
||||
"cmCategoryId": 38,
|
||||
"youtubeChannels": [{
|
||||
"title": "MARKERS WORSHIP",
|
||||
"url": "https://www.youtube.com/channel/UCrnxDS-QclED-ej-MFxr8tA",
|
||||
"editor": "81"
|
||||
},
|
||||
{
|
||||
"title": "Jsus4",
|
||||
"url": "https://www.youtube.com/user/ccmjhoon",
|
||||
"editor": "92"
|
||||
},
|
||||
{
|
||||
"title": "CCM Factory 찬양공방",
|
||||
"url": "https://www.youtube.com/channel/UCXKFYknV16Cg5V2lD84KYeQ",
|
||||
"editor": "82"
|
||||
},
|
||||
{
|
||||
"title": "PROSKUNEO WORSHIP",
|
||||
"url": "https://www.youtube.com/channel/UC76QouhhGXEsYG76xf2KtYg",
|
||||
"editor": "93"
|
||||
},
|
||||
{
|
||||
"title": "제이어스",
|
||||
"url": "https://www.youtube.com/user/JUSministry",
|
||||
"editor": "80"
|
||||
},
|
||||
{
|
||||
"title": "burning bush",
|
||||
"url": "https://www.youtube.com/channel/UCYl6OOZr2TPb1MvySkokFYw",
|
||||
"editor": "95"
|
||||
},
|
||||
{
|
||||
"title": "예수전도단 서울 화요모임",
|
||||
"url": "https://www.youtube.com/channel/UCn5qdSP9lz6BIl4bPwM41qg",
|
||||
"editor": "96"
|
||||
},
|
||||
{
|
||||
"title": "RUACh 호흡. CCM Playlist",
|
||||
"url": "https://www.youtube.com/channel/UCJ95HYaEBPMNr9ZK5z_r1sg",
|
||||
"editor": "97"
|
||||
},
|
||||
{
|
||||
"title": "Jesus Road_CCM전문채널",
|
||||
"url": "https://www.youtube.com/channel/UCOHrcxpxsL026NiHzafIHzQ",
|
||||
"editor": "98"
|
||||
},
|
||||
{
|
||||
"title": "레위지파 뮤직",
|
||||
"url": "https://www.youtube.com/channel/UCaTL5Hq8WdrGKibZ0qNY-LA",
|
||||
"editor": "99"
|
||||
},
|
||||
{
|
||||
"title": "버스킹예배자",
|
||||
"url": "https://www.youtube.com/channel/UChtdWlEuS4bOXNAx_B1jbEQ",
|
||||
"editor": "100"
|
||||
},
|
||||
{
|
||||
"title": "SARANG ON MUSIC",
|
||||
"url": "https://www.youtube.com/channel/UCbIW7tSUlO0PJosNCKcHCKg",
|
||||
"editor": "101"
|
||||
},
|
||||
{
|
||||
"title": "예수전도단 캠퍼스워십",
|
||||
"url": "https://www.youtube.com/channel/UCB6oCUPiiKkXcmjORXe9R6w",
|
||||
"editor": "102"
|
||||
},
|
||||
{
|
||||
"title": "홀리조이워십",
|
||||
"url": "https://www.youtube.com/channel/UCijT0yHHmwhmdWuUfZX9Q-w",
|
||||
"editor": "94"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"cmCategoryTitle": "TV방송",
|
||||
"cmCategoryId": 41,
|
||||
"youtubeChannels": [{
|
||||
"title": "극동방송",
|
||||
"url": "https://www.youtube.com/channel/UCTwQ9iAIojmsw_mFlYj54SA",
|
||||
"editor": "91"
|
||||
},
|
||||
{
|
||||
"title": "크리스천투데이",
|
||||
"url": "https://www.youtube.com/user/christiantodaynews",
|
||||
"editor": "89"
|
||||
},
|
||||
{
|
||||
"title": "기독일보",
|
||||
"url": "https://www.youtube.com/channel/UCLy7KqnLkWNossx66Vw9Nng",
|
||||
"editor": "103"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"cmCategoryTitle": "말씀/QT",
|
||||
"cmCategoryId": 40,
|
||||
"youtubeChannels": [{
|
||||
"title": "말씀노트",
|
||||
"url": "https://www.youtube.com/channel/UCpek2YxX2YFfw6WAijw3CqQ",
|
||||
"editor": "87"
|
||||
},
|
||||
{
|
||||
"title": "C채널설교",
|
||||
"url": "https://www.youtube.com/user/cchannelsermon",
|
||||
"editor": "86"
|
||||
},
|
||||
{
|
||||
"title": "말씀충전",
|
||||
"url": "https://www.youtube.com/channel/UCWsLHWzNGb2bsmuJbMZjmTA",
|
||||
"editor": "88"
|
||||
},
|
||||
{
|
||||
"title": "잘 믿고 잘 사는 법",
|
||||
"url": "https://www.youtube.com/channel/UCRv5biV9lv-yImBR3tj0dIA",
|
||||
"editor": "105"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"cmCategoryTitle": "소셜",
|
||||
"cmCategoryId": 39,
|
||||
"youtubeChannels": [{
|
||||
"title": "말씀의검",
|
||||
"url": "https://www.youtube.com/channel/UCA1KioPB0419qcI_sFqf8gA",
|
||||
"editor": "85"
|
||||
},
|
||||
{
|
||||
"title": "worthking",
|
||||
"url": "https://www.youtube.com/channel/UCZi0MJsmUx-8oWn3GZCX6Nw",
|
||||
"editor": "84"
|
||||
},
|
||||
{
|
||||
"title": "예믿청TV",
|
||||
"url": "https://www.youtube.com/channel/UCOOhK3ILkKKlokz9Acjk-lg",
|
||||
"editor": "106"
|
||||
},
|
||||
{
|
||||
"title": "양치기 소년",
|
||||
"url": "https://www.youtube.com/channel/UCaQahd4t-RHMPy-nHTP2saA",
|
||||
"editor": "83"
|
||||
},
|
||||
{
|
||||
"title": "kei is loved",
|
||||
"url": "https://www.youtube.com/channel/UCKye33AihrDsSS_7hsjTQIA",
|
||||
"editor": "107"
|
||||
},
|
||||
{
|
||||
"title": "오늘의 신학공부",
|
||||
"url": "https://www.youtube.com/channel/UCOSJRrtx0Gq5Y_SGRRz-3jA",
|
||||
"editor": "108"
|
||||
},
|
||||
{
|
||||
"title": "미션라이프",
|
||||
"url": "https://www.youtube.com/channel/UCOLfDu_Bt20rv4r3ULlnuVQ",
|
||||
"editor": "109"
|
||||
},
|
||||
{
|
||||
"title": "Damascus TV",
|
||||
"url": "https://www.youtube.com/channel/UCFedtwqkwPCAI5oh1XO2NHA",
|
||||
"editor": "112"
|
||||
},
|
||||
{
|
||||
"title": "On the road to Damascus",
|
||||
"url": "https://www.youtube.com/channel/UC779CFbAQK7DYu9rjhTSHOA",
|
||||
"editor": "111"
|
||||
},
|
||||
{
|
||||
"title": "오븐 기독교",
|
||||
"url": "https://www.youtube.com/channel/UCr_g7sS1TD4TH5PVdOCyDjw",
|
||||
"editor": "113"
|
||||
},
|
||||
{
|
||||
"title": "우군woogoon",
|
||||
"url": "https://www.youtube.com/channel/UCeAycTXCgUAviTvDHmce_3Q",
|
||||
"editor": "110"
|
||||
},
|
||||
{
|
||||
"title": "NAM D",
|
||||
"url": "https://www.youtube.com/channel/UCWgyCh92781HaX_ue0r8Vng",
|
||||
"editor": "117"
|
||||
},
|
||||
{
|
||||
"title": "디브리즈 스튜디오",
|
||||
"url": "https://www.youtube.com/channel/UCRnU7eMOyxyYWZ0938VpoDg",
|
||||
"editor": "118"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"cmCategoryTitle": "키즈",
|
||||
"cmCategoryId": 47,
|
||||
"youtubeChannels": [{
|
||||
"title": "리조이스",
|
||||
"url": "https://www.youtube.com/channel/UC3mG7uBpHaBUiTPzx4IOgcQ",
|
||||
"editor": 122
|
||||
},
|
||||
{
|
||||
"title": "KWSCM",
|
||||
"url": "https://www.youtube.com/channel/UCYWQgzW0QFR2Lp03LNm0Hyw",
|
||||
"editor": 123
|
||||
},
|
||||
{
|
||||
"title": "SingHosannaVEVO",
|
||||
"url": "https://www.youtube.com/channel/UCGMLvhe4J_PQjtfTQDuzRMg",
|
||||
"editor": 124
|
||||
},
|
||||
{
|
||||
"title": "파이디온",
|
||||
"url": "https://www.youtube.com/user/haeun011",
|
||||
"editor": 125
|
||||
},
|
||||
{
|
||||
"title": "PKdanceMedia",
|
||||
"url": "https://www.youtube.com/user/pkdanceMedia",
|
||||
"editor": 126
|
||||
},
|
||||
{
|
||||
"title": "찬양나라 요정쌤",
|
||||
"url": "https://www.youtube.com/channel/UCjGqQppV-y_Oc6fUZoZHiOQ",
|
||||
"editor": 127
|
||||
},
|
||||
{
|
||||
"title": "꼬마형",
|
||||
"url": "https://www.youtube.com/channel/UCvDIuHGecJdFNWxoNhop3nw",
|
||||
"editor": 128
|
||||
},
|
||||
{
|
||||
"title": "e-mo rang",
|
||||
"url": "https://www.youtube.com/channel/UCMGCMG4dXyuZHdRsk0K8oYg",
|
||||
"editor": 129
|
||||
},
|
||||
{
|
||||
"title": "DMT",
|
||||
"url": "https://www.youtube.com/user/2001dmt",
|
||||
"editor": 130
|
||||
},
|
||||
{
|
||||
"title": "키즈모아",
|
||||
"url": "https://www.youtube.com/channel/UCabjFwcbqopb6lkvLsk43gw",
|
||||
"editor": 131
|
||||
},
|
||||
{
|
||||
"title": "노아TV noa",
|
||||
"url": "https://www.youtube.com/channel/UC5K1Ij8c4jUnfxpFkaJKnOw",
|
||||
"editor": 132
|
||||
},
|
||||
{
|
||||
"title": "길 키즈 워십",
|
||||
"url": "https://www.youtube.com/channel/UCvVxpNpmgMchT9koV2psYyQ",
|
||||
"editor": 133
|
||||
},
|
||||
{
|
||||
"title": "하이바이블",
|
||||
"url": "https://www.youtube.com/channel/UCkCzybtZUuqWgeKTFJIlSsw",
|
||||
"editor": 134
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
module.exports = targetChannels
|
||||
Reference in New Issue
Block a user