I need to get many (several thousand) posts from a certain wall, with the condition "placed before a certain date." I thought I would start a loop in which I would receive 100 posts through wall.get
, using offset
offset, inside I would make a date check and enter the result into an array.
But there was such a problem: during the time that my cycle is running (if it happens to be performed for a long time) several more records can be placed on the wall and then repeated records will appear in my array, and indeed everything will break. How can you deal with this?
Conducted research: I also thought of getting posts not through wall.get
, but through wall.getById
and getting posts from the end, one at a time, that is, starting from a certain date and going to the current moment. But this method looks much slower, and somehow you need to get a post-reference point (that is, the last post made before a certain date), and I do not know how you can get it.