Created
July 20, 2020 01:37
-
-
Save lucascyrne/46ebf203a929703eb18642b9dcc8d7a7 to your computer and use it in GitHub Desktop.
This file contains 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 fetch = require("node-fetch"); | |
const fs = require("fs"); | |
const url = | |
"https://api-content.ingresso.com/v0/events/partnership/shopping_jequitiba"; | |
let settings = { method: "Get" }; | |
fetch(url, settings) | |
.then((res) => res.json()) | |
.then((json) => { | |
for (var i = 0; i < json.count; ++i) { | |
var id = `ID: ${json.items[i].id}\n`; | |
var title = `TITLE: ${json.items[i].title}\n`; | |
var newData = id + title; | |
fs.appendFile("shopping_jequitiba.txt", newData, (err) => { | |
if (err) throw err; | |
}); | |
} | |
}) | |
.catch((err) => { | |
console.log(err); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment