one line shell script to count number of entries
echo -n "Number of entries... "; wget -q -O - http://www.pyweek.org/5/entries/ | grep 'clear: right' | wc -l
(log in to comment)
Comments
I noticed that someone mentioned pyweek in passing in an obscure comment on an obscure posting today that resulted in the single-highest number of hits from a single "news" posting about pyweek for a 24-hour period.
If we could only get the challenge mentioned as an article :)
That is a few chars shorter, being only 94 chars long, the above is 107 :)
That is a few chars shorter, being only 94 chars long, the above is 107 :)
BTW, we are at 70 now, woohoo! still a quite a bit off from last time though...
from urllib import*;urlopen("http://pyweek.org/5/entries").read().count("
from urllib import*;urlopen("http://pyweek.org/5/entries").read().count("<dt")
from socket import*;s=socket();s.connect(("pyweek.org",80));s.send("GET /5/entries/ HTTP/1.0\n\n");x="" while True: try:i=s.recv(9);x+=[s.gettimeout(),i][bool(i)] except:True=0 False=sum([not True for a in x.split("<dt")[0:-1]]) print False or True
wget -qO- http://pyweek.org/5/entries/|grep -c'<dt'
illume: but that isn't python ...
neko: nice :)
wget -qO- http://pyweek.org/5/entries|grep -c \<dt50 characters
wget -qO- xrl.us/5pyw|grep -c \<dtI'm such a cheater. :)
(or, its 70 character python alternative:
from urllib import*;urlopen("http://xrl.us/5pyw").read().count("<dt"))
import os;os.system("wget -qO- xrl.us/5pyw|grep -c \<dt")
let us all cheat!
- @neko on 2007/08/24 and Tee on 2007/08/25: neither of those will work. I forgot to put a print in there. ;)
- Assuming you have the `a` module installed, this will always work:
import a
- By the way, Neppord's probably just needs to have `\\<dt` instead of `\<dt`.
exec(raw_input())
still 17 though
illume on 2007/08/16 08:41: