-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: scraper updates and action trigger (#5)
- Loading branch information
1 parent
33bcb1f
commit 7555fce
Showing
4 changed files
with
14 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import { readJSON, writeJSON } from 'https://deno.land/x/flat/mod.ts' | ||
import { cheerio } from "https://deno.land/x/[email protected]/mod.ts"; | ||
|
||
interface Post { | ||
|
@@ -37,7 +36,7 @@ await posts.each(function(index, data) { | |
); | ||
const dataviewCodes = rawData.filter(post => post.content?.includes('```dataview')); | ||
for (const codePosts of dataviewCodes){ | ||
const fileName =`${codePosts.creator?.name || ''}_${codePosts.datePublished?.getTime()}.json` | ||
await writeJSON(`./scripts/${fileName}`, codePosts); | ||
const content = `---\ntitle:\nauthor:${codePosts?.creator?.name} (${codePosts?.creator?.url})\npublication date: ${codePosts.datePublished}\n---\n\n ${codePosts.content}` | ||
const fileName =`${codePosts.creator?.name || ''}_${codePosts.datePublished?.getTime()}.md` | ||
await Deno.writeTextFile(`./scripts/${fileName}`, content); | ||
} | ||
console.log(JSON.stringify(dataviewCodes));// Pluck a specific key off |