mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-29 13:31:00 +00:00
Started api
This commit is contained in:
@@ -123,7 +123,7 @@ function list(msg, guid, coll, offline, socket) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function skip(list, guid, coll, offline, socket) {
|
function skip(list, guid, coll, offline, socket, callback) {
|
||||||
var socketid = socket.zoff_id;
|
var socketid = socket.zoff_id;
|
||||||
|
|
||||||
if(list !== undefined && list !== null && list !== "")
|
if(list !== undefined && list !== null && list !== "")
|
||||||
|
|||||||
@@ -271,6 +271,22 @@ router.route('/api/list/:channel_name/:video_id').delete(function(req, res) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
router.route('/api/skip/:channel_name').post(function(req, res) {
|
||||||
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
|
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
||||||
|
res.header({"Content-Type": "application/json"});
|
||||||
|
|
||||||
|
var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
|
||||||
|
var api_key = req.body.api_key;
|
||||||
|
var id = req.body.id;
|
||||||
|
var guid = req.body.chat_name;
|
||||||
|
|
||||||
|
//CHECK API KEY FOR ZOFFBOT
|
||||||
|
List.skip(list, guid, channel_name, false, undefined, function(skipped, text) {
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
router.route('/api/conf/:channel_name').put(function(req, res) {
|
router.route('/api/conf/:channel_name').put(function(req, res) {
|
||||||
res.header("Access-Control-Allow-Origin", "*");
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
||||||
|
|||||||
Reference in New Issue
Block a user