You are here

function twitter_block_cron in Twitter Block 7.2

Implements hook_cron().

File

./twitter_block.module, line 11
A module to provide simple Twitter blocks using the Twitter Search API.

Code

function twitter_block_cron() {

  // Regenerate the JavaScript file every day.
  if (REQUEST_TIME - variable_get('twitter_block_last_cache', 0) >= 86400 && variable_get('twitter_block_cache', 0)) {

    // Synchronize the widget code and update it if remote file have changed.
    twitter_block_cache(TRUE);

    // Record when the synchronization occurred.
    variable_set('twitter_block_last_cache', REQUEST_TIME);
  }
}