2025-02-03 21:33:58 +01:00
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<title>Recommendations Page</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h1>Available Recommondations</h1>
|
|
|
|
<div>
|
|
|
|
{{range .recs}}
|
2025-02-04 21:02:36 +01:00
|
|
|
<a href="https://e621.net/posts/{{.}}" target="_blank">{{.}}</a><button onclick="rec({{.}})">Like</button><br>
|
2025-02-03 21:33:58 +01:00
|
|
|
{{end}}
|
|
|
|
<form method="get">
|
|
|
|
<input value="{{ .last_page }}" style="display: none" name="page">
|
|
|
|
<button type="submit">Last Page</button>
|
|
|
|
</form>
|
|
|
|
<form method="get">
|
|
|
|
<input value="{{ .next_page }}" style="display: none" name="page">
|
|
|
|
<button type="submit">Next Page</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
2025-02-04 21:02:36 +01:00
|
|
|
<script>
|
|
|
|
function rec(id){
|
|
|
|
const xmlHttp = new XMLHttpRequest();
|
|
|
|
xmlHttp.open( "POST",window.location.origin + "/like/" + id, false ); // false for synchronous request
|
|
|
|
xmlHttp.send( null );
|
|
|
|
return xmlHttp.responseText;
|
|
|
|
}
|
|
|
|
</script>
|
2025-02-03 21:33:58 +01:00
|
|
|
</body>
|
|
|
|
</html>
|