diff --git a/helpers/build-video-list.js b/helpers/build-video-list.js index 60d1ce7..392541f 100644 --- a/helpers/build-video-list.js +++ b/helpers/build-video-list.js @@ -1,93 +1,7 @@ -import { promises as fs } from 'fs' -import MarkdownIt from 'markdown-it' import slugify from 'slugify' import axios from 'axios' -import statuses from './statuses' -import parseGithubDate from './parse-github-date' - - -const md = new MarkdownIt() - - - -const getTokenLinks = function ( childTokens ) { - - const tokenList = [] - - let isLink = false - - for (const token of childTokens) { - - // On link_ switch link mode - // link_open = true - // link_close = false - if (token.type.includes('link_')) isLink = !isLink - - // For link_open create a new related link in our list - // and store thee attributes into it - if ( isLink && token.type === 'link_open' ) { - tokenList.push({ - ...Object.fromEntries(token.attrs) - }) - } - - // For the text inside the link - // store that text as the label for the link we're inside - if ( isLink && token.type === 'text' ) { - // Get the last pushed link - const currentLink = tokenList[tokenList.length-1] - - // Add our text to it as a label - tokenList[tokenList.length-1] = { - ...currentLink, - label: token.content - } - } - - } - - return tokenList -} - - -const lookForLastUpdated = function (app, commits) { - - for (const { node: commit } of commits) { - - // console.log('commit', commit) - - // $$ If message body contains endpoint - if (commit.messageBody.includes(app.endpoint)) { - // console.log('Found', app.name ,commit.committedDate) - return commit.committedDate - } - - // $$ If message body contains App Name - if (commit.messageBody.includes(app.name)) { - // console.log('Found', app.name ,commit.committedDate) - return commit.committedDate - } - - // $$ If message headline contains App Name - if (commit.messageHeadline.includes(app.name)) { - // console.log('Found', app.name ,commit.committedDate) - return commit.committedDate - } - - // $$$ If commits comments contains endpoint - for (const { node: comment } of commit.comments.edges) { - if (comment.body.includes(app.endpoint)) { - // console.log('Found', app.name ,commit.committedDate) - return commit.committedDate - } - } - - } - - return null -} const videoFeaturesApp = function (app, video) { @@ -105,8 +19,6 @@ const videoFeaturesApp = function (app, video) { export default async function ( applist ) { - console.log('applist', applist.length) - // Fetch Commits const response = await axios.get(process.env.VIDEO_SOURCE) // Extract commit from response data