Skip to content

Commit 096e0a1

Browse files
Fixed mdn source description field scraping
1 parent add9d0b commit 096e0a1

File tree

10 files changed

+34
-30
lines changed

10 files changed

+34
-30
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.3
2+
3+
- Fixed mdn source description field scraping
4+
15
## 1.0.2
26

37
- Updated package.json metadata

dist/db.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/interfaces/HTTPRequestMethod.html

Lines changed: 16 additions & 16 deletions
Large diffs are not rendered by default.

docs/interfaces/HTTPRequestMethodBrowserInfo.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ <h4>Hierarchy</h4>
2424
<ul class="tsd-hierarchy">
2525
<li><span class="target">HTTPRequestMethodBrowserInfo</span></li></ul></section><aside class="tsd-sources">
2626
<ul>
27-
<li>Defined in <a href="https://github.com/pichillilorenzo/http-request-method-db/blob/d523f0b/src/main.ts#L127">main.ts:127</a></li></ul></aside>
27+
<li>Defined in <a href="https://github.com/pichillilorenzo/http-request-method-db/blob/add9d0b/src/main.ts#L127">main.ts:127</a></li></ul></aside>
2828
<section class="tsd-panel-group tsd-index-group">
2929
<section class="tsd-panel tsd-index-panel">
3030
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
@@ -44,21 +44,21 @@ <h3 class="tsd-anchor-link"><span>name</span><a href="#name" aria-label="Permali
4444
<div class="tsd-comment tsd-typography"><p>HTTP Request Method browser info name.</p>
4545
</div><aside class="tsd-sources">
4646
<ul>
47-
<li>Defined in <a href="https://github.com/pichillilorenzo/http-request-method-db/blob/d523f0b/src/main.ts#L131">main.ts:131</a></li></ul></aside></section>
47+
<li>Defined in <a href="https://github.com/pichillilorenzo/http-request-method-db/blob/add9d0b/src/main.ts#L131">main.ts:131</a></li></ul></aside></section>
4848
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="supported" class="tsd-anchor"></a>
4949
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>supported</span><a href="#supported" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
5050
<div class="tsd-signature">supported<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span></div>
5151
<div class="tsd-comment tsd-typography"><p>If the HTTP Request Method is supported by the browser.</p>
5252
</div><aside class="tsd-sources">
5353
<ul>
54-
<li>Defined in <a href="https://github.com/pichillilorenzo/http-request-method-db/blob/d523f0b/src/main.ts#L141">main.ts:141</a></li></ul></aside></section>
54+
<li>Defined in <a href="https://github.com/pichillilorenzo/http-request-method-db/blob/add9d0b/src/main.ts#L141">main.ts:141</a></li></ul></aside></section>
5555
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="version" class="tsd-anchor"></a>
5656
<h3 class="tsd-anchor-link"><span>version</span><a href="#version" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
5757
<div class="tsd-signature">version<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
5858
<div class="tsd-comment tsd-typography"><p>HTTP Request Method browser info label version.</p>
5959
</div><aside class="tsd-sources">
6060
<ul>
61-
<li>Defined in <a href="https://github.com/pichillilorenzo/http-request-method-db/blob/d523f0b/src/main.ts#L136">main.ts:136</a></li></ul></aside></section></section></div>
61+
<li>Defined in <a href="https://github.com/pichillilorenzo/http-request-method-db/blob/add9d0b/src/main.ts#L136">main.ts:136</a></li></ul></aside></section></section></div>
6262
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
6363
<div class="tsd-navigation settings">
6464
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">

docs/interfaces/HTTPRequestMethodDb.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ <h4>Hierarchy</h4>
2727
<h4 class="tsd-before-signature">Indexable</h4>
2828
<div class="tsd-signature"><span class="tsd-signature-symbol">[</span>key: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]: </span><a href="HTTPRequestMethod.html" class="tsd-signature-type" data-tsd-kind="Interface">HTTPRequestMethod</a></div></section><aside class="tsd-sources">
2929
<ul>
30-
<li>Defined in <a href="https://github.com/pichillilorenzo/http-request-method-db/blob/d523f0b/src/main.ts#L89">main.ts:89</a></li></ul></aside></div>
30+
<li>Defined in <a href="https://github.com/pichillilorenzo/http-request-method-db/blob/add9d0b/src/main.ts#L89">main.ts:89</a></li></ul></aside></div>
3131
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
3232
<div class="tsd-navigation settings">
3333
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">

