Created
January 22, 2020 14:01
-
-
Save muka/954dbb0cd2a40bf71186efc92518eebe to your computer and use it in GitHub Desktop.
extract a list of people from a b2match API call
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const baseUrl = "https://aal-programme-info-day-2020.b2match.io/participants" | |
const data = require("./data.json") | |
const participantRow = (participant) => { | |
let { | |
id, | |
user, | |
organisation_name, | |
organisation_type, | |
country, | |
business_fields, | |
website, | |
job_description, | |
} = participant | |
organisation_type = organisation_type || {name: ''} | |
// country org person role | |
// link F2F email biz card open calls lead pilot type expertise follow up date | |
const row = [ | |
country.iso, | |
organisation_name, | |
`${user.first_name} ${user.last_name}`, | |
job_description, | |
`${baseUrl}/${user.id}`, | |
"", // biz | |
"", // open calls | |
"", // lead | |
organisation_type.name, | |
business_fields.map(b => b.name).join(", "), // expertise | |
"", | |
"", | |
] | |
return row.join(";") | |
} | |
const {participants} = data | |
// console.log(participants[3]); | |
console.log(participants.map(participantRow).join("\n")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment