silly changes
This commit is contained in:
parent
05a771d337
commit
514b16a79e
2 changed files with 8 additions and 6 deletions
|
@ -19,10 +19,12 @@ triggers the supported site badge, but other Forgejo instances should work too.
|
|||
- Medium: Title, author, and date published fields are autofilled from the handy [`NewsArticle` JSON-LD schema](https://schema.org/NewsArticle)
|
||||
included on every page.
|
||||
- Substack: Title, author, and date published fields are autofilled form the handy [`NewsArticle` JSON-LD schema](https://schema.org/NewsArticle)
|
||||
included on every page. The supported site badge may not show for custom domains (i.e. not a `*.substack.com` url), but autofill
|
||||
included on every page. The supported site badge may not show for custom domains (i.e. not a `*.substack.com` url), but autofill
|
||||
should still work.
|
||||
- Youtube: Title, author, and date published fields are autofilled from either the `watch7-content` metadata or the [`VideoObject` JSON-LD schema](https://schema.org/VideoObject).
|
||||
|
||||
***WARNING: All data will be cleared when you close the extension's popup. If you are really proud of a note and want to come back to it later... save it somewhere else I guess?***
|
||||
|
||||
## Wait, what is this even for?
|
||||
|
||||
I have a page on my site called the [sharefeed](https://eleboog.com/sharefeed) where I share links to things I think are interesting.
|
||||
|
@ -36,4 +38,4 @@ author: string? // The author of the linked page.
|
|||
publishedDate: Date? // The date in which the linked page was **originally published**.
|
||||
accessedDate: Date // The date in which the linked page was **accessed by me** (i.e. the date of this entry itself).
|
||||
note: string // A message to be attached to this link, usually detailing why I decided to share it.
|
||||
```
|
||||
```
|
||||
|
|
8
popup.js
8
popup.js
|
@ -32,10 +32,10 @@ function parsePage() {
|
|||
const youtubeMetaElem = document.getElementById('watch7-content');
|
||||
if (youtubeMetaElem) {
|
||||
// url fix
|
||||
entry.url = document.querySelector('link[itemprop="url"]').getAttribute('href');
|
||||
entry.title = document.querySelector('meta[itemprop="name"]').getAttribute('content');
|
||||
entry.author = document.querySelector('span[itemprop="author"] link[itemprop="name"]').getAttribute('content');
|
||||
entry.publishedDate = document.querySelector('meta[itemprop="datePublished"]').getAttribute('content').slice(0, 19);
|
||||
entry.url = youtubeMetaElem.querySelector('link[itemprop="url"]').getAttribute('href');
|
||||
entry.title = youtubeMetaElem.querySelector('meta[itemprop="name"]').getAttribute('content');
|
||||
entry.author = youtubeMetaElem.querySelector('span[itemprop="author"] link[itemprop="name"]').getAttribute('content');
|
||||
entry.publishedDate = youtubeMetaElem.querySelector('meta[itemprop="datePublished"]').getAttribute('content').slice(0, 19);
|
||||
}
|
||||
|
||||
// github scraping
|
||||
|
|
Loading…
Add table
Reference in a new issue