You are here

function tweet_feed_feeds_form_validate in Tweet Feed 7.3

Validation callback for the Tweet Feeds feed form

So far all we really need to do is make sure the number of pull requests x 100 to not exceed the amount Twitter will give us for the type of query being done. This is 18,000 for searches and 1,500 for Timeline and List queries.

File

./tweet_feed_admin.inc, line 448

Code

function tweet_feed_feeds_form_validate($form, &$form_state) {
  $pull_count = $form_state['values']['pull_count'];
  $query_type = $form_state['values']['query_type'];
  if ($query_type == QUERY_SEARCH) {
    if ($pull_count > 180) {
      form_set_error('pull_count', t('The pull count for search queries cannot exceed 180 per update interval.'));
    }
  }
  else {
    if ($pull_count > 15) {
      form_set_error('pull_count', t('The pull count for timeline/list queries cannot exceed 15 per update interval.'));
    }
  }
}