Skip to content

Instantly share code, notes, and snippets.

View Wirespec's full-sized avatar

Wirespec Wirespec

View GitHub Profile
@Wirespec
Wirespec / weather_api.js
Last active December 2, 2020 11:44
Weather API to return 1 to 24 weather forecasts. Includes weather icon, condition, min/max temperatures, humidity, precipitation and wind speed.
let selectedIconSet;
let selectedIcon;
let iconSetIndex;
let minimumTemp;
let maximumTemp;
module.exports = function (props) {
switch (props.node.name) {
case "icon":
@Wirespec
Wirespec / javascript_hook_youtube_videos.js
Last active December 2, 2020 17:14
A sample Javascript hook that generates data for both an object and a list
const TYPE_OBJECT = 0;
var channelPos = 0;
module.exports = function (props) {
if (props.node.objectType === TYPE_OBJECT) {
let channelName = youtube[channelPos].channel;
return channelName;
} else {
var counter = 0;
module.exports = function (props) {
counter += 2;
return counter;
}
@Wirespec
Wirespec / javascript_hook_object_array.js
Last active November 25, 2020 10:22
Returns a list of objects using a Javascript hook.
module.exports = function (props) {
return [
{
title: "Kitten hides in an engine to find warmth on a cold winter night.",
url: "https://www.youtube.com/watch?v=mO3OYmvwnkg",
datePosted: "2020-11-17",
duration: "6:24",
views: 105078,
likes: 11000,
dislikes: 53
@Wirespec
Wirespec / javascript_hook_returns_an_object.js
Last active November 25, 2020 10:22
Returns an object using a Javascript hook.
module.exports = function (props) {
return {
title: "Kitten hides in an engine to find warmth on a cold winter night.",
url: "https://www.youtube.com/watch?v=mO3OYmvwnkg",
datePosted: "2020-11-17",
duration: "6:24",
views: 105078,
likes: 11000,
dislikes: 53
}
@Wirespec
Wirespec / javascript_hook_returns_value.js
Last active November 25, 2020 10:11
Returns a value using a Javascript hook.
module.exports = function (props) {
return "Kitten hides in an engine to find warmth on a cold winter night.";
}