made getPosts interval a parameter