This script gets data from a google sheets table and returns it in easy to use JSON. Tables must have a header 😃
Publish it to the web:
The ID is in the link that publish to the web gives you, NOT the webpage URL
// ==UserScript== | |
// @name Scratch - view stepping | |
// @namespace none | |
// @version 1.1 | |
// @description Allows you to see which block currently executes in the Scratch editor (scratch.mit.edu), which is useful for debugging. | |
// @author BoomerScratch | |
// @match https://scratch.mit.edu/projects/* | |
// @grant none | |
// @run-at document-start | |
// @homepageURL https://gist.github.com/BoomerScratch/0592337050810244236d69a4267b3913 |
[class*="stage-header_stage-menu-wrapper"][class*="box_box"] { | |
flex-direction: row-reverse; | |
} | |
[class*="gui_body-wrapper"], [class*="menu-bar_menu-bar_"] { | |
background: #c0c3c6; | |
} | |
[class*="menu-bar_menu-bar_"] *{ | |
color:#4c4c4c; | |
background: transparent; |
//Set window.load and window.show so that the child iframe element can access those functions. | |
window.load = load; | |
window.show = show; | |
//Convert all links to preload on hover. | |
[...document.querySelectorAll("a")].forEach((a) => { | |
a.addEventListener("click", (e) => { | |
e.preventDefault(); | |
show(a.href); | |
}); | |
a.addEventListener("mouseenter", (e) => { |
const generate = (meta) => { | |
return [ | |
{ charset: "utf-8" }, | |
{ lang: "en" }, | |
{ name: "viewport", content: "width=device-width, initial-scale=1" }, | |
{ name: "format-detection", content: "telephone=no" }, | |
{ name: "title", content: meta.title }, | |
{ name: "author", content: meta.author }, | |
{ | |
name: "keywords", |
(async ({ | |
interval = 500, | |
method = "fetch", | |
useIframe = false, | |
resources = [], | |
autoDetect = true, | |
resourceTypes = ["navigation", "script", "resource", "link", "img", "other"], | |
}) => { | |
if (autoDetect) { | |
resources = performance |
/** | |
* Generates a data URL of the current favicon with a number added on top. | |
* @param {Object} options | |
* @param {String} [options.type = "image/png"] The mime type of the image to return. | |
* @param {String} [options.text = ""] The text to display on the favicon, if left blank will simply show a dot on the favicon. | |
* @param {String} [options.background = "white"] A CSS color for the background of the notification badge. | |
* @param {String} [options.color = "white"] A CSS color for the color of the text on the notification badge. | |
* @param {Number} [options.size = 10] The size of the notification badge. The badge generated will be size * 2 pixels in width and height, then added on top of the current favicon. | |
* @param {String} [options.pos = "bottom-right"] The position of the badge, either "bottom-right", "top-right", "bottom-left" or "top-left" | |
* @param {String} [options.font = "Monospace"] The font to use |
<script> | |
import {onMount} from "svelte"; | |
export let link = ""; | |
let m, title, description, img, img_el; | |
onMount(async () => { | |
m = await meta(link); | |
m = parseMeta(m); | |
title = m.title; | |
description = m.description; | |
img = m.image; |
((window) => { | |
var _fetch = window.fetch; //Get the original fetch functionm | |
window.fetch = (url, opts = {}) => { | |
if (!window.FETCH_CACHE) { | |
window.FETCH_CACHE = {}; | |
} | |
return new Promise((resolve) => { | |
/* | |
Generate a sort of unique key about this fetch request. |
[ | |
{"question":"A ____ atom in an atomic clock beats 9,192,631,770 times a second","answer":"cesium","money":1000}, | |
{"question":"A ____ generates temperatures five times hotter than those found on the sun's surface","answer":"lightning bolt","money":1000}, | |
{"question":"A ____ is a pact between a secular authority & the church","answer":"concordat","money":1000}, | |
{"question":"A ____ is the blue field behind the stars","answer":"canton","money":1000}, | |
{"question":"A ____ occurs when all the planets of the our Solar System line up","answer":"sysygy","money":1000}, | |
{"question":"A ____ razor removed from King Tut's Tomb was still sharp enough to be used","answer":"golden","money":1000}, | |
{"question":"A ____ takes 33 hours to crawl one mile","answer":"snail","money":1000}, | |
{"question":"A ____ women can get a divorce if her husband doesn't give her coffee","answer":"saudi arabian","money":1000}, | |
{"question":"A ____ written to celebrate a wedding is called a epithalamium","answer":"poem","money":1000}, |