mirror of
https://github.com/thebaer/tildes.git
synced 2018-07-20 07:15:21 +00:00
60 lines
1.6 KiB
HTML
60 lines
1.6 KiB
HTML
{{define "where"}}
|
|
<html>
|
|
<head>
|
|
|
|
<title>$ where</title>
|
|
|
|
<link type="text/css" rel="stylesheet" href="tilde.css" />
|
|
<style type="text/css">
|
|
div.user {
|
|
margin: 0;
|
|
width: 50em;
|
|
}
|
|
div.user h2 {
|
|
margin: 0;
|
|
padding: 4px 0;
|
|
}
|
|
div.user h2 a {
|
|
padding-top: 4px;
|
|
padding-bottom: 4px;
|
|
}
|
|
span.time {
|
|
margin-top: 10px;
|
|
float: right;
|
|
color: #999;
|
|
}
|
|
iframe {
|
|
width: 100%;
|
|
height: 50em;
|
|
}
|
|
p.emph {
|
|
font-size: 1.2em;
|
|
}
|
|
</style>
|
|
|
|
</head>
|
|
<body id="hello" class="user-list">
|
|
|
|
<h1>$ where</h1> <span class="updated"><a href="/~bear/">↑ up</a></span>
|
|
|
|
<p>Last Updated: <time datetime="{{.Updated}}">{{.UpdatedForHumans}}</time></p>
|
|
|
|
<p class="emph">Users online now:</p>
|
|
{{range .Users}}
|
|
<div class="user">
|
|
<h2><a href="/~{{.Name}}/">~{{.Name}}</a></h2> <span class="location">{{Location .Region .Country}} </span> <span class="time">{{.CurrentTime}}</span>
|
|
</div>
|
|
{{end}}
|
|
|
|
<p class="emph" style="margin-top: 2em; margin-bottom: 1em;">All users - <a href="/~bear/map.html">full map</a> | <a href="/~bear/where.json">data</a></p>
|
|
<iframe src="/~bear/map.html"></iframe>
|
|
|
|
<h3>How does it work?</h3>
|
|
<p>Every 15 minutes this program runs `who --ips` and looks up geo info on any IPs it can, hits Google's geocode API to get some more general coordinates, which adds to <a href="where.json">this data</a> for <a href="map.html">this map</a>, and then generates the page you see here.</p>
|
|
<p>You can see for yourself in the <a href="https://github.com/thebaer/tildes/blob/master/where/where.go">GitHub project</a>, where contributions are welcome!</p>
|
|
|
|
|
|
</body>
|
|
</html>
|
|
{{end}}
|