mirror of
https://github.com/Tygs/0bin.git
synced 2023-08-10 21:13:00 +03:00
Fixing non breakable space insertion
This commit is contained in:
37
stats.py
37
stats.py
@ -1,37 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# vim: ai ts=4 sts=4 et sw=4
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
|
||||||
Exctract usefull infos from web server logs
|
|
||||||
"""
|
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
|
|
||||||
# define your web server logs path
|
|
||||||
LOGS_PATH = "/var/log/nginx/access_0bin.log"
|
|
||||||
|
|
||||||
|
|
||||||
rexp = re.compile('(\d+\.\d+\.\d+\.\d+) - - \[([^\[\]:]+):(\d+:\d+:\d+) -(\d\d\d\d\)] ("[^"]*")(\d+) (-|\d+) ("[^"]*") (".*")\s*\Z')
|
|
||||||
|
|
||||||
|
|
||||||
f = open(LOGS_PATH, 'r')
|
|
||||||
|
|
||||||
for line in f:
|
|
||||||
a = rexp.match(line)
|
|
||||||
|
|
||||||
if not a is None:
|
|
||||||
# a.group(1) #IP address
|
|
||||||
# a.group(2) #day/month/year
|
|
||||||
# a.group(3) #time of day
|
|
||||||
# a.group(4) #timezone
|
|
||||||
# a.group(5) #request
|
|
||||||
# a.group(6) #code 200 for success, 404 for not found, etc.
|
|
||||||
# a.group(7) #bytes transferred
|
|
||||||
# a.group(8) #referrer
|
|
||||||
# a.group(9) #browser
|
|
||||||
print a.group(8) #referrer
|
|
||||||
|
|
||||||
f.close()
|
|
@ -281,7 +281,7 @@ window.zerobin = {
|
|||||||
getPasteContent: function(){
|
getPasteContent: function(){
|
||||||
var copy = '' ;
|
var copy = '' ;
|
||||||
$("#paste-content li").each(function(index) {
|
$("#paste-content li").each(function(index) {
|
||||||
copy = copy + $(this).text() + '\n';
|
copy = copy + $(this).text().replace(/[\u00a0]+/g, ' ') + '\n';
|
||||||
});
|
});
|
||||||
return copy;
|
return copy;
|
||||||
},
|
},
|
||||||
|
2
zerobin/static/js/main.min.js
vendored
2
zerobin/static/js/main.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user