--- scripts/reblog2couchdb.pl 2008/08/05 16:36:57 7 +++ scripts/reblog2couchdb.pl 2008/08/08 19:19:12 10 @@ -20,15 +20,16 @@ feeds.title as feed_title, feeds.link as feed_link, feeds.description as feed_description +-- t.value_long as tags from items join items_userdata on items.id = item_id join feeds on items.feed_id = feeds.id - where items.id > ? +-- left outer join items_userdata as t on items.id = t.item_id and t.label='tags' + where items.id > ? and items_userdata.label = 'published' and items_userdata.value_numeric = 1 order by items.id asc - limit 5000 + limit 1000 }; - my $c = CouchDB::Client->new(uri => 'http://localhost:5984/'); $c->testConnection or die "The server cannot be reached"; @@ -59,7 +60,7 @@ warn dump( $sth->{NAME} ); -print "found ",$sth->rows," items to process..."; +print "found ",$sth->rows," items to process...\n"; my $pk = 'id'; @@ -86,9 +87,9 @@ $doc->retrieve; row2doc( $row, $doc )->update; # eval { $doc->update }; - warn $@ ? "ERROR $_id $@\n" : "updated $_id\n"; + warn $@ ? "$count ERROR $_id $@\n" : "$count updated $_id\n"; } else { - warn "created $_id\n"; + warn "$count created $_id\n"; } $last_row = $row->{id};