forked from beardedspice/BS-Strategies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPoolsideFM.bsstrategy
30 lines (30 loc) · 1.04 KB
/
PoolsideFM.bsstrategy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//
// PoolsideFM.js
// BeardedSpice
//
// Created by Coder-256 on 6/13/16.
// Copyright (c) 2016 Coder-256. All rights reserved.
//
BSStrategy = {
version: 1,
displayName: "Poolside FM",
accepts: {
method: "predicateOnTab",
format: "%K LIKE[c] '*poolside.fm*'",
args: ["URL"]
},
isPlaying: function () {return document.querySelectorAll(".play:not(.pause)").length == 0 },
toggle: function () {return document.querySelector(".play").click() },
next: function () {return document.querySelector(".skip").click() },
previous: function () {return true}, // No feature exists
pause: function () { return document.querySelector(".pause").click() },
play: function() { return document.querySelector(".play:not(.pause)").click() },
trackInfo: function () {
return {
'track': document.querySelector(".title").innerText.trim().split("\n")[0],
'artist': document.querySelector(".title").innerText.trim().split("\n")[1],
'album': "", // No feature exists
'image': "" // No feature exists
}
}
}