{"action":"created","issue":{"url":"https://api.github.com/repos/fideloper/Vaprobash/issues/509","labels_url":"https://api.github.com/repos/fideloper/Vaprobash/issues/509/labels{/name}","comments_url":"https://api.github.com/repos/fideloper/Vaprobash/issues/509/comments","events_url":"https://api.github.com/repos/fideloper/Vaprobash/issues/509/events","html_url":"https://github.com/fideloper/Vaprobash/pull/509","id":111212473,"number":509,"title":"fix: nodejs version detection","user":{"login":"lukewaite","id":618130,"avatar_url":"https://avatars.githubusercontent.com/u/618130?v=3","gravatar_id":"","url":"https://api.github.com/users/lukewaite","html_url":"https://github.com/lukewaite","followers_url":"https://api.github.com/users/lukewaite/followers","following_url":"https://api.github.com/users/lukewaite/following{/other_user}","gists_url":"https://api.github.com/users/lukewaite/gists{/gist_id}","starred_url":"https://api.github.com/users/lukewaite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukewaite/subscriptions","organizations_url":"https://api.github.com/users/lukewaite/orgs","repos_url":"https://api.github.com/users/lukewaite/repos","events_url":"https://api.github.com/users/lukewaite/events{/privacy}","received_events_url":"https://api.github.com/users/lukewaite/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-13T16:02:10Z","updated_at":"2015-10-17T11:38:38Z","closed_at":"2015-10-16T18:28:41Z","pull_request":{"url":"https://api.github.com/repos/fideloper/Vaprobash/pulls/509","html_url":"https://github.com/fideloper/Vaprobash/pull/509","diff_url":"https://github.com/fideloper/Vaprobash/pull/509.diff","patch_url":"https://github.com/fideloper/Vaprobash/pull/509.patch"},"body":"This commit adds a more forgiving version detection to the nodejs install script.\r\n\r\nI took a look at the internet archive for nodejs.org. It looks like the primary different between the current version of the nodejs.org site, and historical versions of the site are as follows:\r\n\r\n**Current:**\r\n```\r\n<p class=\"home-version home-version-banner\">\r\n    Current Version: v4.2.0<br>\r\n    <a href=\"https://nodejs.org/en/blog/release/v4.2.0/\">Long Term Support Release</a>\r\n</p>\r\n```\r\n\r\n**Sept 10:** http://web.archive.org/web/20150910152006/https://nodejs.org/en/\r\n```\r\n<p class=\"home-version\">Current Version: v4.0.0</p>\r\n```\r\n\r\nThis updated regex matches both cases, since we've seen the nodejs.org DOM change back within a few days in the past.\r\n\r\n**Current:**\r\n```\r\n vagrant@vaprobash  ~ \r\n curl -L 'nodejs.org' | grep -Po 'Current Version: v(\\d).(\\d).(\\d)' | awk '{print $3}'\r\nv4.2.0\r\n```\r\n\r\n**Current, with echo:**\r\n```\r\n vagrant@vaprobash  ~ \r\n  echo \"Current Version: v4.2.0<br>\" | grep -Po 'Current Version: v(\\d).(\\d).(\\d)' | awk '{print $3}'\r\nv4.2.0\r\n```\r\n\r\n**Legacy, tested via echo:**\r\n```\r\n vagrant@vaprobash  ~ \r\n  echo \"<p class=\"home-version\">Current Version: v4.0.0</p>\" | grep -Po 'Current Version: v(\\d).(\\d).(\\d)' | awk '{print $3}'\r\nv4.0.0\r\n```\r\n\r\nWith a little luck on our side, this will reduce the number of breakages introduced by DOM changes to the nodejs.org site.\r\n\r\nFixes https://github.com/fideloper/Vaprobash/issues/506"},"comment":{"url":"https://api.github.com/repos/fideloper/Vaprobash/issues/comments/148908845","html_url":"https://github.com/fideloper/Vaprobash/pull/509#issuecomment-148908845","issue_url":"https://api.github.com/repos/fideloper/Vaprobash/issues/509","id":148908845,"user":{"login":"lukewaite","id":618130,"avatar_url":"https://avatars.githubusercontent.com/u/618130?v=3","gravatar_id":"","url":"https://api.github.com/users/lukewaite","html_url":"https://github.com/lukewaite","followers_url":"https://api.github.com/users/lukewaite/followers","following_url":"https://api.github.com/users/lukewaite/following{/other_user}","gists_url":"https://api.github.com/users/lukewaite/gists{/gist_id}","starred_url":"https://api.github.com/users/lukewaite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukewaite/subscriptions","organizations_url":"https://api.github.com/users/lukewaite/orgs","repos_url":"https://api.github.com/users/lukewaite/repos","events_url":"https://api.github.com/users/lukewaite/events{/privacy}","received_events_url":"https://api.github.com/users/lukewaite/received_events","type":"User","site_admin":false},"created_at":"2015-10-17T11:38:38Z","updated_at":"2015-10-17T11:38:38Z","body":"Nice!"}}