API data from htttp adds constantly renewed element to ghost

Good day, take it easy, I’ve created a script. I’m pulling data from an api from http. 15 items are coming. And I’m creating a create post by ghost on the ghost site and I’m attaching this to 15 minutes. Every 15 minutes, 15 items are posted. But I just post the new item when the new item comes from the api. no matter what i did i couldn’t do it please help.

Hi @ahmet,

Correct me if I am wrong with my understanding of this. The issue you are facing is every 15 minutes the same 15 items are posted on Ghost, right?

I don’t know what your APIs look like but there are a few ways you can do this,

  1. Ensure that the HTTP module is only getting new data i.e the Script that you have will need to ensure that it tracks what has been already posted and what needs to be ignored in the next run. This probably can be done through the API that you are using to list new items on the next run
  2. If your API doesn’t support it, then what you can do is utilize DataStore in make to store the API ID for Item and Ghost ID, and in the next run before pushing to Ghost check whether the Item has already been posted.
1 Like