Created
April 26, 2016 17:48
-
-
Save jaredlockhart/3cdd970dd105c2fc0353ba1783a8c4e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 47 function getMetadata(url) { | |
| 48 const response = new Promise((resolve, reject) => { | |
| 49 jsdom.env({ | |
| 50 url: url, | |
| 51 scripts: [], | |
| 52 done: (err, window) => { | |
| 53 const metaData = { | |
| 54 title: applyRules(window.document, titleRules), | |
| 55 canonicalUrl: applyRules(window.document, canonicalRules), | |
| 56 }; | |
| 57 | |
| 58 resolve(metaData); | |
| 59 } | |
| 60 }); | |
| 61 }); | |
| 62 | |
| 63 return response; | |
| 64 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment