[eluser]revered[/eluser]
I am new to codeigniter, never coded anything with it. Now I want to start my first codeigniter app (mainly for code standardization and avoiding bugs and security issues).
This app will have (in the backend) a cron that will scrape data from a lot of websites, these websites provides an API which I can use by making a request with cURL.
I currently have three PHP files, one has a class that do the database SELECTS/INSERTS/UPDATES and also manages cron status, another file has a class that build the requests to scrape the data from the APIs, and another one that include those two classes and run the requests (this is what runs as a cronjob).
Now I have been doing some reading and I see that is a "best practice" to keep controllers small and simple. So to code this on codeigniter it looks like the best option would be to create a library for the APIs, then a model for the database functions and a controller to run the requests (which would run as a cronjob). In the future I'd have to deal with a few different APIs so I would need different libraries for each API.
Is this correct, I mean is a library what I need? Or should I put everything into the controller that will run as a cronjob?