Skip to content

Commit

Permalink
deploy: 116cdfc
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Nov 29, 2023
1 parent 4d48fdb commit 6541528
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
17 changes: 17 additions & 0 deletions crawl.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,23 @@ <h2 id="background"><a class="header" href="#background">Background</a></h2>

await website.crawl(onPageEvent, true);
// this will run instantly as the crawl is in the background
</code></pre>
<h2 id="subscriptions"><a class="header" href="#subscriptions">Subscriptions</a></h2>
<p>You can setup many subscriptions to run events when a crawl happens.</p>
<pre><code class="language-ts">import { Website } from &quot;@spider-rs/spider-rs&quot;;

const website = new Website(&quot;https://rsseau.fr&quot;);

const onPageEvent = (err, value) =&gt; {
console.log(value);
};

const subscriptionID = website.subscribe(onPageEvent);

await website.crawl(onPageEvent);

website.unsubscribe(subscriptionID);
// this will run instantly as the crawl is in the background
</code></pre>

</main>
Expand Down
17 changes: 17 additions & 0 deletions print.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,23 @@ <h2 id="background"><a class="header" href="#background">Background</a></h2>
await website.crawl(onPageEvent, true);
// this will run instantly as the crawl is in the background
</code></pre>
<h2 id="subscriptions"><a class="header" href="#subscriptions">Subscriptions</a></h2>
<p>You can setup many subscriptions to run events when a crawl happens.</p>
<pre><code class="language-ts">import { Website } from &quot;@spider-rs/spider-rs&quot;;

const website = new Website(&quot;https://rsseau.fr&quot;);

const onPageEvent = (err, value) =&gt; {
console.log(value);
};

const subscriptionID = website.subscribe(onPageEvent);

await website.crawl(onPageEvent);

website.unsubscribe(subscriptionID);
// this will run instantly as the crawl is in the background
</code></pre>
<div style="break-before: page; page-break-before: always;"></div><h1 id="scrape"><a class="header" href="#scrape">Scrape</a></h1>
<p>Scape a website and collect the resource data.</p>
<pre><code class="language-ts">import { Website } from &quot;@spider-rs/spider-rs&quot;;
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion searchindex.json

Large diffs are not rendered by default.

0 comments on commit 6541528

Please sign in to comment.