Advertisement
Gooningbobby

Untitled

Apr 27th, 2025
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  6. <meta name="theme-color" content="#121212"> <!-- Makes Chrome address bar match background -->
  7. <title>Recognized Songs</title>
  8.  
  9. <style>
  10. html, body {
  11. margin: 0;
  12. padding: 0;
  13. background-color: #121212;
  14. color: #ffffff;
  15. font-family: Arial, sans-serif;
  16. height: 100%;
  17. overflow-x: hidden;
  18. }
  19. h1 {
  20. text-align: center;
  21. margin-top: 20px;
  22. }
  23. .song {
  24. background-color: #1f1f1f;
  25. margin: 15px;
  26. padding: 15px;
  27. border-radius: 10px;
  28. text-align: center;
  29. }
  30. .song button {
  31. background-color: #1DB954;
  32. border: none;
  33. color: white;
  34. padding: 10px 20px;
  35. margin-top: 10px;
  36. border-radius: 5px;
  37. font-size: 16px;
  38. cursor: pointer;
  39. }
  40. .song button:hover {
  41. background-color: #1ed760;
  42. }
  43. .timestamp {
  44. font-size: 12px;
  45. color: #aaaaaa;
  46. margin-top: 5px;
  47. }
  48. </style>
  49. </head>
  50.  
  51. <body>
  52.  
  53. <h1>Recognized Songs</h1>
  54. <div id="song-list">
  55. <!-- Songs will be dynamically inserted here -->
  56. </div>
  57.  
  58. <script>
  59. // Try to trigger Chrome to hide the address bar
  60. window.addEventListener('load', function() {
  61. setTimeout(() => {
  62. window.scrollTo(0, 1);
  63. }, 0);
  64. });
  65.  
  66. // Fetch song history JSON
  67. fetch('song_history.json?nocache=' + new Date().getTime())
  68. .then(response => response.json())
  69. .then(data => {
  70. data.sort((a, b) => new Date(b.timestamp) - new Date(a.timestamp));
  71.  
  72. const container = document.getElementById('song-list');
  73. container.innerHTML = "";
  74.  
  75. data.forEach(song => {
  76. if (song.artist !== "Unknown Artist") {
  77. const div = document.createElement('div');
  78. div.className = 'song';
  79.  
  80. div.innerHTML = `
  81. <div><strong>${song.title}</strong> - ${song.artist}</div>
  82. <div>${song.album}</div>
  83. <div class="timestamp">${song.timestamp}</div>
  84. <a href="${song.youtube_music_url}" target="_blank">
  85. <button>Open in YouTube Music</button>
  86. </a>
  87. `;
  88.  
  89. container.appendChild(div);
  90. }
  91. });
  92. })
  93. .catch(error => {
  94. document.getElementById('song-list').innerHTML = "<p>Failed to load songs.</p>";
  95. console.error('Error fetching song history:', error);
  96. });
  97. </script>
  98.  
  99. </body>
  100. </html>
  101.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement