I am working exactly on that, writing PHP cron daemon to import third party data and upload to Stackmob. They have a PHP library and I wrote a simplified shorter version.
The whole database communication breaks down to simple CRUD interface. Good luck.
EDIT. The code I am working on has the following structure.
3 Storage objects:
inStore, locStore, outStore
. Incoming data, local Cache and outgoing. See my locStore code here.3 Proxy objects:
inProxy, locProxy, outProxy
to talk to their corresponding stores. They provide my app specific methods as they have access to my config, where the Stores don't.Config object to deal with config-related methods, used by the proxies.
Top level Data Mover objects that only talk to the Proxies.