Skip to content

Instantly share code, notes, and snippets.

@lucascyrne
Created July 20, 2020 01:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucascyrne/46ebf203a929703eb18642b9dcc8d7a7 to your computer and use it in GitHub Desktop.
Save lucascyrne/46ebf203a929703eb18642b9dcc8d7a7 to your computer and use it in GitHub Desktop.
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