Skip to content

Commit

Permalink
Update carrd-titlebar-nowplaying.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mdrxy authored Aug 8, 2024
1 parent d4688b3 commit 49c4227
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions carrd-titlebar-nowplaying.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script>
document.addEventListener('DOMContentLoaded', function () {
// Your existing JavaScript code here

function updateTabTitle() {
var websocketUrl = 'wss://azura.wbor.org/api/live/nowplaying/websocket';
Expand All @@ -11,18 +10,15 @@
function createWebSocket() {
var websocket = new WebSocket(websocketUrl);

// Connection event
websocket.addEventListener('open', function (event) {
console.log('WebSocket connection opened.');
streamdiv.style.display = 'revert';
recentlyplayeddiv.style.display = 'revert';

// Send the connection string
var connectionData = { "subs": { "station:wbor": {} } };
websocket.send(JSON.stringify(connectionData));
});

// Message event
websocket.addEventListener('message', function (event) {
try {
var data = JSON.parse(event.data);
Expand Down Expand Up @@ -80,7 +76,6 @@
}
}

// Call the function initially and update it as needed
updateTabTitle();
});
</script>
</script>

0 comments on commit 49c4227

Please sign in to comment.