From 135f4a69f5056b76621e44718bd2b342195544c1 Mon Sep 17 00:00:00 2001 From: Chris Bohnert <38424477+bohnertchris@users.noreply.github.com> Date: Thu, 16 Nov 2023 17:07:43 +0100 Subject: [PATCH 01/10] 1st vers of blog article import with basic cleanup --- tools/importer/import.js | 5 +++++ tools/importer/transformers/blogBanner.js | 26 +++++++++++++++++++++++ tools/importer/transformers/index.js | 4 +++- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 tools/importer/transformers/blogBanner.js diff --git a/tools/importer/import.js b/tools/importer/import.js index 7c5077bd..1f623929 100644 --- a/tools/importer/import.js +++ b/tools/importer/import.js @@ -57,6 +57,11 @@ export default { 'div.loader-wrapper', 'div.cmp-page__skiptomaincontent', 'div#mainContent', + 'div.page-header', + // Remove navigation from the beginning of blog entries as well as readmore-type teasers and blurb about 24petwatch at the end + 'nav', + 'div.imagelist', + 'div.cmp-experiencefragment--blog-page-cta-component', ]); // create the metadata block and append it to the main element diff --git a/tools/importer/transformers/blogBanner.js b/tools/importer/transformers/blogBanner.js new file mode 100644 index 00000000..32bc6620 --- /dev/null +++ b/tools/importer/transformers/blogBanner.js @@ -0,0 +1,26 @@ +function blogBanner(main, document) { + + // Banner image is in mainContent element + const bannerImage = main.querySelector('#mainContent img'); + + if( bannerImage ){ + + // Create div to hold image + const div = document.createElement('div'); + const img = document.createElement('img'); + const imgSrc = bannerImage.getAttribute('src'); + img.setAttribute('src', imgSrc); + div.append(img); + + main.prepend(div); + + } + + // const p = document.createElement('p'); + // p.textContent = 'Hello world!'; + // main.append(p); + + +} + +export default blogBanner; diff --git a/tools/importer/transformers/index.js b/tools/importer/transformers/index.js index af31ed21..ea8741ae 100644 --- a/tools/importer/transformers/index.js +++ b/tools/importer/transformers/index.js @@ -7,11 +7,13 @@ import createHeader from './header.js'; import createHero from './hero.js'; import createMetadata from './metadata.js'; import createBold from './bold.js'; +import blogBanner from './blogBanner.js'; export const transformers = [ createBold, createFullLayoutSection, - createHero, + blogBanner, + // createHero, createHomepage, createCards, createFeatureImage, From f41e7da8b596bac76788a4d7e12f8403b79f3719 Mon Sep 17 00:00:00 2001 From: Chris Bohnert <38424477+bohnertchris@users.noreply.github.com> Date: Fri, 17 Nov 2023 13:59:44 +0100 Subject: [PATCH 02/10] Added tags to meta table, removed inline metadata --- tools/importer/import.js | 15 +++++++++++++++ tools/importer/transformers/metadata.js | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/tools/importer/import.js b/tools/importer/import.js index 1f623929..64935b22 100644 --- a/tools/importer/import.js +++ b/tools/importer/import.js @@ -68,6 +68,21 @@ export default { postTransformers.forEach( (fn) => fn.call(this, main, document, params, url), ); + + + // Try to remove dts and dds that are not needed + const dts = document.querySelectorAll('dt'); + const dds = document.querySelectorAll('dd'); + if ( dts ) { + for( let i = 0; i < dts.length; i += 1) { + if( dts[i].textContent === 'Image' || dts[i].textContent === 'Title' || dts[i].textContent === 'Author Bio' || dts[i].textContent === 'Tag' ) + { + dts[i].remove(); + dds[i].remove(); + } + } + } + return main; }, diff --git a/tools/importer/transformers/metadata.js b/tools/importer/transformers/metadata.js index 54758f13..fce65176 100644 --- a/tools/importer/transformers/metadata.js +++ b/tools/importer/transformers/metadata.js @@ -25,6 +25,24 @@ const createMetadata = (main, document) => { delete meta.Title; } + // Get blog article tags + const blogTags = document.querySelectorAll('div.cmp-contentfragment__element--tag > dd.cmp-contentfragment__element-value'); + if( blogTags ) { + for( let i = 0; i < blogTags.length; i += 1 ) { + meta.Tags = blogTags[i].innerHTML.replace('
', ' '); + } + } + + // Get blog related articles + // Assumes that related articles are rendered as the only ul on the page, if not, related articles are borked for the page + const relatedArticles = document.querySelector('ul.cmp-image-list__list'); + if ( relatedArticles ){ + const articleLinks = relatedArticles.querySelectorAll('a.cmp-image-list__item-title-link'); + for ( let i = 0; i < articleLinks.length; i += 0 ) { + meta.Related = articleLinks[i].getAttribute('href'); + } + } + const block = WebImporter.Blocks.getMetadataBlock(document, meta); main.append(block); From a383252691d0454ed2422a4cb29ee97423b858e1 Mon Sep 17 00:00:00 2001 From: Felix Delval Date: Wed, 22 Nov 2023 14:11:55 +0100 Subject: [PATCH 03/10] Blog import --- tools/importer/import.js | 15 +-------------- tools/importer/transformers/blogArticle.js | 19 +++++++++++++++++++ tools/importer/transformers/cleanBlog.js | 13 +++++++++++++ tools/importer/transformers/index.js | 4 ++++ 4 files changed, 37 insertions(+), 14 deletions(-) create mode 100644 tools/importer/transformers/blogArticle.js create mode 100644 tools/importer/transformers/cleanBlog.js diff --git a/tools/importer/import.js b/tools/importer/import.js index 64935b22..c2382d15 100644 --- a/tools/importer/import.js +++ b/tools/importer/import.js @@ -13,6 +13,7 @@ /* eslint-disable class-methods-use-this */ // helix-importer-ui <-> node compatibility: + import { xfTransformers, xfAsyncTransformers, transformers, postTransformers, } from './transformers/index.js'; @@ -69,20 +70,6 @@ export default { (fn) => fn.call(this, main, document, params, url), ); - - // Try to remove dts and dds that are not needed - const dts = document.querySelectorAll('dt'); - const dds = document.querySelectorAll('dd'); - if ( dts ) { - for( let i = 0; i < dts.length; i += 1) { - if( dts[i].textContent === 'Image' || dts[i].textContent === 'Title' || dts[i].textContent === 'Author Bio' || dts[i].textContent === 'Tag' ) - { - dts[i].remove(); - dds[i].remove(); - } - } - } - return main; }, diff --git a/tools/importer/transformers/blogArticle.js b/tools/importer/transformers/blogArticle.js new file mode 100644 index 00000000..7a9f88bf --- /dev/null +++ b/tools/importer/transformers/blogArticle.js @@ -0,0 +1,19 @@ +function createBlogArticle(main, document) { + // Try to remove dts and dds that are not needed + const dts = document.querySelectorAll('dt'); + const dds = document.querySelectorAll('dd'); + if ( dts ) { + for( let i = 0; i < dts.length; i += 1) { + if( dts[i].textContent === 'Text') + { + const div = document.createElement('div'); + div.innerHTML = dds[i].innerHTML; + dts[i].closest('article').appendChild(div); + dts[i].remove(); + dds[i].remove(); + } + } + } +} + +export default createBlogArticle; diff --git a/tools/importer/transformers/cleanBlog.js b/tools/importer/transformers/cleanBlog.js new file mode 100644 index 00000000..7242ee1b --- /dev/null +++ b/tools/importer/transformers/cleanBlog.js @@ -0,0 +1,13 @@ +function cleanBlog(main, document) { + // Try to remove dts and dds that are not needed + const dts = document.querySelectorAll('dt'); + const dds = document.querySelectorAll('dd'); + if (dts) { + for (let i = 0; i < dts.length; i += 1) { + dts[i].remove(); + dds[i].remove(); + } + } +} + +export default cleanBlog; diff --git a/tools/importer/transformers/index.js b/tools/importer/transformers/index.js index ea8741ae..89883ccf 100644 --- a/tools/importer/transformers/index.js +++ b/tools/importer/transformers/index.js @@ -8,11 +8,14 @@ import createHero from './hero.js'; import createMetadata from './metadata.js'; import createBold from './bold.js'; import blogBanner from './blogBanner.js'; +import createBlogArticle from './blogArticle.js'; +import cleanBlog from './cleanBlog.js'; export const transformers = [ createBold, createFullLayoutSection, blogBanner, + createBlogArticle, // createHero, createHomepage, createCards, @@ -33,4 +36,5 @@ export const preTransformers = [ export const postTransformers = [ createMetadata, + cleanBlog ]; From ab268a9be49414a4a23a557205375a14e21df03a Mon Sep 17 00:00:00 2001 From: Felix Delval Date: Thu, 23 Nov 2023 09:55:53 +0100 Subject: [PATCH 04/10] Fixing tags --- tools/importer/transformers/metadata.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/importer/transformers/metadata.js b/tools/importer/transformers/metadata.js index fce65176..8cd8a671 100644 --- a/tools/importer/transformers/metadata.js +++ b/tools/importer/transformers/metadata.js @@ -29,7 +29,9 @@ const createMetadata = (main, document) => { const blogTags = document.querySelectorAll('div.cmp-contentfragment__element--tag > dd.cmp-contentfragment__element-value'); if( blogTags ) { for( let i = 0; i < blogTags.length; i += 1 ) { - meta.Tags = blogTags[i].innerHTML.replace('
', ' '); + meta.Tags = blogTags[i].innerHTML.trim() + .replaceAll('24petwatch:newletter/topic/','',) + .replaceAll('
', ','); } } From 3e0c0d95d35633ba54eb413f4b473996ef2b516c Mon Sep 17 00:00:00 2001 From: Felix Delval Date: Thu, 23 Nov 2023 11:54:59 +0100 Subject: [PATCH 05/10] Fixing metadata --- tools/importer/import.js | 1 + tools/importer/transformers/blogArticle.js | 34 +++++++++++++--------- tools/importer/transformers/metadata.js | 5 ++++ 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/tools/importer/import.js b/tools/importer/import.js index c2382d15..ee9a2959 100644 --- a/tools/importer/import.js +++ b/tools/importer/import.js @@ -63,6 +63,7 @@ export default { 'nav', 'div.imagelist', 'div.cmp-experiencefragment--blog-page-cta-component', + 'div.cmp-layout-manual-articles', ]); // create the metadata block and append it to the main element diff --git a/tools/importer/transformers/blogArticle.js b/tools/importer/transformers/blogArticle.js index 7a9f88bf..7dfaa682 100644 --- a/tools/importer/transformers/blogArticle.js +++ b/tools/importer/transformers/blogArticle.js @@ -1,19 +1,25 @@ function createBlogArticle(main, document) { - // Try to remove dts and dds that are not needed - const dts = document.querySelectorAll('dt'); - const dds = document.querySelectorAll('dd'); - if ( dts ) { - for( let i = 0; i < dts.length; i += 1) { - if( dts[i].textContent === 'Text') - { - const div = document.createElement('div'); - div.innerHTML = dds[i].innerHTML; - dts[i].closest('article').appendChild(div); - dts[i].remove(); - dds[i].remove(); - } - } + // Try to remove dts and dds that are not needed + const dts = document.querySelectorAll('dt'); + const dds = document.querySelectorAll('dd'); + if (dts) { + for (let i = 0; i < dts.length; i += 1) { + if (dts[i].textContent === 'Byline') { + const span = document.createElement('em'); + const authorText = dds[i].textContent.trim(); + span.textContent = authorText; + dts[i].closest('article').appendChild(span); } + + if (dts[i].textContent === 'Text') { + const div = document.createElement('div'); + div.innerHTML = dds[i].innerHTML; + dts[i].closest('article').appendChild(div); + dts[i].remove(); + dds[i].remove(); + } + } + } } export default createBlogArticle; diff --git a/tools/importer/transformers/metadata.js b/tools/importer/transformers/metadata.js index 8cd8a671..5e3f2f6c 100644 --- a/tools/importer/transformers/metadata.js +++ b/tools/importer/transformers/metadata.js @@ -45,6 +45,11 @@ const createMetadata = (main, document) => { } } + const author = document.querySelector('div.cmp-contentfragment__element--byline dd'); + if (author) { + meta.Author = author.textContent.trim().replace(/^By /, ''); + } + const block = WebImporter.Blocks.getMetadataBlock(document, meta); main.append(block); From ed52db6a892c3b35c7bd663299f2bb3a6e86670d Mon Sep 17 00:00:00 2001 From: Felix Delval Date: Fri, 24 Nov 2023 15:09:09 +0100 Subject: [PATCH 06/10] Making image more stable --- tools/blog-us.sorted.txt | 241 ++++++++++++++++++++++++ tools/importer/transformers/metadata.js | 6 +- 2 files changed, 244 insertions(+), 3 deletions(-) create mode 100644 tools/blog-us.sorted.txt diff --git a/tools/blog-us.sorted.txt b/tools/blog-us.sorted.txt new file mode 100644 index 00000000..afa613ee --- /dev/null +++ b/tools/blog-us.sorted.txt @@ -0,0 +1,241 @@ + +https://www.24petwatch.com/blog/10-healthy-pet-tips +https://www.24petwatch.com/blog/10-most-common-signs-of-pet-pain +https://www.24petwatch.com/blog/11-ways-to-be-the-most-responsible-pet-parent-on-the-block +https://www.24petwatch.com/blog/5-things-to-do-with-your-pets-while-self-isolating +https://www.24petwatch.com/blog/5-types-of-calming-dog-beds-for-adopted-dogs +https://www.24petwatch.com/blog/5-ways-to-step-up-your-dog-walking-game +https://www.24petwatch.com/blog/7-creative-ways-to-keep-your-pets-memory-alive +https://www.24petwatch.com/blog/8-ways-to-help-with-dog-separation-anxiety +https://www.24petwatch.com/blog/Pet-Friendly-Healthy-Recipe-Broccoli-Frozen-Dog-Treats +https://www.24petwatch.com/blog/a-message-about-covid-19-coronavirus-from-24petwatch174 +https://www.24petwatch.com/blog/a-quick-guide-to-microchipping +https://www.24petwatch.com/blog/adopting-a-cat-everything-you-need-to-know +https://www.24petwatch.com/blog/adopting-the-right-cat-for-your-household-finding-that-purrfect-pairing +https://www.24petwatch.com/blog/animal-tvmovie-stars--trivia +https://www.24petwatch.com/blog/apple-pretzels +https://www.24petwatch.com/blog/are-essential-oils-safe-for-dogs-and-cats +https://www.24petwatch.com/blog/are-pet-cameras-worth-the-extra-money +https://www.24petwatch.com/blog/ask-the-vet +https://www.24petwatch.com/blog/ask-the-vet-diabetes-awareness +https://www.24petwatch.com/blog/back-to-school-back-to-routine +https://www.24petwatch.com/blog/back-to-school-how-to-help-your-pet-adjust +https://www.24petwatch.com/blog/bark-bitez-recipe +https://www.24petwatch.com/blog/basic-commands-to-teach-your-dog +https://www.24petwatch.com/blog/beagle-guide +https://www.24petwatch.com/blog/benefits-of-training-your-pet +https://www.24petwatch.com/blog/best-dog-friendly-campgrounds-in-north-america +https://www.24petwatch.com/blog/best-dog-hiking-trails-in-north-america +https://www.24petwatch.com/blog/best-dog-restaurants-USA +https://www.24petwatch.com/blog/best-friends-together-again-reunion-story +https://www.24petwatch.com/blog/bite-sized-pumpkin-cheesecakes-for-your-pooch +https://www.24petwatch.com/blog/blackberry-biscuit-recipe +https://www.24petwatch.com/blog/boarding-vs-home-care +https://www.24petwatch.com/blog/boxer-guide +https://www.24petwatch.com/blog/breaking-perceptions-of-shelter-pets +https://www.24petwatch.com/blog/can-a-dog-have-adhd--symptoms--causes--breeds---treatment +https://www.24petwatch.com/blog/cancer-diabetes-awareness-for-pets +https://www.24petwatch.com/blog/cancer-in-cats +https://www.24petwatch.com/blog/cancer-in-dogs +https://www.24petwatch.com/blog/caring-for-your-senior-dog-or-cat +https://www.24petwatch.com/blog/cat-and-dog-puzzle-toys-to-bust-boredom +https://www.24petwatch.com/blog/cat-and-dog-zoomies-explained +https://www.24petwatch.com/blog/cat-colds---what-you-need-to-know +https://www.24petwatch.com/blog/cat-health-and-care +https://www.24petwatch.com/blog/cat-training-basics +https://www.24petwatch.com/blog/cat-utis-6-symptoms-you-should-know +https://www.24petwatch.com/blog/celebrating-world-veterinary-day +https://www.24petwatch.com/blog/chihuahua-guide +https://www.24petwatch.com/blog/choosing-the-right-vet-for-your-pet +https://www.24petwatch.com/blog/common-holiday-pet-hazards-and-how-to-avoid-them +https://www.24petwatch.com/blog/coping-with-company +https://www.24petwatch.com/blog/covid-19-and-pets +https://www.24petwatch.com/blog/date-night-with-your-special-some-paw-dy +https://www.24petwatch.com/blog/destructive-scratching-everything-you-need-to-know +https://www.24petwatch.com/blog/diabetes-in-cats-symptoms-treatment-and-more +https://www.24petwatch.com/blog/diabetes-symptoms-and-treatment-in-dogs +https://www.24petwatch.com/blog/diy--grow-your-own-cat-grass +https://www.24petwatch.com/blog/diy-brain-game-treat-dispenser +https://www.24petwatch.com/blog/diy-breath-mint-dog-treats +https://www.24petwatch.com/blog/diy-cat-puzzle +https://www.24petwatch.com/blog/diy-dog-puzzle +https://www.24petwatch.com/blog/diy-dog-toy +https://www.24petwatch.com/blog/diy-holiday-cat-scratcher +https://www.24petwatch.com/blog/diy-pb-banana-dog-treats +https://www.24petwatch.com/blog/diy-summer-treat-pina-colada-frozen-recipe-for-dogs +https://www.24petwatch.com/blog/diy-t-shirt-hideaway-tent-for-your-cat +https://www.24petwatch.com/blog/diy-treat-jars +https://www.24petwatch.com/blog/diy-treat-recipes-for-dogs-with-food-allergies +https://www.24petwatch.com/blog/diy-winter-paw-protector-for-your-pets +https://www.24petwatch.com/blog/do-you-know-how-to-prevent-pet-poisoning +https://www.24petwatch.com/blog/dog-agility-training-everything-you-need-to-know +https://www.24petwatch.com/blog/dog-allergies-everything-you-need-to-know +https://www.24petwatch.com/blog/dog-and-cat-chew-toys-for-an-amazing-time +https://www.24petwatch.com/blog/dog-and-cat-obesity +https://www.24petwatch.com/blog/dog-cat-safety-in-the-spring +https://www.24petwatch.com/blog/dog-grooming-101 +https://www.24petwatch.com/blog/dog-park-etiquette +https://www.24petwatch.com/blog/dog-treat-homemade-sweet-potato-muffin +https://www.24petwatch.com/blog/dog-walking-how-often-and-why +https://www.24petwatch.com/blog/doggie-donuts-recipe +https://www.24petwatch.com/blog/easter-pet-hazards-what-to-avoid +https://www.24petwatch.com/blog/emergency-disaster-preparedness-for-pets +https://www.24petwatch.com/blog/fireproof-your-pet-with-a-safety-plan +https://www.24petwatch.com/blog/five-cat-facts +https://www.24petwatch.com/blog/french-bulldog-guide +https://www.24petwatch.com/blog/german-shepherd-guide +https://www.24petwatch.com/blog/get-paid-to-hang-out-with-dogs +https://www.24petwatch.com/blog/gifts-for-cat-lovers-2023 +https://www.24petwatch.com/blog/gifts-for-dog-lovers-2023 +https://www.24petwatch.com/blog/gifts-for-the-pet-lover-in-your-life-top-10-gifts-for-pets-and-their-parents +https://www.24petwatch.com/blog/guide-to-grooming-your-dog +https://www.24petwatch.com/blog/halloween-safety-tips-for-pets +https://www.24petwatch.com/blog/handy-tips-for-pet-treats +https://www.24petwatch.com/blog/happy-tail-reunion +https://www.24petwatch.com/blog/happy-tails-reunion-apollo +https://www.24petwatch.com/blog/happy-tails-reunion-arya +https://www.24petwatch.com/blog/happy-tails-reunion-corky +https://www.24petwatch.com/blog/happy-tails-reunion-davis +https://www.24petwatch.com/blog/happy-tails-reunion-mordu +https://www.24petwatch.com/blog/happy-tales-a-reunion-story +https://www.24petwatch.com/blog/healthy-fall-foods-for-pets +https://www.24petwatch.com/blog/healthy-foods-for-pets +https://www.24petwatch.com/blog/heartworm-disease-symptoms-treatment-prevention +https://www.24petwatch.com/blog/help-your-pet-beat-the-heat +https://www.24petwatch.com/blog/hiring-a-pet-sitter +https://www.24petwatch.com/blog/holiday-food-safety-for-pets +https://www.24petwatch.com/blog/how-long-do-cats-live +https://www.24petwatch.com/blog/how-long-do-dogs-live +https://www.24petwatch.com/blog/how-often-should-i-take-my-pet-to-the-vet +https://www.24petwatch.com/blog/how-old-is-my-dog +https://www.24petwatch.com/blog/how-pets-are-good-for-human-health +https://www.24petwatch.com/blog/how-to-avoid-the-vet-during-the-holidays +https://www.24petwatch.com/blog/how-to-choose-a-dog-daycare +https://www.24petwatch.com/blog/how-to-choose-cat-food +https://www.24petwatch.com/blog/how-to-choose-dog-food +https://www.24petwatch.com/blog/how-to-find-a-missing-pet-recovery-prevention +https://www.24petwatch.com/blog/how-to-find-a-pet-sitter +https://www.24petwatch.com/blog/how-to-find-lost-cat-tips-faqs +https://www.24petwatch.com/blog/how-to-find-lost-dog-tips-faqs +https://www.24petwatch.com/blog/how-to-give-back-to-animals-during-the-holidays +https://www.24petwatch.com/blog/how-to-help-your-dog-lose-weight +https://www.24petwatch.com/blog/how-to-keep-your-pets-tick-and-flea-free-this-spring +https://www.24petwatch.com/blog/how-to-prepare-for-a-natural-disaster-or-emergency-evacuation-when-you-have-pets +https://www.24petwatch.com/blog/how-to-prepare-your-dog-for-guests +https://www.24petwatch.com/blog/how-to-properly-clean-your-pets-ears +https://www.24petwatch.com/blog/how-to-safely-walk-more-than-one-dog +https://www.24petwatch.com/blog/how-to-stop-a-dog-from-jumping-everything-you-need-to-know +https://www.24petwatch.com/blog/how-to-stop-a-dog-from-nipping +https://www.24petwatch.com/blog/how-to-stop-dog-barking +https://www.24petwatch.com/blog/how-to-train-your-cat-to-walk-on-a-leash +https://www.24petwatch.com/blog/how-to-travel-stress-free-with-pets +https://www.24petwatch.com/blog/interview-with-a-professional-dog-walker +https://www.24petwatch.com/blog/introducing-new-pets +https://www.24petwatch.com/blog/is-your-cat-a-super-star +https://www.24petwatch.com/blog/k9-veterans-day +https://www.24petwatch.com/blog/keep-calmand-enjoy-the-festivities +https://www.24petwatch.com/blog/keep-fido-fit-for-winter +https://www.24petwatch.com/blog/kids-best-friend-the-bond-between-children-and-pets +https://www.24petwatch.com/blog/labrador-retriever-guide +https://www.24petwatch.com/blog/lost-pet-tips +https://www.24petwatch.com/blog/loving-and-bonding-with-your-pet +https://www.24petwatch.com/blog/make-a-play-date-with-your-pet-this-valentines-day +https://www.24petwatch.com/blog/make-your-new-pet-feel-at-home +https://www.24petwatch.com/blog/meet-dr-jennifer-sperry-pethealth-inc-veterinary-advisor +https://www.24petwatch.com/blog/meowing-in-cats-everything-you-need-to-know +https://www.24petwatch.com/blog/navigating-telemedicine-for-your-pet +https://www.24petwatch.com/blog/new-dog-or-cat-the-ultimate-checklist-for-new-pet-parents +https://www.24petwatch.com/blog/new-pet-guide-for-pet-parents +https://www.24petwatch.com/blog/new-years-resolutions-for-you-and-your-pet +https://www.24petwatch.com/blog/no-bake-nutty-pumpkin-pupems-recipe +https://www.24petwatch.com/blog/no-sew-catnip-bunnies +https://www.24petwatch.com/blog/oral-care-tips-for-your-pet-to-celebrate-dental-health-month +https://www.24petwatch.com/blog/parvovirus-symptoms-treatment-and-prevention +https://www.24petwatch.com/blog/pet-boarding-options +https://www.24petwatch.com/blog/pet-dental-health +https://www.24petwatch.com/blog/pet-emergency-kit +https://www.24petwatch.com/blog/pet-emoji-quiz +https://www.24petwatch.com/blog/pet-fall-safety-tips +https://www.24petwatch.com/blog/pet-fostering +https://www.24petwatch.com/blog/pet-microchip-myths +https://www.24petwatch.com/blog/pet-microchip-registry-how-to-easily-register-your-chip +https://www.24petwatch.com/blog/pet-microchips-101 +https://www.24petwatch.com/blog/pet-oral-health-everything-you-need-to-know +https://www.24petwatch.com/blog/pet-photos-101 +https://www.24petwatch.com/blog/pet-proof-your-yard +https://www.24petwatch.com/blog/pet-sitter-questions-and-expectations +https://www.24petwatch.com/blog/pets-and-fireworks +https://www.24petwatch.com/blog/pets-as-presents +https://www.24petwatch.com/blog/pets-in-apartments +https://www.24petwatch.com/blog/pets-with-disabilities-care-considerations-and-other-ways-to-help +https://www.24petwatch.com/blog/planning-pets-birthday +https://www.24petwatch.com/blog/playing-it-cool-heat-and-senior-pets +https://www.24petwatch.com/blog/practical-and-stylish-cold-weather-wear-for-pets +https://www.24petwatch.com/blog/prepare-for-an-emergency-with-animal-inside-cards +https://www.24petwatch.com/blog/preparing-your-pet-for-winter +https://www.24petwatch.com/blog/pro-tips-how-to-bond-with-your-dog +https://www.24petwatch.com/blog/pros-cons-getting-another-pet +https://www.24petwatch.com/blog/protect-your-pet-in-a-fire-or-other-emergency +https://www.24petwatch.com/blog/protect-your-pet-with-proper-identification-tags-and-microchipping +https://www.24petwatch.com/blog/put-your-microchip-assumptions-to-the-test +https://www.24petwatch.com/blog/recipe-tasty-tuna-treats +https://www.24petwatch.com/blog/red-velvet-pupcakes +https://www.24petwatch.com/blog/road-trip-essentials +https://www.24petwatch.com/blog/senior-pet-care +https://www.24petwatch.com/blog/shelter-spotlight-delaware-humane-association +https://www.24petwatch.com/blog/shelter-spotlight-hawaiian-humane-society +https://www.24petwatch.com/blog/shelter-spotlight-humane-society-of-north-texas +https://www.24petwatch.com/blog/shelter-spotlight-kentucky-humane-society +https://www.24petwatch.com/blog/shelter-spotlight-wisconsin-humane-society +https://www.24petwatch.com/blog/shelters-rescues-and-fosters-respond-to-covid-19-crisis +https://www.24petwatch.com/blog/shih-tzu-guide +https://www.24petwatch.com/blog/siberian-husky-guide +https://www.24petwatch.com/blog/spayneuter-awareness-month-what-you-need-to-know +https://www.24petwatch.com/blog/spring-clean-your-yard-and-keep-your-pet-safe +https://www.24petwatch.com/blog/springtime-hazards-protect-your-pets-from-toxic-plants +https://www.24petwatch.com/blog/st-patricks-day-diy-for-dogs +https://www.24petwatch.com/blog/steps-to-responsible-pet-ownership +https://www.24petwatch.com/blog/stocking-stuffers-for-your-pets +https://www.24petwatch.com/blog/strange-pet-laws-from-around-the-world +https://www.24petwatch.com/blog/summer-safety-tips-for-cats-and-dogs +https://www.24petwatch.com/blog/sunday-football-treats +https://www.24petwatch.com/blog/super-bowl-sundae-treat-for-pets +https://www.24petwatch.com/blog/supporting-shelters-during-covid-19 +https://www.24petwatch.com/blog/swim-safety-for-dogs +https://www.24petwatch.com/blog/the-411-on-trap-neuter-return-tnr +https://www.24petwatch.com/blog/the-7-best-dog-exercises +https://www.24petwatch.com/blog/the-benefits-of-adopting-a-senior-dog +https://www.24petwatch.com/blog/the-benefits-of-training-your-puppy +https://www.24petwatch.com/blog/the-big-move +https://www.24petwatch.com/blog/the-cost-of-pet-ownership +https://www.24petwatch.com/blog/the-first-48-hours-with-a-new-puppy-everything-you-need-to-know +https://www.24petwatch.com/blog/the-hairy-truth-about-pet-shedding +https://www.24petwatch.com/blog/the-pawsitives-of-becoming-a-pet-sitter +https://www.24petwatch.com/blog/the-top-10-harmful-food-and-drink-items-for-dogs +https://www.24petwatch.com/blog/tick-talk +https://www.24petwatch.com/blog/tick-talk--common-misconceptions +https://www.24petwatch.com/blog/tick-talk-2 +https://www.24petwatch.com/blog/ticks-facts +https://www.24petwatch.com/blog/top-10-north-american-dog-friendly-restaurants +https://www.24petwatch.com/blog/top-5-tips-for-camping-with-your-dog +https://www.24petwatch.com/blog/top-pet-names-from-coast-to-coast +https://www.24petwatch.com/blog/top-pet-names-predictions-for-2018 +https://www.24petwatch.com/blog/top-tips-for-camping-with-your-dog +https://www.24petwatch.com/blog/top-tips-for-taking-your-dog-to-work +https://www.24petwatch.com/blog/water-and-boat-safety +https://www.24petwatch.com/blog/what-animal-shelters-really-want-you-to-donate-during-the-holidays +https://www.24petwatch.com/blog/what-does-pet-insurance-cover +https://www.24petwatch.com/blog/what-is-a-pet-insurance-deductible +https://www.24petwatch.com/blog/what-is-your-cats-tail-trying-to-tell-you +https://www.24petwatch.com/blog/what-to-do-if-you-find-lost-missing-pet +https://www.24petwatch.com/blog/what-to-expect-during-tick-flea-season +https://www.24petwatch.com/blog/what-you-didnt-know-about-service-dogs +https://www.24petwatch.com/blog/what-you-need-to-know-before-you-adopt-a-specially-abled-pet +https://www.24petwatch.com/blog/whats-the-best-pet-food-for-your-cat-or-dog +https://www.24petwatch.com/blog/when-your-pet-wont-eat-their-own-food-how-to-handle-a-picky-eater +https://www.24petwatch.com/blog/whiskerdocs-to-the-rescue +https://www.24petwatch.com/blog/why-do-cats-purr +https://www.24petwatch.com/blog/why-does-my-cat-lick-me +https://www.24petwatch.com/blog/winter-pet-care +https://www.24petwatch.com/blog/yorkshire-terrier-guide +https://www.24petwatch.com/blog/your-covid-19-pet-preparedness-plan diff --git a/tools/importer/transformers/metadata.js b/tools/importer/transformers/metadata.js index 70dd3490..8df1bc0a 100644 --- a/tools/importer/transformers/metadata.js +++ b/tools/importer/transformers/metadata.js @@ -13,10 +13,10 @@ const createMetadata = (main, document) => { meta.Description = desc.content; } - const img = document.querySelector('[property="og:image"]'); - if (img && img.content) { + const img = document.querySelector('body img:first-child'); + if (img && img.src) { const el = document.createElement('img'); - el.src = img.content; + el.src = img.src; meta.Image = el; } From c21c698df500e65166aa183f1acd645dfabd7c7f Mon Sep 17 00:00:00 2001 From: Felix Delval Date: Fri, 24 Nov 2023 16:11:57 +0100 Subject: [PATCH 07/10] Trying to have image be correct in the index --- tools/importer/transformers/index.js | 4 ++-- tools/importer/transformers/makeProxySrcs.js | 20 ++++++++++++++++++++ tools/importer/transformers/metadata.js | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 tools/importer/transformers/makeProxySrcs.js diff --git a/tools/importer/transformers/index.js b/tools/importer/transformers/index.js index fd19d391..89883ccf 100644 --- a/tools/importer/transformers/index.js +++ b/tools/importer/transformers/index.js @@ -4,7 +4,7 @@ import createFooter from './footer.js'; import createFullLayoutSection from './fullLayoutSection.js'; import createHomepage from './homepage.js'; import createHeader from './header.js'; -// import createHero from './hero.js'; +import createHero from './hero.js'; import createMetadata from './metadata.js'; import createBold from './bold.js'; import blogBanner from './blogBanner.js'; @@ -36,5 +36,5 @@ export const preTransformers = [ export const postTransformers = [ createMetadata, - cleanBlog, + cleanBlog ]; diff --git a/tools/importer/transformers/makeProxySrcs.js b/tools/importer/transformers/makeProxySrcs.js new file mode 100644 index 00000000..56c95755 --- /dev/null +++ b/tools/importer/transformers/makeProxySrcs.js @@ -0,0 +1,20 @@ +function makeProxySrcs(main, document, host = 'https://www.24petwatch.com') => { + main.querySelectorAll('img').forEach((img) => { + if (img.src.startsWith('//')) { + img.src = `https:${img.src}`; + } else if (img.src.startsWith('/')) { + // make absolute + const cu = new URL(host); + img.src = `${cu.origin}${img.src}`; + } + try { + const u = new URL(img.src); + u.searchParams.append('host', u.origin); + img.src = `http://localhost:3001${u.pathname}${u.search}`; + } catch (error) { + console.warn(`Unable to make proxy src for ${img.src}: ${error.message}`); + } + }); +}; + +export default makeProxySrcs; diff --git a/tools/importer/transformers/metadata.js b/tools/importer/transformers/metadata.js index 8df1bc0a..a8ca6155 100644 --- a/tools/importer/transformers/metadata.js +++ b/tools/importer/transformers/metadata.js @@ -16,7 +16,7 @@ const createMetadata = (main, document) => { const img = document.querySelector('body img:first-child'); if (img && img.src) { const el = document.createElement('img'); - el.src = img.src; + el.src = img.src.replace('https://www.24petwatch.com', ''); meta.Image = el; } From 0853d671b49d29bad12630e751daa23f5be72b52 Mon Sep 17 00:00:00 2001 From: Felix Delval Date: Tue, 28 Nov 2023 10:50:33 +0100 Subject: [PATCH 08/10] Adding the CA urls --- tools/blog-us.sorted.txt | 222 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 222 insertions(+) diff --git a/tools/blog-us.sorted.txt b/tools/blog-us.sorted.txt index afa613ee..23ca0d57 100644 --- a/tools/blog-us.sorted.txt +++ b/tools/blog-us.sorted.txt @@ -239,3 +239,225 @@ https://www.24petwatch.com/blog/why-does-my-cat-lick-me https://www.24petwatch.com/blog/winter-pet-care https://www.24petwatch.com/blog/yorkshire-terrier-guide https://www.24petwatch.com/blog/your-covid-19-pet-preparedness-plan +https://www.24petwatch.com/ca/blog/gifts-for-cat-lovers-2023 +https://www.24petwatch.com/ca/blog/gifts-for-dog-lovers-2023 +https://www.24petwatch.com/ca/blog/the-top-10-harmful-food-and-drink-items-for-dogs +https://www.24petwatch.com/ca/blog/boxer-guide +https://www.24petwatch.com/ca/blog/5-types-of-calming-dog-beds-for-adopted-dogs +https://www.24petwatch.com/ca/blog/parvovirus-symptoms-treatment-and-prevention +https://www.24petwatch.com/ca/blog/best-dog-restaurants-Canada +https://www.24petwatch.com/ca/blog/best-dog-friendly-campgrounds-in-north-america +https://www.24petwatch.com/ca/blog/how-to-give-back-to-animals-during-the-holidays +https://www.24petwatch.com/ca/blog/practical-and-stylish-cold-weather-wear-for-pets +https://www.24petwatch.com/ca/blog/adopting-a-cat-everything-you-need-to-know +https://www.24petwatch.com/ca/blog/senior-pet-care +https://www.24petwatch.com/ca/blog/halloween-safety-tips-for-pets +https://www.24petwatch.com/ca/blog/how-long-do-cats-live +https://www.24petwatch.com/ca/blog/diy-breath-mint-dog-treats +https://www.24petwatch.com/ca/blog/french-bulldog-guide +https://www.24petwatch.com/ca/blog/how-to-avoid-the-vet-during-the-holidays +https://www.24petwatch.com/ca/blog/diy-pb-banana-dog-treats +https://www.24petwatch.com/ca/blog/chihuahua-guide +https://www.24petwatch.com/ca/blog/happy-tails-reunion-arya +https://www.24petwatch.com/ca/blog/pet-photos-101 +https://www.24petwatch.com/ca/blog/springtime-hazards-protect-your-pets-from-toxic-plants +https://www.24petwatch.com/ca/blog/dog-and-cat-obesity +https://www.24petwatch.com/ca/blog/10-most-common-signs-of-pet-pain +https://www.24petwatch.com/ca/blog/pro-tips-how-to-bond-with-your-dog +https://www.24petwatch.com/ca/blog/how-long-do-dogs-live +https://www.24petwatch.com/ca/blog/cancer-in-cats +https://www.24petwatch.com/ca/blog/why-does-my-cat-lick-me +https://www.24petwatch.com/ca/blog/spayneuter-awareness-month-what-you-need-to-know +https://www.24petwatch.com/ca/blog/ticks-facts +https://www.24petwatch.com/ca/blog/diy-t-shirt-hideaway-tent-for-your-cat +https://www.24petwatch.com/ca/blog/diabetes-mellitus-in-cats-what-you-need-to-know +https://www.24petwatch.com/ca/blog/strange-pet-laws-from-around-the-world +https://www.24petwatch.com/ca/blog/cat-and-dog-puzzle-toys-to-bust-boredom +https://www.24petwatch.com/ca/blog/dog-treat-homemade-sweet-potato-muffin +https://www.24petwatch.com/ca/blog/7-creative-ways-to-keep-your-pets-memory-alive +https://www.24petwatch.com/ca/blog/the-cost-of-pet-ownership +https://www.24petwatch.com/ca/blog/lost-pet-recovery-and-prevention-tips +https://www.24petwatch.com/ca/blog/cat-and-dog-zoomies-explained +https://www.24petwatch.com/ca/blog/dog-walking-how-often-and-why +https://www.24petwatch.com/ca/blog/beagle-guide +https://www.24petwatch.com/ca/blog/the-7-best-dog-exercises +https://www.24petwatch.com/ca/blog/dog-park-etiquette +https://www.24petwatch.com/ca/blog/red-velvet-pupcakes +https://www.24petwatch.com/ca/blog/pet-boarding-options +https://www.24petwatch.com/ca/blog/bark-bitez-recipe +https://www.24petwatch.com/ca/blog/healthy-fall-foods-for-pets +https://www.24petwatch.com/ca/blog/what-you-didnt-know-about-service-dogs +https://www.24petwatch.com/ca/blog/pet-dental-health +https://www.24petwatch.com/ca/blog/5-things-to-do-with-your-pets-while-self-isolating +https://www.24petwatch.com/ca/blog/how-to-stop-a-dog-from-nipping +https://www.24petwatch.com/ca/blog/diy-dog-puzzle +https://www.24petwatch.com/ca/blog/shih-tzu-guide +https://www.24petwatch.com/ca/blog/diy-cat-puzzle +https://www.24petwatch.com/ca/blog/diy-treat-jars +https://www.24petwatch.com/ca/blog/how-to-train-your-cat-to-walk-on-a-leash +https://www.24petwatch.com/ca/blog/how-to-help-your-dog-lose-weight +https://www.24petwatch.com/ca/blog/bite-sized-pumpkin-cheesecakes-for-your-pooch +https://www.24petwatch.com/ca/blog/cat-training-basics +https://www.24petwatch.com/ca/blog/pet-microchip-myths +https://www.24petwatch.com/ca/blog/meowing-in-cats-everything-you-need-to-know +https://www.24petwatch.com/ca/blog/planning-pets-birthday +https://www.24petwatch.com/ca/blog/10-healthy-pet-tips +https://www.24petwatch.com/ca/blog/diy--grow-your-own-cat-grass +https://www.24petwatch.com/ca/blog/diy-treat-recipes-for-dogs-with-food-allergies +https://www.24petwatch.com/ca/blog/prepare-for-an-emergency-with-animal-inside-cards +https://www.24petwatch.com/ca/blog/how-to-find-lost-dog-tips-faqs +https://www.24petwatch.com/ca/blog/what-to-expect-during-tick-flea-season +https://www.24petwatch.com/ca/blog/playing-it-cool-heat-and-senior-pets +https://www.24petwatch.com/ca/blog/emergency-disaster-preparedness-for-pets +https://www.24petwatch.com/ca/blog/how-to-estimate-dog-years-to-human-years +https://www.24petwatch.com/ca/blog/protect-your-pet-with-proper-identification-tags-and-microchipping +https://www.24petwatch.com/ca/blog/cat-colds---what-you-need-to-know +https://www.24petwatch.com/ca/blog/can-a-dog-have-adhd--symptoms--causes--breeds---treatment +https://www.24petwatch.com/ca/blog/how-to-stop-a-dog-from-jumping-everything-you-need-to-know +https://www.24petwatch.com/ca/blog/heartworm-disease-symptoms-treatment-prevention +https://www.24petwatch.com/ca/blog/how-to-choose-dog-food +https://www.24petwatch.com/ca/blog/how-to-choose-cat-food +https://www.24petwatch.com/ca/blog/cat-health-and-care +https://www.24petwatch.com/ca/blog/guide-to-grooming-your-dog +https://www.24petwatch.com/ca/blog/how-often-should-i-take-my-pet-to-the-vet +https://www.24petwatch.com/ca/blog/cancer-in-dogs +https://www.24petwatch.com/ca/blog/dog-allergies-everything-you-need-to-know +https://www.24petwatch.com/ca/blog/pet-microchip-registry-how-to-easily-register-your-chip +https://www.24petwatch.com/ca/blog/yorkshire-terrier-guide +https://www.24petwatch.com/ca/blog/how-to-find-lost-cat-tips-faqs +https://www.24petwatch.com/ca/blog/pets-and-fireworks +https://www.24petwatch.com/ca/blog/new-dog-or-cat-the-ultimate-checklist-for-new-pet-parents +https://www.24petwatch.com/ca/blog/the-first-48-hours-with-a-new-puppy-everything-you-need-to-know +https://www.24petwatch.com/ca/blog/date-night-with-your-special-some-paw-dy +https://www.24petwatch.com/ca/blog/pet-fall-safety-tips +https://www.24petwatch.com/ca/blog/healthy-foods-for-pets +https://www.24petwatch.com/ca/blog/pros-cons-getting-another-pet +https://www.24petwatch.com/ca/blog/back-to-school-how-to-help-your-pet-adjust +https://www.24petwatch.com/ca/blog/basic-commands-to-teach-your-dog +https://www.24petwatch.com/ca/blog/8-ways-to-help-with-dog-separation-anxiety +https://www.24petwatch.com/ca/blog/the-benefits-of-training-your-puppy +https://www.24petwatch.com/ca/blog/benefits-of-training-your-pet +https://www.24petwatch.com/ca/blog/siberian-husky-guide +https://www.24petwatch.com/ca/blog/labrador-retriever-guide +https://www.24petwatch.com/ca/blog/how-to-stop-dog-barking +https://www.24petwatch.com/ca/blog/destructive-scratching-everything-you-need-to-know +https://www.24petwatch.com/ca/blog/german-shepherd-guide +https://www.24petwatch.com/ca/blog/dog-agility-training-everything-you-need-to-know +https://www.24petwatch.com/ca/blog/best-dog-hiking-trails-in-north-america +https://www.24petwatch.com/ca/blog/apple-pretzels +https://www.24petwatch.com/ca/blog/pet-microchips-101 +https://www.24petwatch.com/ca/blog/are-essential-oils-safe-for-dogs-and-cats +https://www.24petwatch.com/ca/blog/top-tips-for-taking-your-dog-to-work +https://www.24petwatch.com/ca/blog/super-bowl-sundae-treat-for-pets +https://www.24petwatch.com/ca/blog/happy-tails-reunion-mordu +https://www.24petwatch.com/ca/blog/sunday-football-treats +https://www.24petwatch.com/ca/blog/how-to-prepare-for-a-natural-disaster-or-emergency-evacuation-when-you-have-pets +https://www.24petwatch.com/ca/blog/diy-brain-game-treat-dispenser +https://www.24petwatch.com/ca/blog/what-is-your-cats-tail-trying-to-tell-you +https://www.24petwatch.com/ca/blog/kids-best-friend-the-bond-between-children-and-pets +https://www.24petwatch.com/ca/blog/pets-in-apartments +https://www.24petwatch.com/ca/blog/diy-dog-toy +https://www.24petwatch.com/ca/blog/pet-fostering +https://www.24petwatch.com/ca/blog/how-to-choose-a-dog-daycare +https://www.24petwatch.com/ca/blog/pets-with-disabilities-care-considerations-and-other-ways-to-help +https://www.24petwatch.com/ca/blog/no-sew-catnip-bunnies +https://www.24petwatch.com/ca/blog/pet-sitter-questions-and-expectations +https://www.24petwatch.com/ca/blog/are-pet-cameras-worth-the-extra-money +https://www.24petwatch.com/ca/blog/how-to-properly-clean-your-pets-ears +https://www.24petwatch.com/ca/blog/no-bake-nutty-pumpkin-pupems-recipe +https://www.24petwatch.com/ca/blog/how-to-safely-walk-more-than-one-dog +https://www.24petwatch.com/ca/blog/pet-oral-health-everything-you-need-to-know +https://www.24petwatch.com/ca/blog/recipe-tasty-tuna-treats +https://www.24petwatch.com/ca/blog/diy-summer-treat-pina-colada-frozen-recipe-for-dogs +https://www.24petwatch.com/ca/blog/the-hairy-truth-about-pet-shedding +https://www.24petwatch.com/ca/blog/swim-safety-for-dogs +https://www.24petwatch.com/ca/blog/meet-dr-jennifer-sperry-pethealth-inc-veterinary-advisor +https://www.24petwatch.com/ca/blog/top-tips-for-camping-with-your-dog +https://www.24petwatch.com/ca/blog/water-and-boat-safety +https://www.24petwatch.com/ca/blog/how-to-prepare-your-dog-for-guests +https://www.24petwatch.com/ca/blog/navigating-telemedicine-for-your-pet +https://www.24petwatch.com/ca/blog/handy-tips-for-pet-treats +https://www.24petwatch.com/ca/blog/summer-safety-tips-for-cats-and-dogs +https://www.24petwatch.com/ca/blog/diabetes-symptoms-and-treatment-in-dogs +https://www.24petwatch.com/ca/blog/road-trip-essentials +https://www.24petwatch.com/ca/blog/do-you-know-how-to-prevent-pet-poisoning +https://www.24petwatch.com/ca/blog/pet-proof-your-yard +https://www.24petwatch.com/ca/blog/happy-tails-reunion-apollo +https://www.24petwatch.com/ca/blog/happy-tails-reunion-davis +https://www.24petwatch.com/ca/blog/happy-tails-reunion-corky +https://www.24petwatch.com/ca/blog/tick-talk--common-misconceptions +https://www.24petwatch.com/ca/blog/help-your-pet-beat-the-heat +https://www.24petwatch.com/ca/blog/pet-emergency-kit +https://www.24petwatch.com/ca/blog/lost-pet-tips +https://www.24petwatch.com/ca/blog/whiskerdocs-to-the-rescue +https://www.24petwatch.com/ca/blog/dog-grooming-101 +https://www.24petwatch.com/ca/blog/how-to-travel-stress-free-with-pets +https://www.24petwatch.com/ca/blog/dog-and-cat-chew-toys-for-an-amazing-time +https://www.24petwatch.com/ca/blog/when-your-pet-wont-eat-their-own-food-how-to-handle-a-picky-eater +https://www.24petwatch.com/ca/blog/5-ways-to-step-up-your-dog-walking-game +https://www.24petwatch.com/ca/blog/breaking-perceptions-of-shelter-pets +https://www.24petwatch.com/ca/blog/celebrating-world-veterinary-day +https://www.24petwatch.com/ca/blog/doggie-donuts-recipe +https://www.24petwatch.com/ca/blog/how-pets-are-good-for-human-health +https://www.24petwatch.com/ca/blog/choosing-the-right-vet-for-your-pet +https://www.24petwatch.com/ca/blog/coping-with-company +https://www.24petwatch.com/ca/blog/top-tips-for-selecting-a-dog-daycare +https://www.24petwatch.com/ca/blog/shelter-spotlight-delaware-humane-association +https://www.24petwatch.com/ca/blog/steps-to-responsible-pet-ownership +https://www.24petwatch.com/ca/blog/shelter-spotlight---humane-society-of-north-texas +https://www.24petwatch.com/ca/blog/dog-cat-safety-in-the-spring +https://www.24petwatch.com/ca/blog/spring-clean-your-yard-and-keep-your-pet-safe +https://www.24petwatch.com/ca/blog/get-paid-to-hang-out-with-dogs +https://www.24petwatch.com/ca/blog/make-your-new-pet-feel-at-home +https://www.24petwatch.com/ca/blog/introducing-new-pets +https://www.24petwatch.com/ca/blog/cat-utis-6-symptoms-you-should-know +https://www.24petwatch.com/ca/blog/boarding-vs-home-care +https://www.24petwatch.com/ca/blog/best-friends-together-again-reunion-story +https://www.24petwatch.com/ca/blog/back-to-school-back-to-routine +https://www.24petwatch.com/ca/blog/ask-the-vet +https://www.24petwatch.com/ca/blog/common-holiday-pet-hazards-and-how-to-avoid-them +https://www.24petwatch.com/ca/blog/ask-the-vet-diabetes-awareness +https://www.24petwatch.com/ca/blog/adopting-the-right-cat-for-your-household-finding-that-purrfect-pairing +https://www.24petwatch.com/ca/blog/top-10-north-american-dog-friendly-restaurants +https://www.24petwatch.com/ca/blog/oral-care-tips-for-your-pet-to-celebrate-dental-health-month +https://www.24petwatch.com/ca/blog/loving-and-bonding-with-your-pet +https://www.24petwatch.com/ca/blog/keep-fido-fit-for-winter +https://www.24petwatch.com/ca/blog/keep-calmand-enjoy-the-festivities +https://www.24petwatch.com/ca/blog/k9-veterans-day +https://www.24petwatch.com/ca/blog/is-your-cat-a-super-star +https://www.24petwatch.com/ca/blog/interview-with-a-professional-dog-walker +https://www.24petwatch.com/ca/blog/how-to-keep-your-pets-tick-and-flea-free-this-spring +https://www.24petwatch.com/ca/blog/hiring-a-pet-sitter +https://www.24petwatch.com/ca/blog/happy-tales-a-reunion-story +https://www.24petwatch.com/ca/blog/the-pawsitives-of-becoming-a-pet-sitter +https://www.24petwatch.com/ca/blog/fireproof-your-pet-with-a-safety-plan +https://www.24petwatch.com/ca/blog/easter-pet-hazards-what-to-avoid +https://www.24petwatch.com/ca/blog/top-pet-names-predictions-for-2018 +https://www.24petwatch.com/ca/blog/st-patricks-day-diy-for-dogs +https://www.24petwatch.com/ca/blog/new-years-resolutions-for-you-and-your-pet +https://www.24petwatch.com/ca/blog/top-5-tips-for-camping-with-your-dog +https://www.24petwatch.com/ca/blog/make-a-play-date-with-your-pet-this-valentines-day +https://www.24petwatch.com/ca/blog/how-to-find-a-pet-sitter +https://www.24petwatch.com/ca/blog/supporting-shelters-during-covid-19 +https://www.24petwatch.com/ca/blog/shelters-rescues-and-fosters-respond-to-covid-19-crisis +https://www.24petwatch.com/ca/blog/a-message-about-covid-19-coronavirus-from-24petwatch174 +https://www.24petwatch.com/ca/blog/covid-19-and-pets +https://www.24petwatch.com/ca/blog/your-covid-19-pet-preparedness-plan +https://www.24petwatch.com/ca/blog/what-you-need-to-know-before-you-adopt-a-specially-abled-pet +https://www.24petwatch.com/ca/blog/put-your-microchip-assumptions-to-the-test +https://www.24petwatch.com/ca/blog/shelter-spotlight-wisconsin-humane-society +https://www.24petwatch.com/ca/blog/shelter-spotlight-kentucky-humane-society +https://www.24petwatch.com/ca/blog/what-animal-shelters-really-want-you-to-donate-during-the-holidays +https://www.24petwatch.com/ca/blog/shelter-spotlight-hawaiian-humane-society +https://www.24petwatch.com/ca/blog/what-to-do-if-you-find-lost-missing-pet +https://www.24petwatch.com/ca/blog/preparing-your-pet-for-winter +https://www.24petwatch.com/ca/blog/the-benefits-of-adopting-a-senior-dog +https://www.24petwatch.com/ca/blog/holiday-food-safety-for-pets +https://www.24petwatch.com/ca/blog/caring-for-your-senior-dog-or-cat +https://www.24petwatch.com/ca/blog/new-pet-guide-for-pet-parents +https://www.24petwatch.com/ca/blog/gifts-for-the-pet-lover-in-your-life-top-10-gifts-for-pets-and-their-parents +https://www.24petwatch.com/ca/blog/five-cat-facts +https://www.24petwatch.com/ca/blog/diy-winter-paw-protector-for-your-pets +https://www.24petwatch.com/ca/blog/blackberry-biscuit-recipe +https://www.24petwatch.com/ca/blog/winter-pet-care +https://www.24petwatch.com/ca/blog/Pet-Friendly-Healthy-Recipe-Broccoli-Frozen-Dog-Treats From 1c6e7be5ae169bb95b241133c31ff4c4945af3bf Mon Sep 17 00:00:00 2001 From: Felix Delval Date: Wed, 29 Nov 2023 11:03:41 +0100 Subject: [PATCH 09/10] Using Image from meta if it exists --- tools/importer/transformers/metadata.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/importer/transformers/metadata.js b/tools/importer/transformers/metadata.js index a8ca6155..bee851b2 100644 --- a/tools/importer/transformers/metadata.js +++ b/tools/importer/transformers/metadata.js @@ -20,6 +20,13 @@ const createMetadata = (main, document) => { meta.Image = el; } + const metaImage = document.querySelector('[property="og:image"]'); + if (metaImage) { + const el = document.createElement('img'); + el.src = metaImage.content.replace('https://www.24petwatch.com', ''); + meta.Image = el; + } + if (meta.Title && (meta.Title === 'Footer' || meta.Title === 'Header')) { meta.Robots = 'noindex, nofollow'; delete meta.Title; From 61429e05b59b2bb6aed74b122ec4aaebf989418c Mon Sep 17 00:00:00 2001 From: Felix Delval Date: Wed, 29 Nov 2023 11:55:14 +0100 Subject: [PATCH 10/10] Removed page edited manually --- tools/blog-us.sorted.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/blog-us.sorted.txt b/tools/blog-us.sorted.txt index 23ca0d57..cc4eec08 100644 --- a/tools/blog-us.sorted.txt +++ b/tools/blog-us.sorted.txt @@ -103,7 +103,6 @@ https://www.24petwatch.com/blog/healthy-foods-for-pets https://www.24petwatch.com/blog/heartworm-disease-symptoms-treatment-prevention https://www.24petwatch.com/blog/help-your-pet-beat-the-heat https://www.24petwatch.com/blog/hiring-a-pet-sitter -https://www.24petwatch.com/blog/holiday-food-safety-for-pets https://www.24petwatch.com/blog/how-long-do-cats-live https://www.24petwatch.com/blog/how-long-do-dogs-live https://www.24petwatch.com/blog/how-often-should-i-take-my-pet-to-the-vet @@ -452,7 +451,6 @@ https://www.24petwatch.com/ca/blog/shelter-spotlight-hawaiian-humane-society https://www.24petwatch.com/ca/blog/what-to-do-if-you-find-lost-missing-pet https://www.24petwatch.com/ca/blog/preparing-your-pet-for-winter https://www.24petwatch.com/ca/blog/the-benefits-of-adopting-a-senior-dog -https://www.24petwatch.com/ca/blog/holiday-food-safety-for-pets https://www.24petwatch.com/ca/blog/caring-for-your-senior-dog-or-cat https://www.24petwatch.com/ca/blog/new-pet-guide-for-pet-parents https://www.24petwatch.com/ca/blog/gifts-for-the-pet-lover-in-your-life-top-10-gifts-for-pets-and-their-parents