genius-date

script to inject today's date when transcribing a new song

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         genius-date
// @description  script to inject today's date when transcribing a new song
// @namespace    http://tampermonkey.net/
// @license MIT
// @version      1.0.1
// @description  A simple example userscript
// @author       solomoncyj
// @match        https://genius.com/new
// @grant        none
// ==/UserScript==

function selectElement(id, valueToSelect) {
    let element = document.getElementById(id);
    element.value = valueToSelect;
}

function inject()
{
    const today = new Date(Date.now());
    selectElement('song_release_date_1i', today.getFullYear());
    selectElement('song_release_date_2i', today.getMonth() + 1);
    selectElement('song_release_date_3i', today.getDate());
}

(function() {
   'use strict';

    let btn = document.createElement("button");
    btn.onclick = () => {
        inject()
    };
    const info = document.createTextNode("Today");
    let div = document.querySelector(".add_song_page-release_date");
    div.appendChild(btn);
    btn.appendChild(info);
})();