redmineをシェルで操作
<?php
$host = 'https://example.com/';
$key= 'hogehoge';
$limit = 50;
$assigned = 83;
//-----------------------------------------------
$e = file_get_contents($host.'issues.json?status_id=open&key='.$key.'&limit='.$limit.'&assigned_to_id='.$assigned);
$xs = json_decode($e)->issues;
$c = 1;
foreach($xs as $x){
$f = '';
if($x->author->id != $x->assigned_to->id){
$f = ' from '.$x->author->name;
}
echo zero($c).'. '.$x->subject.$f."\n";
$c++;
}
function zero($n){
if($n < 10){
return '0'.$n;
}else{
return $n;
}
}
~/.bashrcに
alias re='clear; php ~/redmine.php
とかってしておくといい感じ