Check for 10 new posts

When last post has id=5 and next valid post was published with ex. id=8, then script couldn't find it