Skip to content

Instantly share code, notes, and snippets.

@abramadams
Forked from anonymous/trycf-gist.cfm
Last active September 30, 2015 22:09
Show Gist options
  • Save abramadams/5b62b57d5172502496e3 to your computer and use it in GitHub Desktop.
Save abramadams/5b62b57d5172502496e3 to your computer and use it in GitHub Desktop.
TryCF Gist
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-MfvZlkHCEqatNoGiOXveE8FIwMzZg4W85qfrfIFBfYc= sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
<cfoutput>#buildTable()#</cfoutput>
<cfscript>
function buildTable( version = "all" ){
var versionMap = {"10": 7770, "11": 10206, "all": "null" };
var surl = "https://bugbase.adobe.com/index.cfm?event=qSearchBugs&page=1&pageSize=8000&gridsortcolumn=AD_S_CREATED_DT&gridsortdirection=ASC&type=null&product=1149&version=#versionMap[version]#&prodArea=10&state=OPEN&status=null&reason=null&numFiles=&numFilesOp=%3D&numVotes=&numVotesOp=%3D&creationDate=&creationDateOp=%3D&priority=null&failureType=null&frequency=null&reportedBy=&fixedInBuild=&foundInBuild=&appLanguage=-&osLanguage=-&platform=-&browser=-&title=&description=&testConfig=&_cf_nodebug=true&_cf_nocache=true&_cf_clientid=0BB3E5E1EDECE92681695E31F5D9F568&_cf_rc=19";
var httpsvc = new Http();
httpsvc.setUrl(surl);
var response = httpSvc.send().getPrefix();
var bugs = deserializeJSON( mid( response.filecontent, 3, response.filecontent.len() ) );
bugs = bugs.query.data.filter(function(a){return a[4] != "neverfix";});
var table = '<table class="table table-striped sortable"><thead><tr><th>id</th><th>status</th><th>reason</th><th>title</th><th>created date</th></tr></thead><tbody>';
table &= bugs.reduce( function( result, a, idx, orig ){
// result = result ?: "<tr><th colspan='5'> #orig.len()# Open Language Bugs/Feature Requests for ACF version: #uCase( version )#</th></tr>";
result = !isNull( result ) ? result : "<tr><th colspan='5'> #orig.len()# Open Language Bugs/Feature Requests for ACF version: #uCase( version )#</th></tr>";
return result &
"<tr>
<td><a href='https://bugbase.adobe.com/index.cfm?event=selectBug&CFGRIDKEY=#a[2]#' target='_blank'>#a[2]#</a></td>
<td>#a[3]#</td>
<td>#a[4]#</td>
<td>#a[5]#</td>
<td>#dateFormat(a[6],'mmm dd, yyyy')#</td>
</tr>";
});
table &= "</tbody></table>";
return table;
}
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment