- Export data
- Unzip
cd facebook-<username>
find . -type f -name '*.json' | xargs -n1 jq -c '. as $input | {} | setpath(input_filename / "/"; $input)'
=> This'll get you to a one-file-per-line stream of JSON objects formatted with the filepath (relative to the export root) as the nested JSON object path. So e.g. a file at ./ads/ad_interests.json
containing JSON content:
{
"topics": [
"Facebook Messenger",
"Instant messaging",
"Reddit",
"Social network"
]
}
Would end up like:
{".":{"ads":{"ads_interests.json":{"topics":["Facebook Messenger","Instant messaging","Reddit","Social network"]}}}}
Next step is to merge into a single JSON blob, and then use a JSON Schema generator tool to explore the structure and turn into a Singer tap.