forked from beardedspice/BS-Strategies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PinchyDon.bsstrategy
33 lines (33 loc) · 909 Bytes
/
PinchyDon.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
31
32
33
//
// PinchyDon.js
// BeardedSpice
//
// Created by Vito Belgiorno-Zegna on 1/25/19.
// Copyright (c) 2019 GPL v3 http://www.gnu.org/licenses/gpl.html
//
BSStrategy = {
version: 1,
displayName: "PinchyDon",
accepts: {
method: "predicateOnTab",
format: "%K LIKE[c] '*pinchyandfriends.com*'",
args: ["URL"]
},
isPlaying: function () {
return !document.querySelector("audio").paused;
},
toggle: function () {
var a = document.querySelector("audio");
a.paused ? a.play() : a.pause();
},
pause: function () {
document.querySelector("audio").pause();
},
trackInfo: function () {
return {
"track": document.querySelector('.mixname_h1').textContent.split('by')[0].trim(),
"artist": document.querySelector('.mixname_h1').textContent.split('by')[1].trim(),
"image": document.querySelector("[class*='mix_img hand left'] > img").src
}
}
}