docs/interfaces/HTTPRequestMethodSpecification.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ <h4>Hierarchy</h4>
2424
<ul class="tsd-hierarchy">
2525
<li><span class="target">HTTPRequestMethodSpecification</span></li></ul></section><aside class="tsd-sources">
2626
<ul>
27-
<li>Defined in <a href="https://github.com/pichillilorenzo/http-request-method-db/blob/d523f0b/src/main.ts#L103">main.ts:103</a></li></ul></aside>
27+
<li>Defined in <a href="https://github.com/pichillilorenzo/http-request-method-db/blob/add9d0b/src/main.ts#L103">main.ts:103</a></li></ul></aside>
2828
<section class="tsd-panel-group tsd-index-group">
2929
<section class="tsd-panel tsd-index-panel">
3030
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
@@ -43,14 +43,14 @@ <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code
4343
<div class="tsd-comment tsd-typography"><p>HTTP Request Method specification documentation link.</p>
4444
</div><aside class="tsd-sources">
4545
<ul>
46-
<li>Defined in <a href="https://github.com/pichillilorenzo/http-request-method-db/blob/d523f0b/src/main.ts#L112">main.ts:112</a></li></ul></aside></section>
46+
<li>Defined in <a href="https://github.com/pichillilorenzo/http-request-method-db/blob/add9d0b/src/main.ts#L112">main.ts:112</a></li></ul></aside></section>
4747
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="name" class="tsd-anchor"></a>
4848
<h3 class="tsd-anchor-link"><span>name</span><a href="#name" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
4949
<div class="tsd-signature">name<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
5050
<div class="tsd-comment tsd-typography"><p>HTTP Request Method specification name.</p>
5151
</div><aside class="tsd-sources">
5252
<ul>
53-
<li>Defined in <a href="https://github.com/pichillilorenzo/http-request-method-db/blob/d523f0b/src/main.ts#L107">main.ts:107</a></li></ul></aside></section></section></div>
53+
<li>Defined in <a href="https://github.com/pichillilorenzo/http-request-method-db/blob/add9d0b/src/main.ts#L107">main.ts:107</a></li></ul></aside></section></section></div>
5454
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
5555
<div class="tsd-navigation settings">
5656
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">

docs/variables/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<h1>Variable default</h1></div>
1616
<div class="tsd-signature">default<span class="tsd-signature-symbol">:</span> <a href="../interfaces/HTTPRequestMethodDb.html" class="tsd-signature-type" data-tsd-kind="Interface">HTTPRequestMethodDb</a></div><aside class="tsd-sources">
1717
<ul>
18-
<li>Defined in <a href="https://github.com/pichillilorenzo/http-request-method-db/blob/d523f0b/src/main.ts#L312">main.ts:312</a></li></ul></aside></div>
18+
<li>Defined in <a href="https://github.com/pichillilorenzo/http-request-method-db/blob/add9d0b/src/main.ts#L312">main.ts:312</a></li></ul></aside></div>
1919
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
2020
<div class="tsd-navigation settings">
2121
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "http-request-method-db",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "HTTP Request Method Database",
55
"author": {
66
"name": "Lorenzo Pichilli",

scripts/src/mdn-scraper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const run = async () => {
3030
const name = document.querySelector('.main-page-content h1')!.textContent!.trim();
3131

3232
// @ts-ignore
33-
const description = [...document.querySelector('.main-page-content .section-content').querySelectorAll('p')]
33+
const description = [...document.querySelector('.main-page-content .section-content').querySelectorAll(':scope > p')]
3434
.map((p: HTMLParagraphElement) => p.textContent?.trim() ?? '').join('\n');
3535
const note = document.querySelector('.main-page-content .section-content')?.querySelector('.notecard.note')?.textContent?.trim();
3636

src/db.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
},
162162
"get": {
163163
"name": "GET",
164-
"description": "The HTTP GET method requests a representation of the specified resource. Requests using GET should only be used to request data (they shouldn't include data). Note: Sending body/payload in a GET request may cause some existing implementations to reject the request — while not prohibited by the specification, the semantics are undefined. It is better to just avoid sending payloads in GET requests.",
164+
"description": "The HTTP GET method requests a representation of the specified resource. Requests using GET should only be used to request data (they shouldn't include data).",
165165
"note": "Note: Sending body/payload in a GET request may cause some existing implementations to reject the request — while not prohibited by the specification, the semantics are undefined. It is better to just avoid sending payloads in GET requests.",
166166
"syntax": "GET /index.html",
167167
"link": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET",
@@ -241,7 +241,7 @@
241241
},
242242
"head": {
243243
"name": "HEAD",
244-
"description": "The HTTP HEAD method requests the headers that would be returned if the HEAD request's URL was instead requested with the HTTP GET method. For example, if a URL might produce a large download, a HEAD request could read its Content-Length header to check the filesize without actually downloading the file. Warning: A response to a HEAD method should not have a body. If it has one anyway, that body must be ignored: any representation headers that might describe the erroneous body are instead assumed to describe the response which a similar GET request would have received. If the response to a HEAD request shows that a cached URL response is now outdated, the cached copy is invalidated even if no GET request was made.",
244+
"description": "The HTTP HEAD method requests the headers that would be returned if the HEAD request's URL was instead requested with the HTTP GET method. For example, if a URL might produce a large download, a HEAD request could read its Content-Length header to check the filesize without actually downloading the file. If the response to a HEAD request shows that a cached URL response is now outdated, the cached copy is invalidated even if no GET request was made.",
245245
"syntax": "HEAD /index.html",
246246
"link": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD",
247247
"requestHasBody": false,

0 commit comments

Comments
 (0)