Under the assumption that my machine is connected to the Internet, how can I automatically include my TeX.SE flair in my output document at compile time?

My understanding is that an SE flair is just a .png generated server-side when queried; at least, that's what I gather from the HTML code on my flair page.
Note that I want the process to be automated; I do not want to "manually" download the flair and then "manually" include it with \includegraphics.
Therefore, the problem reduces to including an image from the Web, as in Can I use an image located on the web in a LaTeX document?.
However, I cannot get that solution to work for my flair. I use the following command (in TeXmaker 4.0.1, with TeXlive, on Mac OS 10.8.3):
"/usr/texbin/pdflatex" -synctex=1 --shell-escape -interaction=nonstopmode %.tex
Here is my code:
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\write18{wget https://tex.stackexchange.com/users/flair/21891.png}
\includegraphics{21891.png}
\end{document}
and here is my output:

Subsidiary question: I haven't researched this very much, but is there an easy way to produce a pdf that will automatically query SE servers for an up-to-date flair? I'm guessing this would probably involve some Javascript (which the pdf reader should enable), as in How can I typeset the date/time at compile time?, but I'm not sure how to do it.
_version. I assume there is a timing issue that the file is not available for reading quick enough due to the buffering somewhere. Simpler just to run wget before pdflatex:-) – David Carlisle Apr 22 '13 at 14:48