@@ -8,12 +8,9 @@ function parse(html){
88 let $ = cheerio . load ( html ) ;
99 $ ( '.athing' ) . each ( function ( ) {
1010 let $storylink = $ ( this ) . find ( '.storylink' ) ;
11- const rank = $ ( this ) . find ( '.rank' ) . text ( ) ;
1211 const title = $storylink . text ( ) ;
1312 const url = helpers . url_refer ( $storylink . attr ( 'href' ) ) ;
1413 let $subtext = $ ( this ) . next ( ) ;
15- const points = $subtext . find ( '.score' ) . text ( ) ;
16- const username = $subtext . find ( '.hnuser' ) . text ( ) ;
1714 let $comments = $subtext . find ( 'a' ) . last ( ) ;
1815 const comments = $comments . text ( ) ;
1916 const YCOMB_COMMENT_URL = "https://news.ycombinator.com/" ;
@@ -28,12 +25,9 @@ function parse(html){
2825 } ) ;
2926
3027 let metadata = { // creates a new object
31- rank : parseInt ( rank ) ,
3228 site : "HN" ,
3329 title : title ,
3430 url : url ,
35- points : parseInt ( points ) ,
36- username : username ,
3731 comments : parseInt ( comments ) ,
3832 comments_link : comments_link
3933 } ;
@@ -45,7 +39,7 @@ function parse(html){
4539exports . htop = function ( req , res ) {
4640 request ( 'https://news.ycombinator.com' , function ( error , response , html ) {
4741 if ( ! error && response . statusCode === 200 ) {
48- res . send ( parse ( html , "news.ycombinator.com" ) ) ;
42+ res . send ( helpers . wrap ( parse ( html , "news.ycombinator.com" ) ) ) ;
4943 }
5044 } ) ;
5145
@@ -54,7 +48,7 @@ exports.htop = function(req,res){
5448exports . hnew = function ( req , res ) {
5549 request ( 'https://news.ycombinator.com/newest' , function ( error , response , html ) {
5650 if ( ! error && response . statusCode === 200 ) {
57- res . send ( parse ( html , "news.ycombinator.com/newest" ) ) ;
51+ res . send ( helpers . wrap ( parse ( html , "news.ycombinator.com/newest" ) ) ) ;
5852 }
5953 } ) ;
6054
0 commit comments