I'm trying to create a post in an Expression Engine powered website via an automated script, but as I've never used EE myself before, this is proving to be a more complicated task than initially expected!
I was originally just going to dump into the datbase directly, but it looks like there are multiple tables storing post data so rather than try to figure out what to dump where and hope EE never changes the structure, I'm thinking a better approach would be to use it's API, which I also didn't know existed.
https://docs.expressionengine.com/latest/development/legacy/api/api_channel_entries.html#Api_channel_entries::save_entry makes this look simple enough, but obviously ee() doesn't exist yet to my standalone script...
How would I go about initiating an ee() class from a script outside of Expression Engine itself, so that I can create posts directly?
This is EE 2.8 if that makes a difference.
Much appreciated.
Regards.
Here's an existing similar Stack Exchange answer, basically look at the index.php to see how they have natively instansiate the entire EE application. But it's recommended you don't for security reasons!
Instead you could consider: