npm i
npm startYou will now have a file data.csv containing the data.
- Edit index.mjs
- Make changes
- Click on Commit changes...
- Specify a new branch
You can change the used filters at the top of the file.
Check API documentation for an overview.
let filters = [
{
field: 'date.created',
value: {
from: '2024-01-01T00:00:00+00:00',
to: '2024-12-31T23:59:59+00:00'
}
}
];To change the fields to fetch from ReliefWeb API, have a look at getData(),
it support the fields defined in the documentation.
Make sure to also define the output of the field in writeCsv(), the code depends on the type of the field.
- Simple property (ex. Title):
fields.title - Nested property (ex. Primary country):
fields.primary_country.iso3 - Array of objects (ex. Country):
(row) => row.fields.country.map((x) => x.iso3).join(',')
data.csv is uploaded to https://drive.google.com/drive/folders/0B3AvU8yMBJnEWk9EQmR1OXVIdVU