forked from beardedspice/BS-Strategies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GenieMusic.bsstrategy
32 lines (31 loc) · 1.12 KB
/
GenieMusic.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
//
// GenieMusic.js
// BeardedSpice
//
// Created by kimtree on 10/18/2017.
// Copyright (c) 2015-2017 GPL v3 http://www.gnu.org/licenses/gpl.html
//
BSStrategy = {
version: 2,
displayName: "GenieMusic",
accepts: {
method: "predicateOnTab",
format: "%K LIKE[c] '*genie.co.kr/player*'",
args: ["URL"]
},
isPlaying: function () { return flowplayer().playing; },
toggle: function () { flowplayer().toggle(); },
previous: function () { fnPlayPrev(); },
next: function () { fnPlayNext(); },
pause: function () { flowplayer().pause(); },
favorite: function () { fnPlayerLikeAct(); },
trackInfo: function () {
return {
'track': document.getElementById("SongTitleArea").textContent,
'album': document.getElementById("AlbumImgArea").getElementsByTagName("img")[0].getAttribute("alt"),
'artist': document.getElementById("ArtistNameArea").textContent,
'image': 'http:' + document.getElementById("AlbumImgArea").getElementsByTagName("img")[0].getAttribute("src"),
'favorited': (document.getElementsByClassName("btn-like")[0].className.indexOf("active") > 0)
}
}
}