Skip to content

Instantly share code, notes, and snippets.

@shd101wyy
Last active March 1, 2017 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shd101wyy/5fa8df76484f56cd2258cf3c77585e1d to your computer and use it in GitHub Desktop.
Save shd101wyy/5fa8df76484f56cd2258cf3c77585e1d to your computer and use it in GitHub Desktop.
trigger and action model script
{
name: bilibili,
triggers: {
subscribe_user: {
title: "up主最新视频更新",
config: {
id: {
type: "string",
title: "up主数字id",
description: "例如 space.bilibili.com/**122879**",
default: "",
order: 1
}
}
func: function(event) {
const config = event.config
const url = `http://space.bilibili.com/ajax/member/getSubmitVideos?mid=${config.id}&pagesize=1`
event.$get({
url,
}, function(error, body) {
if (error) event.return(false)
const newestVideoData = json.data.vlist[0]
const title = newestVideoData.title
const description = newestVideoData.description
const pic = newestVideoData.pic
const videoLink = `http://www.bilibili.com/video/av${newestVideoData.aid}/`
event.return({
title,
description,
pic,
videoLink
})
})
}
},
subscribe_bangumi: {
},
},
actions: {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment