Skip to content

Commit aacb5b3

Browse files
committed
pwnfile
1 parent aeae163 commit aacb5b3

File tree

6 files changed

+609
-1
lines changed

6 files changed

+609
-1
lines changed

config.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ weight = 5
4242
[[menu.shortcuts]]
4343
name = "<i class='fab fa-reddit'></i> r/pwnagotchi"
4444
url = "https://www.reddit.com/r/pwnagotchi/"
45-
weight = 6
45+
weight = 6

content/pwnfile.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# <span class="unit.name">NAME</span>@pwngrid
2+
3+
Unit <strong><span class="unit.name">NAME</span></strong> registered <span class="unit.enrolled_at">ENROLLED AT</span> and has been seen online
4+
<span class="unit.updated_at">UPDATED AT</span> from <span class="unit.country">COUNTRY</span>.
5+
6+
<pre><code class="unit.data:uname">
7+
</code></pre>
8+
9+
<pre><code class="unit.public_key">
10+
</code></pre>
11+
12+
Unit <span class="unit.name">NAME</span> reported <strong><span class="unit.networks">9000</span></strong>
13+
pwned networks so far.
14+
15+
### Last Session
16+
17+
<table width="100%">
18+
<tbody>
19+
<tr>
20+
<th width="20%">Duration</th>
21+
<td class="unit.data:duration"></td>
22+
</tr>
23+
<tr>
24+
<th>Peers Met</th>
25+
<td class="unit.data:peers"></td>
26+
</tr>
27+
<tr>
28+
<th>Associations</th>
29+
<td class="unit.data:associated"></td>
30+
</tr>
31+
<tr>
32+
<th>Deauths</th>
33+
<td class="unit.data:deauthed"></td>
34+
</tr>
35+
<tr>
36+
<th>Handshakes</th>
37+
<td class="unit.data:handshakes"></td>
38+
</tr>
39+
<tr>
40+
<th>Min Reward</th>
41+
<td class="unit.data:min_reward"></td>
42+
</tr>
43+
<tr>
44+
<th>Max Reward</th>
45+
<td class="unit.data:max_reward"></td>
46+
</tr>
47+
<tr>
48+
<th>Average Reward</th>
49+
<td class="unit.data:avg_reward"></td>
50+
</tr>
51+
</tbody>
52+
</table>
53+
54+
55+

layouts/partials/custom-header.html

+2
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,6 @@
6969

7070
<link href="/map.min.css" rel="stylesheet">
7171
<script src="/map.min.js"></script>
72+
<script src="/jquery.timeago.js"></script>
7273
<script src="/poll-map.js"></script>
74+
<script src="/pwnfile.js"></script>

layouts/partials/share-buttons.html

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{{ $pageurl := .Page.URL }}
2+
{{ $siteurl := .Site.BaseURL }}
3+
4+
<style>
5+
#share-buttons {display: inline-block; vertical-align: middle; }
6+
#share-buttons:after {content: ""; display: block; clear: both;}
7+
#share-buttons > div {
8+
position: relative;
9+
text-align: left;
10+
height: 36px;
11+
width: 32px;
12+
float: left;
13+
text-align: center;
14+
}
15+
#share-buttons > div > svg {height: 16px; fill: #d5d5d5; margin-top: 10px;}
16+
#share-buttons > div:hover {cursor: pointer;}
17+
#share-buttons > div.facebook:hover > svg {fill: #3B5998;}
18+
#share-buttons > div.twitter:hover > svg {fill: #55ACEE;}
19+
#share-buttons > div.linkedin:hover > svg {fill: #0077b5;}
20+
#share-buttons > div.pinterest:hover > svg {fill: #CB2027;}
21+
#share-buttons > div.gplus:hover > svg {fill: #dd4b39;}
22+
#share-buttons > div.mail:hover > svg {fill: #7D7D7D;}
23+
#share-buttons > div.instagram:hover > svg {fill: #C73B92;}
24+
#share-buttons > div.facebook > svg {height: 18px; margin-top: 9px;}
25+
#share-buttons > div.twitter > svg {height: 20px; margin-top: 8px;}
26+
#share-buttons > div.linkedin > svg {height: 19px; margin-top: 7px;}
27+
#share-buttons > div.pinterest > svg {height: 20px; margin-top: 9px;}
28+
#share-buttons > div.gplus > svg {height: 17px; margin-top: 9px; position: relative; left: 1px;}
29+
#share-buttons > div.mail > svg {height: 14px; margin-top: 11px;}
30+
</style>
31+
32+
<span style="color: silver;">Share on: </span><div id="share-buttons">
33+
<div class="facebook" title="Share this on Facebook" onclick="window.open('http://www.facebook.com/share.php?u={{ $siteurl }}{{ $pageurl }}');"><svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759h-306v-759h-255v-296h255v-218q0-186 104-288.5t277-102.5q147 0 228 12z"/></svg></div>
34+
<div class="twitter" title="Share this on Twitter" onclick="window.open('http://twitter.com/home?status={{ $siteurl }}{{ $pageurl }}');"><svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1684 408q-67 98-162 167 1 14 1 42 0 130-38 259.5t-115.5 248.5-184.5 210.5-258 146-323 54.5q-271 0-496-145 35 4 78 4 225 0 401-138-105-2-188-64.5t-114-159.5q33 5 61 5 43 0 85-11-112-23-185.5-111.5t-73.5-205.5v-4q68 38 146 41-66-44-105-115t-39-154q0-88 44-163 121 149 294.5 238.5t371.5 99.5q-8-38-8-74 0-134 94.5-228.5t228.5-94.5q140 0 236 102 109-21 205-78-37 115-142 178 93-10 186-50z"/></svg></div>
35+
<div class="linkedin" title="Share this on Linkedin" onclick="window.open('https://www.linkedin.com/shareArticle?mini=true&url={{ $siteurl }}{{ $pageurl }}&title=&summary=&source=');"><svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M477 625v991h-330v-991h330zm21-306q1 73-50.5 122t-135.5 49h-2q-82 0-132-49t-50-122q0-74 51.5-122.5t134.5-48.5 133 48.5 51 122.5zm1166 729v568h-329v-530q0-105-40.5-164.5t-126.5-59.5q-63 0-105.5 34.5t-63.5 85.5q-11 30-11 81v553h-329q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5 114.5-15.5q171 0 275 113.5t104 332.5z"/></svg></div>
36+
{{ if .Params.image }}<div class="pinterest" title="Share this on Pinterest" onclick="window.open('https://pinterest.com/pin/create/button/?url=&media={{ $siteurl }}{{ .Params.image }}&description=');"><svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M256 597q0-108 37.5-203.5t103.5-166.5 152-123 185-78 202-26q158 0 294 66.5t221 193.5 85 287q0 96-19 188t-60 177-100 149.5-145 103-189 38.5q-68 0-135-32t-96-88q-10 39-28 112.5t-23.5 95-20.5 71-26 71-32 62.5-46 77.5-62 86.5l-14 5-9-10q-15-157-15-188 0-92 21.5-206.5t66.5-287.5 52-203q-32-65-32-169 0-83 52-156t132-73q61 0 95 40.5t34 102.5q0 66-44 191t-44 187q0 63 45 104.5t109 41.5q55 0 102-25t78.5-68 56-95 38-110.5 20-111 6.5-99.5q0-173-109.5-269.5t-285.5-96.5q-200 0-334 129.5t-134 328.5q0 44 12.5 85t27 65 27 45.5 12.5 30.5q0 28-15 73t-37 45q-2 0-17-3-51-15-90.5-56t-61-94.5-32.5-108-11-106.5z"/></svg></div>{{ end }}
37+
<div class="gplus" title="Share this on Google Plus" onclick="window.open('https://plus.google.com/share?url={{ $siteurl }}{{ $pageurl }}');"><svg viewBox="0 0 2304 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1437 913q0 208-87 370.5t-248 254-369 91.5q-149 0-285-58t-234-156-156-234-58-285 58-285 156-234 234-156 285-58q286 0 491 192l-199 191q-117-113-292-113-123 0-227.5 62t-165.5 168.5-61 232.5 61 232.5 165.5 168.5 227.5 62q83 0 152.5-23t114.5-57.5 78.5-78.5 49-83 21.5-74h-416v-252h692q12 63 12 122zm867-122v210h-209v209h-210v-209h-209v-210h209v-209h210v209h209z"/></svg></div>
38+
<div class="mail" title="Share this through Email" onclick="window.open('mailto:?&body={{ $siteurl }}{{ $pageurl }}');"><svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1792 710v794q0 66-47 113t-113 47h-1472q-66 0-113-47t-47-113v-794q44 49 101 87 362 246 497 345 57 42 92.5 65.5t94.5 48 110 24.5h2q51 0 110-24.5t94.5-48 92.5-65.5q170-123 498-345 57-39 100-87zm0-294q0 79-49 151t-122 123q-376 261-468 325-10 7-42.5 30.5t-54 38-52 32.5-57.5 27-50 9h-2q-23 0-50-9t-57.5-27-52-32.5-54-38-42.5-30.5q-91-64-262-182.5t-205-142.5q-62-42-117-115.5t-55-136.5q0-78 41.5-130t118.5-52h1472q65 0 112.5 47t47.5 113z"/></svg></div>
39+
</div>

static/jquery.timeago.js

+232
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
/**
2+
* Timeago is a jQuery plugin that makes it easy to support automatically
3+
* updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago").
4+
*
5+
* @name timeago
6+
* @version 1.6.7
7+
* @requires jQuery >=1.5.0 <4.0
8+
* @author Ryan McGeary
9+
* @license MIT License - http://www.opensource.org/licenses/mit-license.php
10+
*
11+
* For usage and examples, visit:
12+
* http://timeago.yarp.com/
13+
*
14+
* Copyright (c) 2008-2019, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org)
15+
*/
16+
17+
(function (factory) {
18+
if (typeof define === 'function' && define.amd) {
19+
// AMD. Register as an anonymous module.
20+
define(['jquery'], factory);
21+
} else if (typeof module === 'object' && typeof module.exports === 'object') {
22+
factory(require('jquery'));
23+
} else {
24+
// Browser globals
25+
factory(jQuery);
26+
}
27+
}(function ($) {
28+
$.timeago = function(timestamp) {
29+
if (timestamp instanceof Date) {
30+
return inWords(timestamp);
31+
} else if (typeof timestamp === "string") {
32+
return inWords($.timeago.parse(timestamp));
33+
} else if (typeof timestamp === "number") {
34+
return inWords(new Date(timestamp));
35+
} else {
36+
return inWords($.timeago.datetime(timestamp));
37+
}
38+
};
39+
var $t = $.timeago;
40+
41+
$.extend($.timeago, {
42+
settings: {
43+
refreshMillis: 60000,
44+
allowPast: true,
45+
allowFuture: false,
46+
localeTitle: false,
47+
cutoff: 0,
48+
autoDispose: true,
49+
strings: {
50+
prefixAgo: null,
51+
prefixFromNow: null,
52+
suffixAgo: "ago",
53+
suffixFromNow: "from now",
54+
inPast: 'any moment now',
55+
seconds: "less than a minute",
56+
minute: "about a minute",
57+
minutes: "%d minutes",
58+
hour: "about an hour",
59+
hours: "about %d hours",
60+
day: "a day",
61+
days: "%d days",
62+
month: "about a month",
63+
months: "%d months",
64+
year: "about a year",
65+
years: "%d years",
66+
wordSeparator: " ",
67+
numbers: []
68+
}
69+
},
70+
71+
inWords: function(distanceMillis) {
72+
if (!this.settings.allowPast && ! this.settings.allowFuture) {
73+
throw 'timeago allowPast and allowFuture settings can not both be set to false.';
74+
}
75+
76+
var $l = this.settings.strings;
77+
var prefix = $l.prefixAgo;
78+
var suffix = $l.suffixAgo;
79+
if (this.settings.allowFuture) {
80+
if (distanceMillis < 0) {
81+
prefix = $l.prefixFromNow;
82+
suffix = $l.suffixFromNow;
83+
}
84+
}
85+
86+
if (!this.settings.allowPast && distanceMillis >= 0) {
87+
return this.settings.strings.inPast;
88+
}
89+
90+
var seconds = Math.abs(distanceMillis) / 1000;
91+
var minutes = seconds / 60;
92+
var hours = minutes / 60;
93+
var days = hours / 24;
94+
var years = days / 365;
95+
96+
function substitute(stringOrFunction, number) {
97+
var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction;
98+
var value = ($l.numbers && $l.numbers[number]) || number;
99+
return string.replace(/%d/i, value);
100+
}
101+
102+
var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) ||
103+
seconds < 90 && substitute($l.minute, 1) ||
104+
minutes < 45 && substitute($l.minutes, Math.round(minutes)) ||
105+
minutes < 90 && substitute($l.hour, 1) ||
106+
hours < 24 && substitute($l.hours, Math.round(hours)) ||
107+
hours < 42 && substitute($l.day, 1) ||
108+
days < 30 && substitute($l.days, Math.round(days)) ||
109+
days < 45 && substitute($l.month, 1) ||
110+
days < 365 && substitute($l.months, Math.round(days / 30)) ||
111+
years < 1.5 && substitute($l.year, 1) ||
112+
substitute($l.years, Math.round(years));
113+
114+
var separator = $l.wordSeparator || "";
115+
if ($l.wordSeparator === undefined) { separator = " "; }
116+
return $.trim([prefix, words, suffix].join(separator));
117+
},
118+
119+
parse: function(iso8601) {
120+
var s = $.trim(iso8601);
121+
s = s.replace(/\.\d+/,""); // remove milliseconds
122+
s = s.replace(/-/,"/").replace(/-/,"/");
123+
s = s.replace(/T/," ").replace(/Z/," UTC");
124+
s = s.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400
125+
s = s.replace(/([\+\-]\d\d)$/," $100"); // +09 -> +0900
126+
return new Date(s);
127+
},
128+
datetime: function(elem) {
129+
var iso8601 = $t.isTime(elem) ? $(elem).attr("datetime") : $(elem).attr("title");
130+
return $t.parse(iso8601);
131+
},
132+
isTime: function(elem) {
133+
// jQuery's `is()` doesn't play well with HTML5 in IE
134+
return $(elem).get(0).tagName.toLowerCase() === "time"; // $(elem).is("time");
135+
}
136+
});
137+
138+
// functions that can be called via $(el).timeago('action')
139+
// init is default when no action is given
140+
// functions are called with context of a single element
141+
var functions = {
142+
init: function() {
143+
functions.dispose.call(this);
144+
var refresh_el = $.proxy(refresh, this);
145+
refresh_el();
146+
var $s = $t.settings;
147+
if ($s.refreshMillis > 0) {
148+
this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis);
149+
}
150+
},
151+
update: function(timestamp) {
152+
var date = (timestamp instanceof Date) ? timestamp : $t.parse(timestamp);
153+
$(this).data('timeago', { datetime: date });
154+
if ($t.settings.localeTitle) {
155+
$(this).attr("title", date.toLocaleString());
156+
}
157+
refresh.apply(this);
158+
},
159+
updateFromDOM: function() {
160+
$(this).data('timeago', { datetime: $t.parse( $t.isTime(this) ? $(this).attr("datetime") : $(this).attr("title") ) });
161+
refresh.apply(this);
162+
},
163+
dispose: function () {
164+
if (this._timeagoInterval) {
165+
window.clearInterval(this._timeagoInterval);
166+
this._timeagoInterval = null;
167+
}
168+
}
169+
};
170+
171+
$.fn.timeago = function(action, options) {
172+
var fn = action ? functions[action] : functions.init;
173+
if (!fn) {
174+
throw new Error("Unknown function name '"+ action +"' for timeago");
175+
}
176+
// each over objects here and call the requested function
177+
this.each(function() {
178+
fn.call(this, options);
179+
});
180+
return this;
181+
};
182+
183+
function refresh() {
184+
var $s = $t.settings;
185+
186+
//check if it's still visible
187+
if ($s.autoDispose && !$.contains(document.documentElement,this)) {
188+
//stop if it has been removed
189+
$(this).timeago("dispose");
190+
return this;
191+
}
192+
193+
var data = prepareData(this);
194+
195+
if (!isNaN(data.datetime)) {
196+
if ( $s.cutoff === 0 || Math.abs(distance(data.datetime)) < $s.cutoff) {
197+
$(this).text(inWords(data.datetime));
198+
} else {
199+
if ($(this).attr('title').length > 0) {
200+
$(this).text($(this).attr('title'));
201+
}
202+
}
203+
}
204+
return this;
205+
}
206+
207+
function prepareData(element) {
208+
element = $(element);
209+
if (!element.data("timeago")) {
210+
element.data("timeago", { datetime: $t.datetime(element) });
211+
var text = $.trim(element.text());
212+
if ($t.settings.localeTitle) {
213+
element.attr("title", element.data('timeago').datetime.toLocaleString());
214+
} else if (text.length > 0 && !($t.isTime(element) && element.attr("title"))) {
215+
element.attr("title", text);
216+
}
217+
}
218+
return element.data("timeago");
219+
}
220+
221+
function inWords(date) {
222+
return $t.inWords(distance(date));
223+
}
224+
225+
function distance(date) {
226+
return (new Date().getTime() - date.getTime());
227+
}
228+
229+
// fix for IE6 suckage
230+
document.createElement("abbr");
231+
document.createElement("time");
232+
}));

0 commit comments

Comments
 (0)