working script to generate new post files