Luckily, Facebook does indeed have an API that allows you to automate posts, just like you're envisioning. You can use tools like cURL or libraries in your preferred programming language to interact with their API and send posts.
It might take a bit of tinkering and some trial and error to get...