summaryrefslogtreecommitdiff
path: root/bin/client
blob: 8675f188aafd16b80a9ff9b234bdc9fec9a82b6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env perl 
use strict;
use warnings;
use FindBin::libs;
use DeWeave::Storage;
use DeWeave::Crypto;
use DeWeave::Collection;
use Getopt::Long;
 
my ($server,$username,$password,$sync_key);
 
{
my $p = Getopt::Long::Parser->new(
    config => [qw(
                     no_auto_abbrev
                     no_getopt_compat
                     no_gnu_compat
                     require_order
                     no_ignore_case
             )],
);
die unless $p->getoptions(
    'h|host=s' => \$server,
    'u|user=s' => \$username,
    'p|pass|password=s' => \$password,
    'k|key|sync-key=s' => \$sync_key,
);
}
 
my $storage = DeWeave::Storage->new({
    ($server ? (server_uri => $server) : () ),
    username => $username,
    password => $password,
});
 
my $crypto = DeWeave::Crypto->new({
    storage => $storage,
    sync_key => $sync_key,
});
 
use Data::Dump 'pp';
my $data = $storage->get_item('storage/tabs');
 
my $foo = DeWeave::Collection->from_json(
    $data,
    $crypto,
);
 
print pp $foo;