Reputation: 1977
I'm trying to consume a 3rd party api and store it in a database. Then, I'd like to expose my own api to some private apps (web, mobile, etc).
The reason behind consuming and storing the contents of a 3rd party API is because the api has strict limits on number of calls per day and per second.
Where in my project would I go about putting the code for consuming and scheduling the consumption of the api? I'm using httparty to grab the api contents, and I plan on mapping that data to active record.
Upvotes: 0
Views: 1047
Reputation: 4819
I'd recommend using whenever to schedule tasks like cron and save stuff to the database.
Then, I suppose have models for each 3rd Party object (user, tweet, whatever), and controllers that correspond to those models and pull info from the database, and provide JSON that can be parsed by your 4th Party apps.
Upvotes: 2