You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not a developer myself so I don't know how to export src's to Chrome as extension ("Load unpacked extension" gives an error) to debug my code but if someone can I will be very grateful. So instead of commit I'll write it down:
manifest.json
"*://*.rockradio.com/*",
index.js
exports.rockradio = require("./rockradio");
rockradio.js
"use strict";
var $ = require("jquery");
var Plugin = require("../modules/Plugin");
var Utils = require("../modules/Utilities");
var rockradio = Object.create(Plugin);
rockradio.init("rockradio", "Rockradio"); // name, displayName
rockradio.test = function () {
var domainTest = /rockradio\.com/i.test(document.location.hostname);
var playerTest = $(".status") === "now playing" : "stopped";
return domainTest && playerTest;
};
rockradio.scrape = function () {
var artistsong = $(".title").text().split("-");
var info = {
artist: artistsong.length > 1 ? $.trim(artistsong[1]) : "",
title: artistsong.length > 1 ? $.trim(artistsong[2]) : "",
elapsed: Utils.calculateDuration($(".elapsed").text()),
stopped: $(".status") === "stopped",
};
return info;
};
module.exports = rockradio;
I'm not a developer myself so I don't know how to export src's to Chrome as extension ("Load unpacked extension" gives an error) to debug my code but if someone can I will be very grateful. So instead of commit I'll write it down:
manifest.json
index.js
rockradio.js
Other AudioAddict Network sites (http://www.radiotunes.com/ http://www.jazzradio.com/ http://www.di.fm/) use the same player so if someone want he can easily add them too.
Thanks.
The text was updated successfully, but these errors were encountered: