Merge pull request #1301 from omnivore-app/fix/substack-anchor-headers

Improvements to substack article handling
This commit is contained in:
Jackson Harper 2022-10-12 15:15:45 +08:00 committed by GitHub
commit 2b4b528c64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 597 additions and 2 deletions

View file

@ -171,10 +171,10 @@ Readability.prototype = {
// Readability-readerable.js. Please keep both copies in sync.
articleNegativeLookBehindCandidates: /breadcrumbs|breadcrumb|utils|trilist/i,
articleNegativeLookAheadCandidates: /outstream(.?)_|sub(.?)_|m_|omeda-promo-|in-article-advert|block-ad-.*/i,
unlikelyCandidates: /\bad\b|ai2html|banner|breadcrumbs|breadcrumb|combx|comment|community|cover-wrap|disqus|extra|footer|gdpr|header|legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper|social|sponsor|supplemental|ad-break|agegate|pagination|pager(?!ow)|popup|yom-remote|copyright|keywords|outline|infinite-list|beta|recirculation|site-index|hide-for-print|post-end-share-cta|post-end-cta-full|post-footer|post-head|post-tag|li-date|main-navigation|programtic-ads|outstream_article|hfeed|comment-holder|back-to-top|show-up-next|onward-journey|topic-tracker|list-nav|block-ad-entity|adSpecs|gift-article-button|modal-title|in-story-masthead|share-tools|standard-dock|expanded-dock|margins-h/i,
unlikelyCandidates: /\bad\b|ai2html|banner|breadcrumbs|breadcrumb|combx|comment|community|cover-wrap|disqus|extra|footer|gdpr|header|legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper|social|sponsor|supplemental|ad-break|agegate|pagination|pager(?!ow)|popup|yom-remote|copyright|keywords|outline|infinite-list|beta|recirculation|site-index|hide-for-print|post-end-share-cta|post-end-cta-full|post-footer|post-head|post-tag|li-date|main-navigation|programtic-ads|outstream_article|hfeed|comment-holder|back-to-top|show-up-next|onward-journey|topic-tracker|list-nav|block-ad-entity|adSpecs|gift-article-button|modal-title|in-story-masthead|share-tools|standard-dock|expanded-dock|margins-h|subscribe-dialog/i,
// okMaybeItsACandidate: /and|article(?!-breadcrumb)|body|column|content|main|shadow|post-header/i,
get okMaybeItsACandidate() {
return new RegExp(`and|(?<!${this.articleNegativeLookAheadCandidates.source})article(?!-(${this.articleNegativeLookBehindCandidates.source}))|body|column|content|^(?!main-navigation|main-header)main|shadow|post-header|hfeed site|blog-posts hfeed|container-banners|menu-opacity`, 'i')
return new RegExp(`and|(?<!${this.articleNegativeLookAheadCandidates.source})article(?!-(${this.articleNegativeLookBehindCandidates.source}))|body|column|content|^(?!main-navigation|main-header)main|shadow|post-header|hfeed site|blog-posts hfeed|container-banners|menu-opacity|header-with-anchor-widget`, 'i')
},
positive: /article|body|content|entry|hentry|h-entry|main|page|pagination|post|text|blog|story|tweet(-\w+)?|instagram|image|container-banners/i,

View file

@ -56,6 +56,7 @@
<p>
<span>Which brings us to the third item on the list, and the real sticking point. As far as Im aware, no current or planned future Web API ever lets you do number three. There are many new web “technologies” swarming around the custom packet idea (</span><a href="https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API" rel="">WebRTC</a><span>,</span> <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API" rel="">WebSockets</a><span>,</span> <a href="https://github.com/w3c/webtransport" rel="">WebTransport</a><span>), but to the best of my knowledge, all of them require an HTTPS connection to be made first, so your “custom packet” servers still need to implement all of HTTPS anyway.</span>
</p>
<h2> What is the deployment scenario? </h2>
<p> I can imagine someone raising the following objection at this point: “If you dont support HTTPS on the server, how do you serve the WASM/JavaScript/whatever with the custom packet logic in the first place?” </p>
<p> Thats a reasonable question. </p>
<p> The answer is, the two most logical deployment scenarios I can think of both involve a separate server (or process) for the initial HTTPS transaction. </p>
@ -64,6 +65,7 @@
<span>The second would be less common, but plausible: you run your own CDN-equivalent, because</span> <a href="https://knowyourmeme.com/memes/chuck-norris-facts" rel="">youre just that hard core</a><span>. But you expect that your HTTPS code is more vulnerable than your custom code, since HTTPS is vastly more complicated and has ridiculous things in it like arbitrary text parsing, which no one in their right mind would ever put into a “secure” protocol. So you cabin your HTTPS server instances into their own restricted processes or own machines entirely. This prevents exploits of the HTTPS code from affecting anything other than newly connecting users - existing users (who are only talking to your custom servers) remain unharmed.</span>
</p>
<p> In neither scenario do you actually include HTTPS code in any of the processes running your actual secure server. </p>
<h2> What precedent has been set by other “secure” APIs in the browser? </h2>
<p> So thats the hopefully-at-least-somewhat-convincing explanation of why someone might want raw UDP. Now the question is, can raw UDP be provided by a browser in a way that is “secure”? </p>
<p>
<span>Im putting a lot of these words in scare quotes because browsers</span> <em>arent</em> <span>secure for any serious definition of that word, and hopefully that is overwhelmingly obvious to everyone who has ever used one. But just to be clear about the landscape, there are two different ways browsers are not secure:</span>
@ -113,6 +115,7 @@
<p>
<span>Hopefully we can all agree that this extremely low bar for security is the only hurdle one should have to clear in order to dismiss concerns of “security” as a reason not to implement a feature in a W3C spec. Its not much, but it is</span> <em>something</em><span>.</span>
</p>
<h2> Can raw UDP meet this security standard? </h2>
<p>
<span>OK, finally, with all that out of the way, this is what I actually wanted someone to point me to</span> <a href="https://twitter.com/cmuratori/status/1543874684868931584" rel="">when I asked about this on Twitter</a><span>. I just wanted to see that someone, somewhere, had worked out exactly why UDP could not be made to fit the same security model considered acceptable across other basic web features already deployed and considered “secure”.</span>
</p>
@ -142,6 +145,7 @@
<span>Nobody seems to be panicked about this. Nobody has pushed the policy that the W3C should standardize on a specific web server deployment that you are forced to use, or a set of n of them made by Google/Mozilla/Apple, or what have you. It is just assumed that everyone is allowed to write their own</span> <em>server</em> <span>packet handling, but that no one is allowed to write their own</span> <em>client</em> <span>packet handling.</span>
</p>
<p> So thats what I would like explained. Internet, justify this! </p>
<h2> Appendix A.1.2b subsection 12: What about destination consent? </h2>
<p> I have seen people mention (but not support) a claim that raw UDP would cause “denial of service” problems because malicious web pages would send UDP packets to random servers in an attempt to overload them. This claim seems completely baseless to me, because there is no reason why you cant employ the relevant XHR DDoS restrictions to UDP. If DDoS was the concern, just require that UDP packets be sent exclusively within the same domain as the originating code. </p>
<p>
<span>Furthermore, you could restrict the port ranges of raw web UDP to some assigned range. A new port range could be explicitly reserved</span> <em>just for raw web UDP</em> <span>if that makes people more comfortable, so it could literally be discarded at the gateway on any network that doesnt want to support raw UDP for web, making it easier to deal with than UDP attacks from native code and viruses which can choose their ports at will.</span>

View file

@ -0,0 +1,12 @@
{
"title": "Getting Started with Omnivore",
"byline": "Omnivore",
"dir": null,
"excerpt": "Omnivore is a read-it-later app that lets you save and organize everything you read online.",
"siteName": "Omnivore",
"siteIcon": "https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f6c575c-355b-44a6-a8e6-67a1c3745b59/favicon.ico",
"previewImage": "https://substackcdn.com/image/fetch/w_1008,h_528,c_fill,f_jpg,q_auto:best,fl_progressive:steep/https%3A%2F%2Fblog.omnivore.app%2Ftwitter%2Fsubscribe-card.svg%3Fv%3De03aaf5cd51e4035f38f2aa621f6a29c%26version%3D7",
"publishedDate": null,
"language": "English",
"readerable": true
}

View file

@ -0,0 +1,257 @@
<DIV class="page" id="readability-page-1">
<article>
<div>
<h3>Omnivore is a read-it-later app that lets you save and organize everything you read online.</h3>
</div>
<div dir="auto">
<p>This guide will show you how to use Omnivores basic functions and advanced features, divided into four main activities:</p>
<ul>
<li>
<p>Saving</p>
</li>
<li>
<p>Reading</p>
</li>
<li>
<p>Organizing</p>
</li>
<li>
<p>Integrations</p>
</li>
</ul>
<p><span>The </span><strong>Library </strong><span>is the center of your Omnivore experience, where you can quickly access any links you have saved. Saved links remain in your Library forever unless you delete them.</span></p>
<p>There are five ways to save links to pages or articles that you wish to read later:</p>
<ul>
<li>
<p>Saving from Your Omnivore Library</p>
</li>
<li>
<p>Saving from a Browser&nbsp;</p>
</li>
<li>
<p>Saving from a Phone or Tablet (iOS or Android)</p>
</li>
<li>
<p>Newsletter Subscriptions via Email</p>
</li>
<li>
<p><span>Saving PDFs from a Mac </span><br></p>
</li>
</ul>
<h3>Saving from Your Omnivore Library</h3>
<p><span>1. In the upper right corner of your Library, tap the </span><strong>Add Link</strong><span> button. </span><br><span>2. Enter the URL you wish to save and tap </span><strong>Add Link</strong><span>.</span><br><span>3. The link will appear in your Library the next time you refresh it.</span><br></p>
<h3>Saving from a Browser</h3>
<p>1. Download and install the Omnivore extension for your browser:</p>
<ul>
<li>
<p><a href="https://omnivore.app/install/chrome" rel="">Chrome&nbsp;</a></p>
</li>
<li>
<p><a href="https://omnivore.app/install/edge" rel="">Edge</a></p>
</li>
<li>
<p><a href="https://omnivore.app/install/firefox" rel="">Firefox</a></p>
</li>
<li>
<p><a href="https://omnivore.app/install/safari" rel="">Safari</a></p>
</li>
</ul>
<p><span>2. Navigate to the page you wish to save and tap the Omnivore button in your browsers toolbar or Extensions menu.</span><br><span>3. Alternatively, you can right-click (command+click on Mac) on any hyperlink and select </span><strong>Save to Omnivore</strong><span> from the menu.</span><br><span>4. The link will appear in your Library the next time you refresh it.</span><br></p>
<h3>Saving from a Phone or Tablet</h3>
<p>The best way to save links from your mobile device is via the Omnivore app. You can download the app here:</p>
<ul>
<li>
<p><a href="https://omnivore.app/install/ios" rel="">iOS (iPhone or iPad)</a></p>
</li>
<li>
<p>Android</p>
</li>
</ul>
<p>Once the mobile app is installed:</p>
<ol>
<li>
<p><span>In your browser, navigate to the page you wish to save and tap the </span><strong>Share</strong><span> button.</span></p>
</li>
<li>
<p><span>Tap the </span><strong>Omnivore</strong><span> icon in the Share menu.</span></p>
</li>
<li>
<p>The link will appear in your Library the next time you refresh it.</p>
</li>
</ol>
<h3>Newsletter Subscriptions via Email</h3>
<p><span>1. On the Omnivore website or app, tap your photo, initial, or avatar in the top right corner to access the profile menu. Select </span><strong>Emails</strong><span> from the menu.</span></p>
<p><span>2. Tap </span><strong>Create a New Email Address</strong><span> to add a new email address (ex: username-123_abc@inbox.omnivore.app) to the list.</span></p>
<p>3. Click the Copy icon next to the email address.</p>
<p><span>4. Navigate to the signup page for the newsletter you wish to subscribe to.</span><br><span>5. Paste the Omnivore email address into the signup form.</span></p>
<p>6. New newsletters will be automatically delivered to your Omnivore inbox.</p>
<h3>Saving PDFs from a Mac&nbsp;</h3>
<ol>
<li>
<p><span>Install the </span><a href="https://omnivore.app/install/mac" rel="">Mac App</a><span>.&nbsp;</span></p>
</li>
<li>
<p>On your Mac, locate the PDF you wish to save and right-click or ctrl+click on the file name.</p>
</li>
<li>
<p><span>Select </span><strong>Share</strong><span> from the menu and choose </span><strong>Omnivore</strong><span>.</span></p>
</li>
<li>
<p>The link will appear in your Library the next time you refresh it.</p>
</li>
</ol>
<h2>Reading</h2>
<p>Click any link saved in your Library to enter the Reader view.&nbsp;</p>
<p>Omnivore formats pages for easy reading and highlighting, removing ads and clutter for distraction-free reading. The text-focused view also makes articles smaller and quicker to load.</p>
<p>While reading, you can:</p>
<ul>
<li>
<p>Change Formatting</p>
</li>
<li>
<p>Highlight Text</p>
</li>
<li>
<p>Add Notes</p>
</li>
<li>
<p>View All Saved Highlights and Notes</p>
</li>
<li>
<p>Track Reading Progress</p>
</li>
</ul>
<h3>Change Formatting&nbsp;</h3>
<ol>
<li>
<p><em><strong>Theme:</strong></em><span> Tap your photo, initial, or avatar&nbsp; in the top right corner to access the profile menu. Select the white or black thumbnail to choose the Light or Dark theme.</span></p>
</li>
<li>
<p><em><strong>Text Formatting:</strong></em><span> Tap the Aa icon to adjust the text size, font, margins, and line spacing.</span></p>
</li>
</ol>
<h3>Highlight Text</h3>
<ol>
<li>
<p>Select the text you wish to highlight.</p>
</li>
<li>
<p><span>Tap the </span><strong>Highlight </strong><span>button.</span></p>
</li>
<li>
<p>The text will appear highlighted next time you view the article.</p>
</li>
</ol>
<h3>Add Notes</h3>
<ol>
<li>
<p>Highlight a section of text where you wish to add a note.</p>
</li>
<li>
<p><span>Tap the </span><strong>Note</strong><span> button, type your note, and tap </span><strong>Save</strong><span>.</span></p>
</li>
<li>
<p>The Note icon will appear next time you view this article.</p>
</li>
</ol>
<h3>View All Saved Highlights and Notes</h3>
<ol>
<li>
<p>Tap the Highlight/Note icon to see a list of all the highlighted text and notes you have added to this page.</p>
</li>
<li>
<p>To remove a note or highlight, select it from the list and tap the Trash icon.</p>
</li>
</ol>
<h3>Track Reading Progress</h3>
<p>Omnivore automatically keeps track of your reading progress across your different devices so you can easily pick up where you left off. A progress bar will appear at the top of each link in your Library after you have started reading.</p>
<h2>Organizing</h2>
<p>By default, the Library inbox displays all links you have saved. To manage your list and keep your reading organized, Omnivore provides the following actions:&nbsp;</p>
<ul>
<li>
<p>Archiving</p>
</li>
<li>
<p>Labels</p>
</li>
<li>
<p>Search</p>
</li>
<li>
<p>Filters</p>
</li>
</ul>
<h2>Archiving (Web)</h2>
<ol>
<li>
<p>Tap the Menu icon next to the link you wish to archive (on the mobile app, long press the link to open the menu).</p>
</li>
<li>
<p><span>Select </span><strong>Archive</strong><span>.</span></p>
</li>
<li>
<p>The link will disappear from the default Library view, but will show up if you select the Archived filter (see Filters below).</p>
</li>
</ol>
<h3><strong>Labels</strong></h3>
<ol>
<li>
<p><span>Tap the Menu icon next to any link and select </span><strong>Set Label</strong><span>s.</span></p>
</li>
<li>
<p><span>Select an existing label from the list or tap </span><strong>Edit Labels</strong><span> to create a new one.</span></p>
</li>
<li>
<p>The label will appear next to the link in your Library. Tap it to view all links with the same label.</p>
</li>
<li>
<p><em>Omnivore mobile app only</em><span>: tap </span><strong>Labels </strong><span>to see a complete list of all labels you have used; tap one to view all links with the same label</span></p>
</li>
<li>
<p>Note: Omnivore will automatically assign some labels, such as “Newsletters.”</p>
</li>
</ol>
<h3>Search</h3>
<ol>
<li>
<p>To search through all your saved links, enter a keyword or phrase in the search bar.&nbsp;</p>
</li>
<li>
<p><span>You can combine keywords with labels and filters to focus your search even further. </span><a href="https://omnivore.app/help/search" rel="">Learn more about advanced search</a><span>.</span></p>
</li>
</ol>
<h3>Filters</h3>
<ol>
<li>
<p><span>Use the </span><strong>Filters </strong><span>menu to refine your Library view (some filters may be visible by default).</span></p>
</li>
<li>
<p><span>Select </span><strong>Read Later</strong><span> to view a list of all your non-archived links except Newsletters.</span></p>
</li>
<li>
<p><span>Select </span><strong>Highlights</strong><span> to view the text selections you have highlighted in all your saved pages.&nbsp;</span></p>
</li>
<li>
<p><span>Select </span><strong>Today</strong><span> to view a list of links you saved today.</span></p>
</li>
<li>
<p><span>Select </span><strong>Newsletters</strong><span> to view links saved via your newsletter subscriptions.</span></p>
</li>
</ol>
<h2>Integrations</h2>
<p>Omnivore allows integrations with knowledge bases and note-taking apps including:</p>
<ul>
<li>
<p>Logseq</p>
</li>
<li>
<p>Webhooks</p>
</li>
</ul>
<h3>Logseq</h3>
<p><span>With Omnivore's Logseq plugin you can sync all your saved articles, highlights, and notes into Logseq, a popular knowledge base. For information on setting up and using the Logseq plugin, please refer to this helpful </span><a href="https://briansunter.com/graph/%23/page/omnivore-logseq-guide" rel="">Omnivore for Logseq Plugin Guide</a><span>.</span></p>
<h3>Webhooks</h3>
<p>Omnivore can trigger webhooks when you save a link or add highlights to a page you are reading. This example shows webhooks being used to write all saved links to a Google Sheets spreadsheet stored on a Google Drive.</p>
</div>
</article>
</DIV>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
https://blog.omnivore.app/p/d0d30ea5-49aa-4c04-8fae-c004be9c51b9