olavea / Rubys-TimeShip

Ruby's TimeShip
https://timeship1.gatsbyjs.io/
0 stars 0 forks source link

G.i.G.G.L.E.S OlaCast 13 #8

Open olavea opened 2 years ago

olavea commented 2 years ago

OlaCast: Sunday Skill-Builder Sessions

Who:

Cap'n Ola · @OlaHolstVea Tom Erik Støwer · Ghostly Guest and Data Dev Dad ·testower

What:

We create 1 node with the id from 1 youtube video,

Why:

To prepare for sourcing only our favourite videos from youtube. Because youtube is NOT a safe tool for Lillian (7 🏴‍☠️👸) and her skill-builder friends.

How:

G.i. of G.i.G.G.L.E.S.

G. Get data later, create node now i. = I a.c.t.i.o.n.s

Let's G.i. Go 📺 !

G. Get data later, create node now

exports.sourceNodes = async (params) => {
  // Get 1 video ready to be sourced into our GraphQL-Gatsby-data river without sinking
  await Promise.all([bakeOneNodeGetOneVideo(params)]);
}
async function bakeOneNodeGetOneVideo() {

}

I. id

  const POW_TUBE_ID = "UGq8cnNTbwI"
  const nodeID = {
    id: POW_TUBE_ID,
  }
  console.log('⛵💀 Yo-Ho Yo-Ho a PiRATEs nodeID 💰', nodeID);

