<!DOCTYPE HTML>
<html>

<head>
<title>GifCombiner</title>
<meta charset="utf-8">
</head>

<body>
<input name="album_id" type="text"><button name="submit_request">Submit!</button>
<br />
<span id="imgur_url"></span>

<script type="text/javascript">

var httpPostReqr = new XMLHttpRequest();
httpPostReqr.onreadystatechange = insertURL;
document.getElementsByName("submit_request")[0].onclick = makeRequest

function makeRequest() {
    httpPostReqr.open('POST', '/API');
    httpPostReqr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    var request_body = "input_type=IMGUR&output_type=IMGUR&album_id=";
    request_body = request_body + document.getElementsByName("album_id")[0].value
    httpPostReqr.send(request_body)
}

function insertURL() {
    if(httpPostReqr.readyState == 4) {
        document.getElementById("imgur_url").innerHTML = httpPostReqr.responseText;
    }
}


</script>
</body>
</html>

<!DOCTYPE HTML>
<html>

<head>
<title>GifCombiner</title>
<meta charset="utf-8">
</head>

<body>
Input imgur album ID or URL:
<br />
<input name="album_id" type="text"><button name="submit_request">Submit!</button>
<br />
<span id="imgur_url"></span>

<script type="text/javascript">

var httpPostReqr = new XMLHttpRequest();
httpPostReqr.onreadystatechange = insertURL;
document.getElementsByName("submit_request")[0].onclick = makeRequest

function makeRequest() {
    httpPostReqr.open('POST', '/API');
    httpPostReqr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    var request_body = "input_type=IMGUR&output_type=IMGUR&album_id=";
    var album_id = document.getElementsByName("album_id")[0].value
    album_id = album_id.split('/').pop()
    request_body = request_body + album_id
    httpPostReqr.send(request_body)
}

function insertURL() {
    if(httpPostReqr.readyState == 4) {
        document.getElementById("imgur_url").innerHTML = httpPostReqr.responseText;
    }
}


</script>
</body>
</html>

Add input text and allow for URL entry as well
Add input text and allow for URL entry as well
