{ echo "CREATE TABLE LIST (pbl_date varchar(50), plb_user varchar(50) );"; for i in 1 2 3 4 5 6 7 8 9 10 11 12; do curl "https://www.archlinux.org/news/?page=$i" | awk '//' | grep -v tbody | grep -v table | grep -v -e '^\ *$' | grep -v "\/INSERT INTO LIST VALUES (/g' | sed 's/<\/tr>/);/g' | sed 's/]*>/"/g' | sed 's/<\/td>/"/g'| sed 's/^\ *//g' | tr -d '\n' | sed 's/""/","/g' | sed 's/\;/\;\n/g'; done; echo ".headers on"; echo ".output /tmp/list.txt"; echo "select count(*) posts, plb_user, min(pbl_date) , max(pbl_date) from LIST group by plb_user order by count(*) DESC;"; echo ".exit"; } |sqlite3 /tmp/news.sqlite && cat /tmp/list.txt
99|Judd Vinet|2002-03-02|2007-10-01
92|Jason Chu|2003-10-05|2008-04-03
56|Tobias Powalowski|2004-11-02|2009-12-29
33|Jan de Groot|2005-08-23|2010-04-27
25|Aaron Griffin|2006-02-22|2010-01-21
21|Pierre Schmitz|2007-08-22|2013-08-17
20|Allan McRae|2008-10-06|2013-06-03
17|Paul Mattal|2005-04-11|2010-04-26
16|Thomas Bächler|2007-04-05|2014-10-22
15|Damir Perisa|2004-09-22|2006-12-09
15|Dan McGee|2007-03-25|2014-02-17
15|Eduardo Romero|2008-06-04|2009-08-07
14|Tobias Kieslich|2004-11-19|2009-09-13
13|James Rayner|2006-03-10|2010-02-18
12|Tom Gundersen|2011-05-02|2013-02-04
9|Andreas Radke|2007-05-13|2012-09-06
9|Ionuț Mircea Bîru|2010-01-30|2012-02-05
8|Simo Leone|2006-10-08|2008-06-24
8|Tom Killian|2007-04-15|2007-12-11
6|Alexander Baldeck|2007-05-09|2007-11-05
6|Daniel Griffiths|2010-01-13|2010-09-20
6|Gaetan Bisson|2011-04-15|2014-12-08
5|Dieter Plaetinck|2009-08-10|2012-01-23
5|Eric Bélanger|2008-05-01|2011-10-06
5|Florian Pritz|2012-08-11|2014-09-26
4|Andrea Scarpino|2009-01-26|2013-03-01
4|Dave Reisner|2011-08-14|2012-06-01
3|Dusty Phillips|2008-11-03|2009-10-06
3|François Charette|2008-09-12|2009-09-11
3|Kevin Piche|2006-09-21|2010-08-02
3|Ronald van Haren|2009-05-05|2012-07-20
3|Rémy Oudompheng|2011-08-06|2013-07-15
3|Travis Willard|2007-10-24|2008-04-15
3|dorphell|2004-02-10|2004-09-14
3|Роман Кирилич|2007-11-06|2008-02-10
2|Bartłomiej Piotrowski|2013-03-25|2014-07-12
2|Daniel Isenmann|2007-10-15|2007-11-16
2|Eli Janssen|2008-01-12|2008-06-02
2|Jeff Mickey|2007-12-17|2008-11-09
2|Laurent Carlier|2014-07-28|2014-10-02
2|Thomas Dziedzic|2014-05-04|2014-08-21
1|Arjan Timmerman|2006-09-29|2006-09-29
1|Aurelien Foret|2005-01-17|2005-01-17
1|Dale Blount|2007-03-05|2007-03-05
1|Eric Johnson|2004-05-26|2004-05-26
1|Evangelos Foutras|2011-06-15|2011-06-15
1|Guillaume Alaux|2014-10-12|2014-10-12
1|Jan Steffens|2014-12-11|2014-12-11
1|Jürgen Hötzel|2005-10-08|2005-10-08
1|Lukas Fleischer|2015-01-20|2015-01-20
1|Manolis Tzanidakis|2004-02-06|2004-02-06
1|Ray Rashif|2011-07-08|2011-07-08
1|Sven-Hendrik Haase|2014-10-05|2014-10-05
1|Ángel Velásquez|2011-02-07|2011-02-07
#!/bin/bash
model=$1
mkdir $model
cd $model
i=1
while $( printf "wget http://lego.brickinstructions.com/08000/$model/%03d.jpg" $i );
do
((i++))
done
convert *.jpg $model.pdf
cd ..
echo done $model/$model.pdf
#!/usr/bin/perl
use Time::Piece;
use Date::Language;
print "DROP TABLE IF EXISTS log;\n";
print "CREATE TABLE log (DATUM DATETIME);\n";
my $lang = Date::Language->new('English');
my $date;
while ( <> )
{
chomp;
if ( /\d{5,}:\ \ ===\ sync/)
{
s/:\ \ ===\ sync//;
$date = localtime($_)->strftime('%Y-%m-%dT%H:%M:%S')
}
elsif ( /^Date:\ \ \ /)
{
s/^Date:\ \ \ //;
$date = localtime($lang->str2time($_))->strftime('%Y-%m-%dT%H:%M:%S')
}
else
{
next
}
print "insert into log values ('" . $date . "');\n"
}
print "SELECT
date(DATUM, '-15 Minute' ),
count(*),
cast(ROUND(count(*) /.24,0) as int) || '%'
FROM log
GROUP BY date( DATUM, '-15 Minute')
ORDER BY date( DATUM) ASC ;\n"
|