a. actions

  actions.createNode({

c. contentDigest

      contentDigest: createContentDigest(),

t. type

      type: "powTubeOemBed"
         i. internal, because it is NOT polite to have `contentDigest` and `type` under `id`
    internal: {

o. (POW_TUBE_ID)

POW_TUBE_ID

n. node

Go look at our node in GraphiQL

s. Singing

Show drawing of Woolly Goatsby singing

Here is a screenshot of the video I am using the id from and which I will be sourcing some other Sunday OlaCast-13- Sid and Giggles-24

The POW code on Github: https://github.com/olavea/POW/

Sign up for the newsletter:

The original POW website: https://www.usepow.com/

olavea commented 2 years ago

25.jan under 3

fix: 1 video is go pow G.L.E of G.i.G.G.L.E.S #9


//const POW_TUBE_IDS_RED_STRING = [ "UGq8cnNTbwI", "eRTJPIa39a4" ] // // G. Get data out of axios-river // // E. Earl and url // // O. oembed data spread into pugNode // // R. Read my data and prop it off to video-layout.js // // G. Got // // E. Embed the html in video-layout.js //const unEmbedData = "get video data from youtube later"; //const embedData = await fetchEmbed(ID_GiGGLES); // // // G. Got: Get the embedData that axios-river got for us // for (pinkyPinksbyPiratyParrot of POW_TUBE_IDS_RED_STRING) { // } console.log('⛵💀 Yo-Ho Yo-Ho a PiRATE TV for me 💰', data); in pugNode //title: unEmbedData, //oembedVideo: oembedVideo,

// src/components/video-layout.js import React from "react"; //import Videos from "./videos"; // <div // className="video-container" // dangerouslySetInnerHTML={{ __html: html }} // /> // line 16

export const query = graphql` query($id: String) { youTubeEmbed: pugNode(id: {eq: $id}) { id title internal { type contentDigest }

}

} `;

import React from "react"; import Videos from "./videos";

const VideoLayout = ({ title, html }) => { return ( <>

{title}

  <div>
    <Videos />
  </div>
</>

); };

export default VideoLayout; 25.jan over 3 24.jan under 2

PugNode

// S. Sing $id:String // export const query = graphql // query($catsby: String) { // youTubeEmbed: pugNode(id: {eq: $catsby}) { // title // } // } //;

24.jan over 2 23.jan under 1

// export const query = graphql // query MdQuery($catsby: String!) { // supplies: markdownRemark(id: {eq: $catsby}) { // frontmatter { // title // } // html // } // } //; // <div dangerouslySetInnerHTML={{ __html: data.supplies.html }}>

23.jan over 22.jan under

22.jan over 21.jan under

Ahoy Skill-Builder-Pirates! 🔧⛵💀 21.jan over 20.jan under

https://github.com/olavea/POW/pull/1 In today's live coding treasure hunt Queen @raae will create 1 node with the id from 1 youtube video. With @GatsbyJS

We'll be working with the acronym G.I.G.G.L.E.S. named after @chatsidhartha 's pug  , see screenshot. Grab a drink and join us 07:00 CET https://youtu.be/VhrOe0X_oA8

🤔 Will we see you on today's treasure hunt?

In today's live coding treasure hunt Queen @raae will create 1 node with the id from 1 youtube video. With @GatsbyJS We'll be working with the acronym G.I.G.G.L.E.S. named after Sid's pug, see screenshot Grab a drink and join us 07:00 CET https://youtu.be/VhrOe0X_oA8

// gatsby-node.js // G. Get console.log('⛵💀🏴‍☠️🗣️ Yo-Ho Yo-Ho a PiRATEs nodeID 💰', nodeID);

success createSchemaCustomization - 0.010s ⛵💀🏴‍☠️🗣️ Yo-Ho Yo-Ho a PiRATEs nodeID 💰 { id: 'UGq8cnNTbwI' } success Checking for changed pages - 0.001s success source and transform nodes - 0.119s

// exports.sourceNodes = async ({ // actions: { createNode }, // createContentDigest, // reporter // }) => { // // L. Loop over YOUTUBE_IDS_RED_STRING // for (const idPinkyPinksbyPirateParrot of YOUTUBE_IDS_RED_STRING) { // const embedData = await fetchEmbed(idPinkyPinksbyPirateParrot, reporter); // if (!embedData) return;

// createNode({ // // G. Get data // ...embedData, // // I. id

// G. GUS will return oembed data from Axios River // G. George will return oembed data from Axios River // e. ... // o. oembedVideo // r. River // g. // e.

const oembedVideo = "GUS"

const oembedVideo = await axios.get( {params: {

// // L. Loop (tales from the Loop L O. Over O. Of P. pinkyPinksbyPiratyParrot POW_TUBE_IDS_RED_STRING.forEach(PinkyPinksbyPiratyParrot => { // 2. Loop over // for (const idPinky of YOUTUBE_IDS_RED_STRING) { // create a node for each video // } // // G.

// // G.

// // L. Loop (tales from the Loop

// // E. EmbedVideoPage

// // S. Sing $id:String

15.jan under const OLA_TUBE_ID = "4nWUMgiEpdc"

async function getOneVideoAndBakeOneNode({actions, createContentDigest}) { actions.createNode({ id: OLA_TUBE_ID, internal: { contentDigest: createContentDigest(OLA_TUBE_ID), type: "olaTubeOemBed" } }); // console.log('🗣️ Yo-Ho Yo-Ho a PiRATEs life for me and my nodeID 💰', nodeID); }

exports.sourceNodes = async (params) => { // Get 1 video ready to be sourced into our GraphQL-Gatsby-data river without sinking await Promise.all([getOneVideoAndBakeOneNode(params)]); }

// a. actions const OLA_TUBE_ID = "4nWUMgiEpdc"

actions.createNode({ id: OLA_TUBE_ID, internal: { contentDigest: createContentDigest(OLA_TUBE_ID), type: "olaTubeOemBed" } }); // G. await add later // I. id // a. actions // c. contentDigest // t. type // i. internal: { // o. (OLA_TUBE_ID) // n. node // s. Sing

// I. id const OLA_TUBE_ID = "4nWUMgiEpdc" const nodeMeta = { id: OLA_TUBE_ID, } console.log('🗣️ id my Node 💰', nodeMeta);