Skip to content

Instantly share code, notes, and snippets.

@quanganhdo
Created September 1, 2009 07:02
Show Gist options
  • Select an option

  • Save quanganhdo/178952 to your computer and use it in GitHub Desktop.

Select an option

Save quanganhdo/178952 to your computer and use it in GitHub Desktop.
name = document.getElementsByTagName('title')[0].innerHTML.replace(/BuzzIcon - /, '').replace(/^\s*/g, '').replace(/\s*$/g, '');
id = name.replace(/[-\s]/g, '_').toLowerCase();
emo = $x('//li/div/img');
console.log('var ' + id + "_name = '" + name + "';");
console.log('var ' + id + "_base_url = '" + emo[0].src.match(/(http:\/\/emo.buzzbanbe.net\/sets\/.*?\/)/)[0] + "';");
for (var i = 0; i < emo.length; i++) {
emo[i] = emo[i].src;
}
console.log('var ' + id + "_files = ['" + emo.join("', '").replace(/http:\/\/emo.buzzbanbe.net\/sets\/.*?\//g, '') + "']" + ";");
console.log("packs.push('" + id + "');");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment