forked from DebaucheryLibrarian/traxxx
Fixed Team Skeet profiles.
This commit is contained in:
parent
e8d081cc67
commit
86e4fb7603
|
@ -52,6 +52,7 @@ const hairColors = {
|
||||||
raven: 'black',
|
raven: 'black',
|
||||||
red: 'red',
|
red: 'red',
|
||||||
redhead: 'red',
|
redhead: 'red',
|
||||||
|
'red head': 'red',
|
||||||
rood: 'red',
|
rood: 'red',
|
||||||
blue: 'blue',
|
blue: 'blue',
|
||||||
green: 'green',
|
green: 'green',
|
||||||
|
|
|
@ -62,6 +62,8 @@ function scrapeAll(scenes, channel) {
|
||||||
function scrapeProfile(actor, entity) {
|
function scrapeProfile(actor, entity) {
|
||||||
const profile = {};
|
const profile = {};
|
||||||
|
|
||||||
|
console.log(actor);
|
||||||
|
|
||||||
if (actor.bio.about && !/\band\b/.test(actor.bio.about)) {
|
if (actor.bio.about && !/\band\b/.test(actor.bio.about)) {
|
||||||
const bio = actor.bio.about.split(/\n/).filter(Boolean).reduce((acc, item) => {
|
const bio = actor.bio.about.split(/\n/).filter(Boolean).reduce((acc, item) => {
|
||||||
const [key, value] = item.match(/(.+): (.+)/).slice(1);
|
const [key, value] = item.match(/(.+): (.+)/).slice(1);
|
||||||
|
@ -149,7 +151,7 @@ async function fetchProfile(baseActor, { entity, parameters }) {
|
||||||
const res = await qu.get(url);
|
const res = await qu.get(url);
|
||||||
|
|
||||||
if (res.ok && res.body) {
|
if (res.ok && res.body) {
|
||||||
return scrapeProfile(res.body._source, entity);
|
return scrapeProfile(res.body._source || res.body, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res.status;
|
return res.status;
|
||||||
|
|
Loading…
Reference in New Issue