Created
August 24, 2013 12:41
-
-
Save xtetsuji/6327904 to your computer and use it in GitHub Desktop.
WWW::Wunderlist sample.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use lib 'lib', '../lib'; | |
| BEGIN { $ENV{DEBUG} = 1; } | |
| use Config::PL 'config_do'; | |
| use Data::Dumper; | |
| use Encode; | |
| use WWW::Wunderlist; | |
| my $task_name = decode('utf-8', shift); | |
| if ( !$task_name ) { | |
| die "$0 task_name"; | |
| } | |
| my $config = config_do "$ENV{HOME}/.wunderlist"; | |
| my $wl = WWW::Wunderlist->new( | |
| email => $config->{email}, | |
| password => $config->{password}, | |
| ); | |
| $wl->login(); | |
| my $tasks = $wl->get_tasks() | |
| or die "get_tasks failed."; | |
| $wl->set_tasks( title => $task_name . ' at ' . $now ) | |
| or die "set_tasks failed."; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment