Skip to content

Instantly share code, notes, and snippets.

@autos
Created March 11, 2015 10:43
Show Gist options
  • Save autos/062f83d099bde3fe9594 to your computer and use it in GitHub Desktop.
Save autos/062f83d099bde3fe9594 to your computer and use it in GitHub Desktop.
Imgur at work
<html>
<head>
<title>input</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
function myFunction() {
var str1 = document.getElementById('str1').value;
var res = str1.replace("imgur.com", "filmot.org");
document.getElementById('str1').value = res;
var win = window.open(res, '_blank');
win.focus();
}
</script>
</head>
<body>
<center>
<br />
<br />
<br />
<h2>Paste imgur link</h2>
<br />
<br />
<br />
<br />
<br />
<input type="text" class="form-control input-s" id="str1" style = "width:300px;" />
<button class="btn btn-primary" onclick="myFunction()">Click</button>
</center>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment