2021-05-16 03:46:55 +00:00
|
|
|
# How to generate names.json
|
|
|
|
|
|
|
|
Open https://xenoblade.github.io/xb2/bdat/common/BLD_NameList.html and paste
|
|
|
|
this into the browser inspector:
|
|
|
|
|
|
|
|
```js
|
|
|
|
let names = [];
|
|
|
|
Array.from(document.getElementsByClassName("sortable")[0].children[1].children)
|
|
|
|
.forEach(row => names.push(row.children[2]
|
|
|
|
.innerHTML
|
|
|
|
.toLowerCase()
|
|
|
|
.replaceAll(" ", "-")));
|
|
|
|
console.log(JSON.stringify(names));
|
|
|
|
```
|
|
|
|
|
|
|
|
Then format it with jq.
|
2021-05-16 22:06:54 +00:00
|
|
|
|
|
|
|
For ponies use this fragment:
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
names = [];
|
|
|
|
Array.from(document.getElementsByClassName("listofponies")[0]
|
|
|
|
.children[1]
|
|
|
|
.children
|
|
|
|
).forEach(row => {
|
|
|
|
let name = row.children[0]
|
|
|
|
.textContent
|
|
|
|
.toLowerCase()
|
|
|
|
.replaceAll(" ", "-")
|
|
|
|
.replaceAll(".", "")
|
|
|
|
.replaceAll("รถ", "o");
|
|
|
|
if (name.includes("unnamed")) { return; }
|
|
|
|
if (name.includes("[")) { return; }
|
|
|
|
if (name.includes("/")) { return; }
|
|
|
|
if (name.includes("alt")) { return; }
|
|
|
|
if (name.includes("pony")) { return; }
|
|
|
|
if (name.includes("mare")) { return; }
|
|
|
|
if (name.includes("student")) { return; }
|
|
|
|
if (name.includes("'")) { return; }
|
|
|
|
if (name.includes('"')) { return; }
|
|
|
|
if (name.length > 10) { return; }
|
|
|
|
console.log([name, name.length]);
|
|
|
|
names.push(name);
|
|
|
|
});
|
|
|
|
console.log(JSON.stringify(names));
|
|
|
|
```
|
2021-05-17 12:08:53 +00:00
|
|
|
|
|
|
|
Combine all of the files like this:
|
|
|
|
|
|
|
|
```console
|
|
|
|
$ jq -n '[inputs] | add' \
|
|
|
|
names-blades.json \
|
|
|
|
names-ponies-earth.json \
|
|
|
|
names-ponies-pegasus.json \
|
|
|
|
names-ponies-unicorn.json\
|
|
|
|
| jq -r '.[]' \
|
|
|
|
| sort \
|
|
|
|
| uniq \
|
|
|
|
| jq -nR '[inputs | select(length>0)]' > names.json
|
|
|
|
```
|