Skip to content

Instantly share code, notes, and snippets.

View duplaja's full-sized avatar

Dan D. duplaja

  • Central US
View GitHub Profile
@duplaja
duplaja / shs-schoology.css
Last active August 23, 2020 01:00
SHS Schoology CSS Styles (use with Stylebot)
/*Force Sticky Header*/
div#header{
position: sticky!important;
top: 0;
z-index: 100;
}
/*Hide Overdue Assignments Section on Home*/
div#overdue-submissions{
display:none!important;
@duplaja
duplaja / besteveralbums.js
Created August 24, 2021 23:34
Album Rating BestEverAlbums
var ratingContainer = document.getElementsByClassName("object-interaction-panel-rating")[0];
var albumIdElement = ratingContainer.getElementsByTagName("ul")[0];
var albumId = albumIdElement.id;
var rating = prompt("Please enter your rating out of 100, as a multiple of 5.");
var ratingHolderId = albumId.replace("star_","starUser_");
document.getElementById(ratingHolderId).innerHTML = rating+'/100';
star.update('onmousedown',albumIdElement);
@duplaja
duplaja / all-music-scraper.js
Last active April 28, 2022 22:15
AllMusic Favorites Scraper JS
for (let i = 1; i < 8; i++) {
setTimeout(function timer() {
window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' })
if(i == 7) {
export_csv_favorites();
}
}, i * 4000);
}
function export_csv_favorites() {
@duplaja
duplaja / rym-recs-scraper.js
Last active May 3, 2022 21:16
RYM Recs Scraper
//export_csv_favorites('page_recommendations_list_main');
//export_csv_favorites('page_recommendations_list_non_affinity');
function export_csv_favorites(passed_parent_id) {
const rows = [["Artist - Album","Year","Genres","RYM Link"]]
var title
var artist
var combined
var list = document.getElementById(passed_parent_id);
@duplaja
duplaja / spotispin-csv-downloader.js
Created September 5, 2021 03:04
Spotispin CSV Downloader
getSpotispin();
function getSpotispin() {
const rows = [["Artists-Album","Link"]]
var tableRows = document.querySelectorAll("tr.single_rec");
for (i = 0; i < tableRows.length; i++) {
combined = tableRows[i].querySelectorAll("td.album_name")[0].innerText.trim();
@duplaja
duplaja / custom-first-shuffle.js
Created September 12, 2021 22:09
Custom JS Shuffle - Keep First
function customShuffle(x) {
var y = x.slice(1, x.length);
var j, t, i;
for (i = y.length - 1; i > 0; i--) {
j = Math.floor(Math.random() * (i + 1));
t = y[i];
y[i] = y[j];
y[j] = t;
}
return [x[0]].concat(y);
@duplaja
duplaja / rym-charts-scraper.js
Created September 25, 2021 00:39
JS Scraper for RYM Charts page
getRYMChart();
function getRYMChart() {
const rows = [["Artist-Album","Release","Genres","Link"]]
var tables = document.querySelectorAll("div.chart_results_frame");
var recTable = tables[0];
var tableRows = recTable.querySelectorAll("div.topcharts_itembox");
@duplaja
duplaja / allmusic-ratings.js
Last active February 3, 2022 00:48
Updated No-Jquery Allmusic Recs Gist
window.addEventListener("load", function(event) {
var userratingdiv = document.getElementsByClassName("ratings")[0];
const button = document.createElement('a');
button.setAttribute("id", "rate-button");
button.innerHTML = '<h3>Rate Album</h3>'
userratingdiv.insertBefore(button, userratingdiv.firstChild)
var userratingbutton = document.getElementById("rate-button");

Links

(http/https): https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)

Number followed by Period and Space

^(\d+)\.\s

@duplaja
duplaja / download-text.js
Created March 24, 2022 14:55
Export Table as List - Text File
function generateDownload(filename, text, type='text/plain') {
// Create an invisible A element
const a = document.createElement('a');
a.style.display = 'none';
document.body.appendChild(a);
// Set the HREF to a Blob representation of the data to be downloaded
a.href = window.URL.createObjectURL(
new Blob([text], { type })
);