20 |
feeds.title as feed_title, |
feeds.title as feed_title, |
21 |
feeds.link as feed_link, |
feeds.link as feed_link, |
22 |
feeds.description as feed_description |
feeds.description as feed_description |
23 |
|
-- t.value_long as tags |
24 |
from items |
from items |
25 |
join items_userdata on items.id = item_id |
join items_userdata on items.id = item_id |
26 |
join feeds on items.feed_id = feeds.id |
join feeds on items.feed_id = feeds.id |
27 |
where items.id > ? |
-- left outer join items_userdata as t on items.id = t.item_id and t.label='tags' |
28 |
|
where items.id > ? and items_userdata.label = 'published' and items_userdata.value_numeric = 1 |
29 |
order by items.id asc |
order by items.id asc |
30 |
limit 5000 |
limit 1000 |
31 |
}; |
}; |
32 |
|
|
|
|
|
33 |
my $c = CouchDB::Client->new(uri => 'http://localhost:5984/'); |
my $c = CouchDB::Client->new(uri => 'http://localhost:5984/'); |
34 |
|
|
35 |
$c->testConnection or die "The server cannot be reached"; |
$c->testConnection or die "The server cannot be reached"; |
60 |
|
|
61 |
warn dump( $sth->{NAME} ); |
warn dump( $sth->{NAME} ); |
62 |
|
|
63 |
print "found ",$sth->rows," items to process..."; |
print "found ",$sth->rows," items to process...\n"; |
64 |
|
|
65 |
my $pk = 'id'; |
my $pk = 'id'; |
66 |
|
|
87 |
$doc->retrieve; |
$doc->retrieve; |
88 |
row2doc( $row, $doc )->update; |
row2doc( $row, $doc )->update; |
89 |
# eval { $doc->update }; |
# eval { $doc->update }; |
90 |
warn $@ ? "ERROR $_id $@\n" : "updated $_id\n"; |
warn $@ ? "$count ERROR $_id $@\n" : "$count updated $_id\n"; |
91 |
} else { |
} else { |
92 |
warn "created $_id\n"; |
warn "$count created $_id\n"; |
93 |
} |
} |
94 |
|
|
95 |
$last_row = $row->{id}; |
$last_row = $row->{id}; |