Last active
August 29, 2015 14:03
-
-
Save vonglasow/c4d9ac08568f50a44740 to your computer and use it in GitHub Desktop.
Get redmine issues title for pomojs
This file contains 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/perl | |
use strict; | |
use warnings; | |
use Carp; | |
use WWW::Mechanize; | |
use Mojo::DOM; | |
use String::ShellQuote; | |
my $site = 'https://redmine-url/issues/' . $ARGV[0]; | |
my $mech = WWW::Mechanize->new(); | |
$mech->get($site); | |
my $form = $mech->form_with_fields(qw(username password)); | |
$mech->field('username', 'username'); | |
$mech->field('password', '********************'); | |
$mech->submit(); | |
# Parse | |
my $dom = Mojo::DOM->new($mech->content); | |
my $title = $dom->find('div.subject h3')->text; | |
my $string = "[TECH] refs #" . $ARGV[0] . ' - ' . $title; | |
# Find | |
print $string . "\n"; | |
exec 'pomojs --log ~/.pomo.log --tmux -w 25 ' . shell_quote $string; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment