Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
133 lines (126 sloc) 5.42 KB
<!DOCTYPE html>
<html>
<head>
<title>Twitter Gateway</title>
<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css" integrity="sha384-nn4HPE8lTHyVtfCBi5yW9d20FjT8BJwUXyWZT9InLYax14RDjBj46LmSztkmNP9w" crossorigin="anonymous" />
<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/grids-responsive-min.css" />
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,400italic,600&subset=latin,greek' rel='stylesheet' type='text/css' />
<style>
body, html {
background: #ddd;
color: black;
font-weight: 300;
margin: 0;
}
html, button, input, select, textarea,
.pure-g [class *= "pure-u"] {
font-family: "Open Sans", Arial, Helvetica, sans-serif;
}
#container {
text-align: center;
}
#content {
margin: auto;
text-align: left;
}
h1 {
text-align: center;
font-weight: normal;
}
h3 {
font-size: 1em;
border-bottom: 1px solid #b7b7b7;
color: #333;
font-weight: 300;
padding: 0.3em 0;
}
table.serverinfo {
font-family: monospace;
margin: 1em;
color: #444;
}
table.serverinfo td {
padding: 0 0.3em;
}
.pure-form-aligned .pure-control-group label{ width: 16em; }
.pure-controls { text-align: center; }
.pure-form-aligned .pure-controls{ margin-left: 0; }
.pure-form legend { border-bottom: 1px solid #b7b7b7; }
</style>
<script type="text/javascript">
window.addEventListener("load", function() {
var input = document.getElementById("twitter_url");
var output = document.getElementById("ap_url");
var converted = document.getElementById("converted");
var button = document.getElementById("generate");
button.addEventListener("click", function() {
var url = input.value;
url = url.replace("mobile.twitter.com", "twitter.com");
url = url.replace("twitter.com", "{{.Domain}}");
output.value = url;
converted.style.display = "block";
});
});
</script>
</head>
<body>
<div class="pure-g" id="container">
<div id="content" class="pure-u-1 pure-u-md-1-2 pure-u-lg-1-3">
<h1>ActivityPub Twitter Adapter</h1>
<p>
Basically parsing twitter.com and making ActivityPub resources out of it,
so you can boost them from Mastodon. <br />
It does not post any tweet or toot anywhere or let you follow anyone;
it's more of a better way to replace the previous quote-retweets made on Mastodon.
</p>
<p>
It's using the same URL paths, so you can just replace <em>twitter.com</em>
by <em>{{.Domain}}</em> and put it into your Mastodon search box.
</p>
{{if .Config.Motd}}
<p><b>Server:</b> {{.Config.Motd}}</p>
{{end}}
<form class="pure-form pure-form-aligned">
<fieldset>
<legend>Link Generator</legend>
<div class="pure-control-group">
<label for="twitter_url">Twitter account or tweet URL</label>
<input id="twitter_url" class="pure-input-1-2" type="text" placeholder="Twitter account or tweet URL" required />
</div>
<div class="pure-control-group" style="display: none" id="converted">
<label for="ap_url">ActivityPub URL</label>
<input id="ap_url" class="pure-input-1-2" type="text" />
</div>
<div class="pure-controls">
<button type="button" class="pure-button pure-button-primary" id="generate">Convert</button>
</div>
</fieldset>
</form>
<h3>Server Information</h3>
<table class="serverinfo">
<tbody>
<tr>
<td>Population:</td>
<td>{{.Stats.DbTweets}} tweets from {{.Stats.DbAccounts}} users</td>
</tr>
<tr>
<td>DB/users:</td>
<td>ttl={{.Config.AccountCacheTtl}}
h/m={{.Stats.DbAccountHitRatio}}</td>
</tr>
<tr>
<td>DB/tweets:</td>
<td>ttl={{.Config.TweetCacheTtl}}
h/m={{.Stats.DbTweetHitRatio}}</td>
</tr>
<tr>
<td>Uptime:</td>
<td>{{.Stats.Uptime}} ({{.Stats.StartTime | fdate}})</td>
</tr>
</tbody>
</table>
<p id="converted"></p>
</div>
</div>
</body>
</html>