I am trying to display the latest version of roundcube. I get the results I want with
curl https://api.github.com/repos/roundcube/roundcubemail/releases | grep tag_name | grep -o "1.2.[0-9]\{1,\}" | sort -n | tail -1
I am trying to work this into a RC plugin, so I have to do this via php and it is not working as I would hope.
<?php
$ch = curl_init();
curl_setopt_array(
$ch, array(
CURLOPT_URL => 'https://api.github.com/repos/roundcube/roundcubemail/releases',
CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'],
CURLOPT_POSTFIELDS => 'grep tag_name | grep -o \"1.2.[0-9]\{1,\}\" | sort -n | tail -1'));
$output = curl_exec($ch);
echo $output;
?>
It returns
{ "message": "Not Found", "documentation_url": "https://developer.github.com/v3" } 1
Any help is appreciated. Thanks