On a Rails site, I'd like to display a certain Twitter feed, with pagination so the visitor can see previous tweets (as far back as needed).
I implemented it using the Twitter gem, using Search method, which has a nice pagination method, but hit a limitation that Twitter will only return the statutes from the last two weeks. So after going back a couple of pages, it won't fetch anymore.
I could use the user_timeline method, with max_id and then do my own pagination (passing the max_id of the last item viewed back to the controller to fetch the next batch).
Or, I could have a rake task that polls the Twitter feed frequently (with cron), and stores the tweets in the DB. The site would serve those up from the DB instead of querying Twitter at all.
Which would be the best or recommended method? I don't like having to store the Tweets in the DB, but that would also take care of the latency problem of querying Twitter (though I could use fragment caching to overcome that except that I haven't been able to get it working with Ajax).
Thanks for the advice.