#!/usr/bin/perl -T %ENV = (); $ENV{ 'PATH' } = '/bin:/usr/bin:/usr/local/bin'; my $response = `curl --silent 'https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&jqlQuery=project+%3D+TS+AND+status+%3D+Open+ORDER+BY+priority+DESC&mode=hide'`; my @matches = ( $response =~ /browse\/(TS\-\d+)/g ); my $length = $#matches + 1; $length = rand($length); $length = int $length; my $link = $matches[$length]; print "Content-Type: text/html\r\n\r\n"; print "\r\n

Redirecting to random JIRA ticket, hold on...

";