One of the most frequent questions I get regarding the Tweet Import plugin, is whether the update, or import, frequency can be changed or, in other terms, if the plugin can be made to import tweets faster than the default 15 minutes minimum allowed interval.
My reply is usually that technically speaking it is possible but there are some considerations to take care of first.
First of all, it is important to understand that Tweet Import uses the built in WordPress scheduling engine which runs scheduled tasks at the end of page loads. What does that mean? It means that if nobody is browsing your website, the scheduled events will not run and therefore tweets will not be imported. Having said that, you need to make sure that you have enough traffic to your website for the scheduled events to run at the set intervals.
In principle, adding more intervals is easy and it requires updating both the frequency options and the caching duration of the WordPress internal RSS processor, SimplePie.
Adding frequency options to the plugin is easy. As a matter of fact, Tweet Import already adds two options “Once Every 15 Minutes” and “Four Times a Day” to the default WordPress built in schedule intervals like that:
if (!has_filter ('cron_schedules', 'skinju_tweetimport_add_schedule_intervals')) {add_filter('cron_schedules', 'skinju_tweetimport_add_schedule_intervals');}
if (!function_exists('skinju_tweetimport_add_schedule_intervals')):
function skinju_tweetimport_add_schedule_intervals()
{
return array( 'everyquarter' => array('interval' => 900, 'display' => 'Once Every 15 Minutes'),
'4timesaday' => array('interval' => 21600, 'display' => 'Four Times a Day'));
}
endif; //skinju_tweetimport_add_schedule_intervals
If you would like to add more frequencies, like let’s say “Every 5 Minutes”, you can either edit the plugin itself, or better yet, to still be able to update the plugin automatically and not lose the changes you made, add the following to your theme “functions.php” file:
// *** Requires Tweet Import Version 1.3 or newer ***
if (!has_filter ('cron_schedules', 'more_schedule_intervals')) {add_filter('cron_schedules', 'more_schedule_intervals', 100);}
if (!function_exists('more_schedule_intervals')):
function more_schedule_intervals()
{
return array( 'every5minutes' => array('interval' => 300, 'display' => 'Once Every 5 Minutes'),
'everyquarter' => array('interval' => 900, 'display' => 'Once Every 15 Minutes'),
'4timesaday' => array('interval' => 21600, 'display' => 'Four Times a Day'));
}
endif; //more_schedule_intervals
In brief, every interval requires the following to be defined. An internal name, “every5minutes”, an interval, the frequency in seconds, and a display name, “Once Every 5 Minutes” in this case.
As for the caching duration, as of version 1.3, Tweet Import allows changing the caching duration using an external function without changing the plugin code itself. Why is it being cached to start with? Right?
Well, when I first designed the plugin, I thought that since the plugin is supposed to import tweets once every 15 minutes minimum, and in order to prevent unnecessary calls to Twitter API in case something went wrong, the plugin can use a cached version of the Twitter response. By default, the plugin will cache the response just little bit less than 15 minutes (880 seconds to be exact). After all, the plugin should never process the cached version of the response anyway. Today, I still hope this design choice is right :)
In order to change the caching duration, and suppose you would like to change it to 295 seconds, you should add the following to your “functions.php” file.
// *** Requires Tweet Import Version 1.3 or newer ***
if (!has_filter ('tweetimport_cache_duration', 'other_cache_duration')) {add_filter('tweetimport_cache_duration', 'other_cache_duration', 100);}
if (!function_exists('other_cache_duration')):
function other_cache_duration($current_duration)
{
return (295);
}
endif; //other_cache_duration
This second addition will change the caching duration to 295 seconds, which is a little bit less than the 5 minutes update interval of 300 seconds.

Comments
Love this! I know it’s not a lot, but I would like to donate 10 bucks through Paypal. Do you have a paypaladdress where I can sent it?
@Dinho
Thank you for your offer… I love coffee, especially when it is free
Did not try that before but I did setup a quick solution http://skinju.com/donate
Hmm..just tried to donate, got this message:
“Currently PayPal accounts in Saudi Arabia are only able to send payments. This recipient is not eligible to receive funds.”
You don’t happen to have an European or American account laying around somewhere?
@Dinho
I wanted to pay it forward… You would like to donate, please help fight hunger worldwide https://www.wfp.org/donate/fillthecup… They have a paypal option as well… I will sip coffee knowing that the world is getting better
Just donated to the program. It’s not much but all bits help!
Thank you for filling the cup!
Your donation of $10.00 on May 24, 2010 provides critical ongoing support in the fight against global hunger. More children will receive nutritious meals at school and more disaster victims will get the lifesaving food they need.
You can be assured that your gift will immediately be put to good use. For every dollar you give, we can provide four healthy meals.
I thank you from the bottom of my heart — and on behalf of the people whose lives you are changing.
Together, we are building a world without hunger.
Sincerely,
Marcela
Manager, Online Community
World Food Programme
If you have questions about your donation at any time, please feel free to contact us at community at wfp.
@Dinho
Thank you…
Hii! I started using your feed on this page, and it’s awesome! Only problem is that it doesn’t seem to be updating daily, or at least, I don’t think it is. I tweeted at least 3 things yesterday, and it doesn’t seem to be pulling them over.
Any suggestions?
@Christina
I believe it is due to traffic. If nobody’s browsing your new site, no feeds will be imported. The plugin is triggered after a page finishes loading. I recommend if you can get a cron service (this is a unix/linux server scheduling service, there are free ones out there). All what is required it to cron for a single page to be fetched and the plugin will do the rest
I have been to your new site… like!
Hello, very nice plugin!!
How could I control the scheduling times? For example, I want tweet import to schedule my posts between certain hours (from 10am to 9pm)