Permalink
Browse files

[index.js] update home view url, update regex to not match )).constant

  • Loading branch information...
dconnolly committed Jan 19, 2015
1 parent 133feaf commit 7382af4e00229f3386e9795e805b8c9244cdaf6c
Showing with 4 additions and 3 deletions.
  1. +4 −3 index.js
@@ -3,11 +3,12 @@
var Q = require('q');
var request = Q.denodeify(require('request'));

var chromecastHomeURL = 'https://clients3.google.com/cast/chromecast/home/v/c9541b08';
var initJSONStateRegex = /(JSON\.parse\(.+'\))/;
var chromecastHomeURL = 'https://clients3.google.com/cast/chromecast/home';
var initJSONStateRegex = /(JSON\.parse\('.+'\))\)\./;

var parseChromecastHome = function(htmlString) {
var JSONParse = htmlString.match(initJSONStateRegex)[1];
var matches = htmlString.match(initJSONStateRegex);
var JSONParse = matches[1];
var initState = eval(JSONParse); // I don't know why this is ok but JSON.parse fails.
var parsedBackgrounds = [];
for (var i in initState[0]) {

0 comments on commit 7382af4

Please sign in to comment.