File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,13 +5,14 @@ machine:
55
66 node :
77 version :
8- 4.3.2
8+ 6.10
99
1010# # Customize dependencies
1111dependencies :
1212 pre :
1313 - curl -o- -L https://yarnpkg.com/install.sh | bash
1414 - nvm install 7.0.0
15+ - nvm install 6.10.0
1516 # For some reason phantomjs-prebuild is failing w/yarn, but npm installing works
1617 - npm install phantomjs-prebuilt
1718
2930 - nvm use 7.0 && yarn test:web -- --maxWorkers=4 && yarn build:web -- --maxWorkers=4 :
3031 parallel : true
3132 # Switch to check on 4.3.2
32- - nvm use 4.3.2 && yarn build && yarn test:node -- --maxWorkers=4 :
33+ - nvm use 6.10 && yarn build && yarn test:node -- --maxWorkers=4 :
3334 parallel : true
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -3,7 +3,8 @@ export const NYTimesExtractor = {
33
44 title : {
55 selectors : [
6- '.g-headline' ,
6+ 'h1.g-headline' ,
7+ 'h1[itemprop="headline"]' ,
78 'h1.headline' ,
89 ] ,
910 } ,
Original file line number Diff line number Diff line change @@ -102,4 +102,13 @@ describe('NYTimesExtractor', () => {
102102 assert . equal ( author , 'The New York Times' ) ;
103103 assert . equal ( text , 'T he Smithsonian’s N' ) ;
104104 } ) ;
105+
106+ it ( 'returns the title on most recent articles' , async ( ) => {
107+ const html = fs . readFileSync ( './fixtures/www.nytimes.com/1539194812689.html' ) ;
108+ const uri = 'https://www.nytimes.com/2018/10/09/us/politics/nikki-haley-united-nations.html' ;
109+
110+ const { title } = await Mercury . parse ( uri , html ) ;
111+
112+ assert . equal ( title , 'Nikki Haley to Resign as Trump’s Ambassador to the U.N.' ) ;
113+ } ) ;
105114} ) ;
You can’t perform that action at this time.
0 commit comments