require('dotenv').config()
const URL_API = "https://api.twitter.com/2"
const params = new URLSearchParams({
'user.fields': 'created_at',
})
const compteId = "1390171858213998593"
async function Call() {
const urlParams = params.toString()
const body = await fetch(`${URL_API}/users/${compteId}/following?max_results=20&user.fields=description`,
{
headers: {
Authorization: `Bearer ${process.env.TOKEN}`,
}
}).then(res => res.json())
for (let i = 0; i < body.data.length; i ++) {
console.log(` ${body.data[i].username}, ${body.data[i].description}`)
}
}
setInterval(Call, 3000)
hi. so I’m trying to make a program that would allow me to track down someone’s subscriptions. so the in this program I make a call to the twitter api that sends me a json file and so I enter the json format for console.log just the id and description and I what I would like it to be make a call at a certain regular time interval but that the console.log only shows me the new follows. unfortunately I don’t know how to do/ what is the method so if someone knows and would like to share I am taker.