Instagram Verilerinizi Hesabi Silme Arayuzunden Indirin
💡 Hesabinizi silmeyeceksiniz sadece verilerimi indir kismina kadar ilerleyeceksiniz
Arindan indirilen zip
icerisinden saved_collections.json
dosyasini alin
saved_collections.json
dosyasini csv
'e donusturmek
const { readFileSync, writeFileSync } = require("fs")
function jsonToCSV(json) {
const csvRows = []
csvRows.push("Name,Time,URL,Channel,Tags")
for (const [key, value] of Object.entries(json)) {
const tags = value.tags.join(",")
const utcTime = value.time.toISOString()
csvRows.push(`${value.name},${utcTime},${key},${value.channel},"${tags}"`)
}
return csvRows.join("\n")
}
function instagramCollectionToCSV(inputPath) {
const content = JSON.parse(readFileSync(inputPath))
const data = {}
let tag = undefined
content.saved_saved_collections.forEach(collection => {
const url = collection.string_map_data.Name.href
if (url === undefined) {
const rawTag = collection.string_map_data.Name.value
tag = Buffer.from(rawTag, "binary").toString("utf8")
return
}
const name = url.split("/").slice(-2)[0]
const time = new Date(collection.string_map_data["Added Time"].timestamp * 1000)
const channel = collection.string_map_data.Name.value
if (!data[url]) {
data[url] = { channel, tags: [], time, name }
}
if (tag && !data[url].tags.includes(tag)) {
data[url].tags.push(tag)
}
})
const csv = jsonToCSV(data)
const outputPath = path.replace(".json", ".csv")
writeFileSync(outputPath, csv)
}
const path = "./saved_collections.json"
instagramCollectionToCSV(path)
csv
dosyasini Notion uzerine aktarmak