today | current | recent | random ... categories | search ... who ... syndication

Movable Thoughts #14

Probably the single most requested feature from the Blogger API is the ability to slurp all the posts in one swell foop. If I am reading the MT Blogger code correctly, MT will do this when you call the getRecentPosts method without a num argument. If no limit is specified then &MT::ObjectDriver::DBM::load_iter will return all the ids for a blog. &load_iter calls &_get_ids which returns ids based on the following test...
  # This test will fail because although there are args, the
  # args->{'limit'} test will return false since only the 
  # value of the key[1] is being tested and not the key's
  # definedness itself
  # 
  # [1] http://tlc.perlarchive.com/articles/perl/ug0002.shtml 

  if ($args && $args->{limit}) {    ## Lookup with limit
    @ids = $driver->_get_ids_limit($DB, $db, $class, $terms, $args);
  }

  # We have terms, so...

  elsif ($terms) { ## Lookup using index or ID
    if (ref($terms) eq 'HASH') {
      @ids = %$terms ?

      # We have keys so we'll munge the index and since none
      # of the "terms" are array references we 1) don't have
      # to worry about range arguments and 2) munge the @ids
      # listed in the index for $blogid.

      $driver->_get_ids_from_index($class, $terms, $args) :
      keys %$db;
    } else {
      @ids = $terms;
    }
  }

refers to

meta

 
Kip Hampton : XML and modern CGI applications ←  → Cory Doctorow : Yours is a Very Bad Hotel