<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>There used to be a switch/case section that would let the script get the hero stats (money, health, energy, &amp;c.); I commented out most of it and replaced it with the following:
&lt;pre&gt;
/* Other data */
  /* Cash */
  var cash_span = document.getElementById('app8743457343_cur_cash');
  var re = /\$([0-9]+)/;
  var result = cash_span.innerHTML.replace(&quot;,&quot;,&quot;&quot;,&quot;gi&quot;).match(re);
  this.cash = parseInt(result[1]);
  /* Health */
  var health_span = document.getElementById('app8743457343_cur_health');
  this.health = parseInt(health_span.innerHTML);
  var max_health_str = health_span.parentNode.innerHTML;
  max_health_str = stringCleaner(max_health_str);
  re = /\/([0-9]+)/;
  result = max_health_str.match(re);
  this.max_health = parseInt(result[1]);
  /* Energy */
  var energy_span = document.getElementById('app8743457343_cur_energy');
  this.energy = parseInt(energy_span.innerHTML);
  var max_energy_str = energy_span.parentNode.innerHTML;
  max_energy_str = stringCleaner(max_energy_str);
  result = max_energy_str.match(re);
  this.max_energy = parseInt(result[1]);
  /* Stamina */
  var stamina_span = document.getElementById('app8743457343_cur_recovery');
  this.stamina = parseInt(stamina_span.innerHTML);
  var max_stamina_str = stamina_span.parentNode.innerHTML;
  max_stamina_str = stringCleaner(max_stamina_str);
  result = max_stamina_str.match(re);
  this.max_stamina = parseInt(result[1]);
  /* Experience */
  var exp_div = document.getElementById('app8743457343_cur_experience');
  var exp_str = exp_div.innerHTML;
  exp_str = stringCleaner(exp_str);
  re = /Exp: ([0-9]+)\/?([0-9]+)?/;
  result = exp_str.match(re);
  this.exp = parseInt(result[1]);
  /* Level */
  re = /Level: ([0-9]+)/;
  result = exp_str.match(re);
  if (this.level != parseInt(result[1])) this.new_level = 1;
  this.level = parseInt(result[1]);
&lt;/pre&gt;
It's not at all optimized; it's a quick hack I threw together to make sure I could still do NYC jobs.
It references a stringCleaner function that cleans up the HTML for regex parsing:
&lt;pre&gt;
function stringCleaner(str) {
  str = str.replace(/&lt;[^&gt;]*&gt;/g, '');
  str = str.replace(/[, \t]/g,'');
  str = str.replace(/\r|\n|\r\n/g, '');
  str = str.replace(&quot;&amp;amp;nbsp;&quot;, &quot; &quot;, &quot;gi&quot;);
  return str;
}
&lt;/pre&gt;</body>
  <body-html>&lt;p&gt;There used to be a switch/case section that would let the script get the hero stats (money, health, energy, &amp;amp;c.); I commented out most of it and replaced it with the following:
&lt;br /&gt;&lt;pre&gt;
/* Other data */
  /* Cash */
  var cash_span = document.getElementById('app8743457343_cur_cash');
  var re = /\$([0-9]+)/;
  var result = cash_span.innerHTML.replace(&quot;,&quot;,&quot;&quot;,&quot;gi&quot;).match(re);
  this.cash = parseInt(result[1]);
  /* Health */
  var health_span = document.getElementById('app8743457343_cur_health');
  this.health = parseInt(health_span.innerHTML);
  var max_health_str = health_span.parentNode.innerHTML;
  max_health_str = stringCleaner(max_health_str);
  re = /\/([0-9]+)/;
  result = max_health_str.match(re);
  this.max_health = parseInt(result[1]);
  /* Energy */
  var energy_span = document.getElementById('app8743457343_cur_energy');
  this.energy = parseInt(energy_span.innerHTML);
  var max_energy_str = energy_span.parentNode.innerHTML;
  max_energy_str = stringCleaner(max_energy_str);
  result = max_energy_str.match(re);
  this.max_energy = parseInt(result[1]);
  /* Stamina */
  var stamina_span = document.getElementById('app8743457343_cur_recovery');
  this.stamina = parseInt(stamina_span.innerHTML);
  var max_stamina_str = stamina_span.parentNode.innerHTML;
  max_stamina_str = stringCleaner(max_stamina_str);
  result = max_stamina_str.match(re);
  this.max_stamina = parseInt(result[1]);
  /* Experience */
  var exp_div = document.getElementById('app8743457343_cur_experience');
  var exp_str = exp_div.innerHTML;
  exp_str = stringCleaner(exp_str);
  re = /Exp: ([0-9]+)\/?([0-9]+)?/;
  result = exp_str.match(re);
  this.exp = parseInt(result[1]);
  /* Level */
  re = /Level: ([0-9]+)/;
  result = exp_str.match(re);
  if (this.level != parseInt(result[1])) this.new_level = 1;
  this.level = parseInt(result[1]);
&lt;/pre&gt;
&lt;br /&gt;It's not at all optimized; it's a quick hack I threw together to make sure I could still do NYC jobs.
&lt;br /&gt;It references a stringCleaner function that cleans up the HTML for regex parsing:
&lt;br /&gt;&lt;pre&gt;
function stringCleaner(str) {
  str = str.replace(/&amp;lt;[^&gt;]*&gt;/g, '');
  str = str.replace(/[, \t]/g,'');
  str = str.replace(/\r|\n|\r\n/g, '');
  str = str.replace(&quot;&amp;amp;nbsp;&quot;, &quot; &quot;, &quot;gi&quot;);
  return str;
}
&lt;/pre&gt;&lt;/p&gt;</body-html>
  <created-at type="datetime">2009-08-22T17:14:40Z</created-at>
  <forumable-id type="integer">29870</forumable-id>
  <forumable-type>Script</forumable-type>
  <id type="integer">161508</id>
  <topic-id type="integer">18417</topic-id>
  <updated-at type="datetime">2009-08-22T17:17:07Z</updated-at>
  <user-agent>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.13) Gecko/2009073022 Firefox/3.0.13 (.NET CLR 3.5.30729)</user-agent>
  <user-id type="integer">81266</user-id>
</post>
