Skip to content

Commit

Permalink
feat: scrape suffix in s3 filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
dipratap committed Sep 2, 2024
1 parent 6eefe49 commit 9001f1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/metatags/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import SeoChecks from './seo-checks.js';
async function fetchAndProcessPageObject(s3Client, bucketName, key, prefix, log) {
const object = await getObjectFromKey(s3Client, bucketName, key, log);
if (!object?.Body?.tags || typeof object.Body.tags !== 'object') {
log.error(`No Scraped tags found in S3 ${key} object`);
log.error(`No Scraped tags found in S3 ${key} object with body ${object.Body}`);
return null;
}
const pageUrl = key.slice(prefix.length - 1).replace('.json', ''); // Remove the prefix and .json suffix
const pageUrl = key.slice(prefix.length - 1).replace('scrape.json', ''); // Remove the prefix and .json suffix
return {
[pageUrl]: {
title: object.Body.tags.title,
Expand Down

0 comments on commit 9001f1e

Please sign in to comment.