Running a function before a View executes I have a carousel built using Views (7.x-3.x) that displays 10 items. In this carousel I would like to place 1 item (inclusive of the 10) that displays Twitter content. 

What I would like to do is run the function that uses the Twitter API before the View is built/executed. If it succeeds then the View should display 9 items from it's own query (10 items total.) If it fails, then the View would display 10 items from it's own query.

I have successfully implemented the View and the Twitter function running on the theme layer though in order to have a 'fall back' by altering the number of items displayed I would need to do this before the View is built/executed.

Can anyone point me in the right direction for this?

I believe I am looking at the right function "hook_views_query_alter" but I'm not sure how to set "items_per_page"

Thanks
You might be interested in a similiar kind of question I answered here:

How do you customize the title of an RSS feed created by Views RSS?

I would just set the view size to 10 always. And then use array_unshift() as I did in that reply to "prepend" the new item Object to the front of the view results array, if your Twitter call return its 1 item of content. Or else you just let the original 10 come from Views.