I would like to have a copy of one of the Analytics custom reports as CSV on a webserver every day. I wish to update some records in my database depending on this csv report.
Before I would start, will it work if I
- find the analytics core java api code of fetching reports, compile and save it
- set a cronjob daily which runs a php file
- the php file executes a bash command that calls java
- the java application interacts with analytics, gets and saves the report
- the php file checks if the new csv exists, reads the file, gets information
- the php file connects to mysql and updates records
Please correct me if it's bullsh.t or there are easier ways (Analytics PHP/JS API if exists, or something else). These six points just popped in my head, I've never done something like this before, so please help me.