mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-11-23 14:46:07 +09:00
dbg
This commit is contained in:
parent
d7aff92870
commit
55f0acf32f
@ -269,23 +269,37 @@ export async function createPerson(
|
||||
|
||||
const isBot = getApType(object) === "Service";
|
||||
|
||||
console.log('createPerson 6.1');
|
||||
|
||||
const bday = person["vcard:bday"]?.match(/^\d{4}-\d{2}-\d{2}/);
|
||||
|
||||
console.log('createPerson 6.2');
|
||||
|
||||
const url = getOneApHrefNullable(person.url);
|
||||
|
||||
console.log('createPerson 6.3');
|
||||
|
||||
if (url && !url.startsWith("https://")) {
|
||||
throw new Error(`unexpected schema of person url: ${url}`);
|
||||
}
|
||||
|
||||
console.log('createPerson 6.4');
|
||||
|
||||
let followersCount: number | undefined;
|
||||
|
||||
console.log('createPerson 6.5');
|
||||
|
||||
if (typeof person.followers === "string") {
|
||||
try {
|
||||
console.log('createPerson 6.6');
|
||||
let data = await fetch(person.followers, {
|
||||
headers: { Accept: "application/json" },
|
||||
});
|
||||
console.log('createPerson 6.7');
|
||||
let json_data = JSON.parse(await data.text());
|
||||
|
||||
console.log('createPerson 6.8');
|
||||
|
||||
followersCount = json_data.totalItems;
|
||||
} catch {
|
||||
followersCount = undefined;
|
||||
|
Loading…
Reference in New Issue
Block a user