<commit_before><commit_msg>v1.01a<commit_after>// ==UserScript==
// @name        hvShrine
// @author      Dodying
// @namespace   https://github.com/dodying/Dodying-UserJs
// @supportURL  https://github.com/dodying/Dodying-UserJs/issues
// @icon        http://cdn4.iconfinder.com/data/icons/mood-smiles/80/mood-29-48.png
// @include     http*://hentaiverse.org/?s=Bazaar&ss=ss
// @include     http*://alt.hentaiverse.org/?s=Bazaar&ss=ss
// @version     1.01a
// @grant       none
// @run-at      document-end
// ==/UserScript==
main();

function main() {
  var id = document.querySelector('.nosel.itemlist div').getAttribute('onclick').match(/(\d+)/)[1];
  if (id < 30000) {
    xhr(id, '0');
  } else if (id < 70000) {
    /*
  1 One-Handed
  2 Two-Handed
  3 Staffs
  4 Shields
  5 Cloth Armor
  6 Light Armor
  7 Heavy Armor
  */
    //xhr(id, '7');
  } else {
    return;
  }
}

function xhr(id, reward) {
  var xhr = new XMLHttpRequest();
  xhr.open('POST', window.location.href);
  xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
  xhr.responseType = 'document';
  var parm = 'select_item=' + id + '&select_reward=' + reward;
  xhr.send(parm);
  xhr.onload = function(e) {
    var data = e.target.response;
    var messageBoxNew = data.querySelector('#messagebox');
    messageBoxNew.innerHTML = messageBoxNew.innerHTML.replace(/Exquisite/g, '5精致的').replace(/Magnificent/g, '6华丽的').replace(/Legendary/g, '7传奇的').replace(/Peerless/g, '8无双的');
    if (document.querySelector('#messagebox')) {
      var messageBox = document.querySelector('#messagebox');
      messageBox.parentNode.replaceChild(messageBoxNew, messageBox);
    } else {
      document.body.appendChild(messageBoxNew);
    }
    var itemBoxNew = data.querySelector('#item_pane');
    var itemBox = document.querySelector('#item_pane');
    itemBox.parentNode.replaceChild(itemBoxNew, itemBox);
    if (document.querySelector('.nosel.itemlist div')) main();
  };
}

{'fraction_non_alphanumeric': 0.17408906882591094, 'fraction_numerical': 0.019230769230769232, 'mean_word_length': 3.4327354260089686, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3684123', 'n_tokens_mistral': 721, 'n_tokens_neox': 715, 'n_words': 116}