Skip to content

Instantly share code, notes, and snippets.

@avuserow
Created February 18, 2015 06:04
Show Gist options
  • Save avuserow/df45d8eddc18e682cb60 to your computer and use it in GitHub Desktop.
Save avuserow/df45d8eddc18e682cb60 to your computer and use it in GitHub Desktop.
hiveminder export script
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use Net::Hiveminder;
$Data::Dumper::Sortkeys = 1;
my $hm = Net::Hiveminder->new(email => $email, password => $password);
my %processed;
my @tasks = (
# Collect tasks here. groups and owners are the best options.
$hm->get_tasks(group => 1234),
$hm->get_tasks(owner => 'me'),
$hm->get_tasks(owner => $email),
);
my %ids = map {$_->{record_locator} => 1} @tasks;
print "Tasks: ", scalar keys %ids, "\n";
for my $task (@tasks) {
my $id = $task->{record_locator};
next if $processed{$id};
$processed{$id} = 1;
my $data = {
task => $task,
comments => [$hm->comments_on($task)],
history => $hm->get_task_history($task),
};
open my $fh, '>', "hm-tasks/task-$id.txt";
print $fh Dumper($data);
close $fh;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment