1- const { URL } = require ( 'url' ) ;
1+ const { URL } = require ( 'url' ) ;
22
33const cheerio = require ( 'cheerio' ) ;
44const moment = require ( 'moment' ) ;
@@ -16,7 +16,7 @@ class BattleNet {
1616 }
1717
1818 async loadRecentPosts ( ) {
19- const postsUrl = new URL ( `${ this . endpoint } ${ this . profileBase } ${ encodeURIComponent ( this . userId ) } ` ) ;
19+ const postsUrl = new URL ( `${ this . endpoint } ${ this . profileBase } ${ encodeURIComponent ( this . userId ) } ` ) ;
2020 let page ;
2121
2222 try {
@@ -31,8 +31,8 @@ class BattleNet {
3131 for ( let i = 0 ; i < postElements . length ; i = i + 1 ) {
3232 const post = new Post ( ) ;
3333 let postPage ;
34- let $element = page$ ( postElements [ i ] ) ;
35- const fullUrl = new URL ( `${ postsUrl . origin } ${ $element . find ( 'a' ) . first ( ) . attr ( 'href' ) } ` ) ;
34+ let $element = page$ ( postElements [ i ] ) ;
35+ const fullUrl = new URL ( `${ postsUrl . origin } ${ $element . find ( 'a' ) . first ( ) . attr ( 'href' ) } ` ) ;
3636
3737 post . topicTitle = $element
3838 . find ( '.Post-body--topicTitle' )
@@ -42,7 +42,7 @@ class BattleNet {
4242 . find ( '.Post-body--forumName' )
4343 . text ( )
4444 . trim ( ) ;
45- post . topicUrl = `${ fullUrl . origin } ${ fullUrl . pathname } ` ;
45+ post . topicUrl = `${ fullUrl . origin } ${ fullUrl . pathname } ` ;
4646 post . url = fullUrl . toString ( ) ;
4747
4848 try {
@@ -54,7 +54,7 @@ class BattleNet {
5454
5555 return true ;
5656 }
57- const $ = cheerio . load ( postPage ) ;
57+ const $ = cheerio . load ( postPage ) ;
5858 $element = $ ( fullUrl . hash ) ;
5959 const timestampText = $element
6060 . find ( '.Timestamp-details a' )
0 commit comments