User:Mozai

About me
Linuxfag.

My favorite pages

 * Freeware Games
 * Linux Games
 * Category:Copypasta
 * MMO Games
 * Minecraft
 * My proposal for a new front page (accepted May 2011)
 * Latest Image Uploads

How I mine the popcon databases for Linux recommendations
Not that Linux users as a whole represent the opinion of /v/, but it's a start, and I can cite it as a reliable source of what's popular.

Fedora: BASEURL=http://www.rpmfind.net/linux/RPM curl -s "$BASEURL/Groups.html" \ |egrep -o 'href=\"[^" ]*Amusements[^" ]*' |sed 's/href="//' \ |while read PAGE; do    curl -s $BASEURL/$PAGE \ |while read LINE; do      NEWLINE=$(echo $LINE |egrep -o ']*>[^<]+' |sed 's/]*>//'); if [ "$OLDLINE" ]; then echo -e "$OLDLINE\t$NEWLINE"; OLDLINE=""; else OLDLINE=$(echo $NEWLINE |sed 's/\-[0-9]\..*//'); fi; done; done \ |perl -ne 's/\-\d{8}\t(\-.)/\t/; next if m/\-data\t|\-[a-z][a-z]\t/; m/(\S+)\s+(.*)/ or die $_; if (length($n{lc($1)}) < length($2)) { $n{lc($1)} = $2; } END { print "{| border=1 cellpadding=3 cellspacing=0\n"; print "|-\n! Name !! Description\n"; foreach $_ (sort keys %n) { print "|-\n|$_ || $n{$_}\n"; } print "|}\n"; }          ';
 * 1) !/bin/bash

Ubuntu: curl -s http://popcon.ubuntu.com/by_vote.gz | gunzip -c - \ |perl -ne 'chomp; if (s/^#rank\s+//) { print "#$_\tsection\tdescription\n"; } elsif (/^#/) { 1; } elsif (s/^\d+\s+((\S+).*)/$1/) { $what = `apt-cache show $2`; if ($what =~ /Section: (\S+).*?Description: (.+?)\n/s) { print "$_\t$1\t$2\n"; }  }' \  |egrep -i '#name|game' \ |perl -pe 'BEGIN { print "{|\n"; } print "|-\n"; s!(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\(.+?\))\s+(\S+)\s+(.*) !|$1 ||$2 ||$3 ||$4 ||$5 ||$6 ||$7 ||$8 ||$9   !x; exit if ($3 eq "0"); if (m/^\|#name/) { s/\|#?/\!/g; }  END { print "|}\n"; } '