From ffd1337d243158bb1764f7a7fb230c87f18c11db Mon Sep 17 00:00:00 2001 From: Karey Higuera Date: Sun, 3 Jul 2022 19:21:09 -0400 Subject: [PATCH] add fetched timestamp to frontmatter (#28) --- manifest.json | 2 +- package.json | 2 +- src/util.ts | 5 +++++ versions.json | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index 03a9df9..2573c2b 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-tweet-to-markdown", "name": "Tweet to Markdown", - "version": "2.7.1", + "version": "2.8.0", "minAppVersion": "0.12.17", "description": "Save tweets as Markdown files, along with their images, polls, etc.", "author": "kbravh", diff --git a/package.json b/package.json index 7debc2a..f7dca42 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-tweet-to-markdown", - "version": "2.7.1", + "version": "2.8.0", "description": "Save tweets as beautiful markdown files in Obsidian (https://obsidian.md)", "main": "main.js", "engines": { diff --git a/src/util.ts b/src/util.ts index b266cfa..8cee6b4 100644 --- a/src/util.ts +++ b/src/util.ts @@ -360,6 +360,10 @@ export const buildMarkdown = async ( */ const frontmatter = [] if (plugin.settings.frontmatter) { + const fetchedAt = formatTimestamp(new Date().toString(), { + locale: plugin.settings.dateLocale, + format: plugin.settings.dateFormat, + }) frontmatter.push( ...[ '---', @@ -367,6 +371,7 @@ export const buildMarkdown = async ( `handle: "@${user.username}"`, `source: "https://twitter.com/${user.username}/status/${tweet.data.id}"`, `date: "${date}"`, + `fetched: "${fetchedAt}"`, ...metrics, ] ) diff --git a/versions.json b/versions.json index f3575b8..ab191b2 100644 --- a/versions.json +++ b/versions.json @@ -1,3 +1,3 @@ { - "2.7.1": "0.12.17" + "2.8.0": "0.12.17" }