Subject: | data generated with 'delbackup -y' can not be loaded with load_yaml.pl |
Date: | Sun, 18 Nov 2007 11:12:40 -0500 |
To: | bug-Rubric [...] rt.cpan.org |
From: | John SJ Anderson <genehack [...] genehack.org> |
The data schema that 'delbackup -y' generates is not quite what
load_yaml.pl is expecting to see. Here is a patch (versus current
Rubric git) that was sufficient for me to be able to load a delbackup
YAML dump of my del.icio.us bookmarks and get all the data properly
into Rubric:
diff --git a/bin/load_yml.pl b/bin/load_yml.pl
index 3bf1d3b..5ccced5 100755
--- a/bin/load_yml.pl
+++ b/bin/load_yml.pl
@@ -11,17 +11,17 @@ my $yaml;
my $links = YAML::Load($yaml);
foreach (@$links) {
- my $link = Rubric::Link->find_or_create({uri => $_->{link}});
+ my $link = Rubric::Link->find_or_create({uri => $_->{href}});
$link ||= '';
my $entry = $user->add_to_entries({
link => $link,
- title => $_->{title},
- description => $_->{description},
+ title => $_->{description},
+ description => $_->{extended},
body => $_->{body},
- created => $_->{created},
+ created => $_->{datetime},
modified => $_->{modified},
});
- $entry->add_to_tags({tag => $_}) for keys %{$_->{tags}};
+ $entry->add_to_tags({tag => $_}) for @{$_->{tags}};
}
$user->update;
john.
--
I'm just very selective about the reality I choose to accept.
--- Calvin