@@ -3,7 +3,7 @@ import { HTMLAnchorElement, HTMLElement, parseHTML } from "linkedom";
3
3
4
4
export async function crawlExtension (
5
5
id : string ,
6
- lang : string
6
+ lang : string ,
7
7
) : Promise < Gql . ChromeExtension | undefined > {
8
8
consola . info ( "Crawling " + id ) ;
9
9
const url = `https://chromewebstore.google.com/detail/${ id } ?hl=${ lang } ` ;
@@ -28,13 +28,13 @@ export async function crawlExtension(
28
28
const storeUrl = metaContent ( document , "property=og:url" ) ;
29
29
const iconUrl = metaContent ( document , "property=og:image" ) ?. replace (
30
30
/ = .+ ?$ / ,
31
- "=s256"
31
+ "=s256" ,
32
32
) ;
33
33
const shortDescription = metaContent ( document , "property=og:description" ) ;
34
34
35
35
// Grab the main sections that contain content
36
36
const sections = ( document as HTMLElement ) . querySelectorAll (
37
- "main > * > section"
37
+ "main > * > section" ,
38
38
) ;
39
39
const header : HTMLElement = sections [ 0 ] ;
40
40
const description : HTMLElement = sections [ 2 ] ;
@@ -69,10 +69,10 @@ export async function crawlExtension(
69
69
// </span>
70
70
// </span>
71
71
const ratingRow = header . querySelector (
72
- "div:first-child > div:nth-child(2) > span:last-child"
72
+ "div:first-child > div:nth-child(2) > span:last-child" ,
73
73
) ;
74
74
const rating = extractNumber (
75
- ratingRow . querySelector ( "span:first-child > span:first-child" ) . textContent
75
+ ratingRow . querySelector ( "span:first-child > span:first-child" ) . textContent ,
76
76
) ;
77
77
const reviewCount = extractNumber ( ratingRow . querySelector ( "p" ) . textContent ) ;
78
78
0 commit comments