Showing posts with label reddit. Show all posts
Showing posts with label reddit. Show all posts

Monday, June 8, 2009

Wasting just a little bit more time: a tale of dzen and reddit

Are you tired of switching from the console to browser, and then pressing F5 to see what's new on reddit? So am I. There's got to be a better way of seeing new posts on reddit without leaving the comfort of the command line. And there is. If you run Linux with dzen, here's a possible solution. Simply use this script. It checks reddit and outputs the first ten titles in a way that can be used by dzen. It should be clear from the source how to make the script output more than ten titles or how to monitor something other than the main reddit (e.g., programming, pics, funny or others subreddits). Now all one needs to do is run this script every n seconds (depends on how often you expect new articles to arrive), you can use something like this. One last thing left to do is add a line to your .xsession that calls your checker script, e.g., I have the following line:


~/.dzen/checkReddit.sh | dzen2 -y 800 -ta c -l 10 -bg '#2c2c32' -fg 'grey70' -p -e 'entertitle=uncollapse;leavetitle=collapse' &

And here are the results (the reddit bar sits quietly at the bottom of your screen until you move your mouse over it, when you get the situation shown on the picture to the right):


Of course, once you see what's new you still have to switch to your browser if you want to actually follow the links, but this should at least save you the trouble of switching only to find out that there's nothing new. Note that there are many things left to be done here, this is just a little sample of how you can waste a few more minutes of your life.


Tuesday, March 4, 2008

Reddit alien in LaTeX

What to do on a lazy sunday afternoon? Well, there are probably a thousand useful
things one could do, but I chose to do something completely useless. And here it is, the reddit alien drawn in LaTeX (using PsTricks) :)


\documentclass{memoir}

\usepackage{pstricks}
\usepackage{pst-all}

\begin{document}

\thispagestyle{empty}

%\psset{linecolor=red}
\psset{linewidth=1pt}
\begin{pspicture}(6,9)
%\psgrid[subgriddiv=1,griddots=10,gridlabels=10pt](0,0)(12,12)
\psframe(0,0)(6,9)
% head
\psellipse(3,6)(1.8,1)
% ears
\psarc{-}(1.5,6.5){0.4}{38}{230}
\psarc{-}(4.5,6.5){0.4}{-50}{142}
% eyes
\pscircle[fillstyle=solid,linestyle=none,fillcolor=orange](2.3,6.3){0.3}
\pscircle[fillstyle=solid,linestyle=none,fillcolor=orange](3.7,6.3){0.3}
% mouth
\psbezier(2.3,5.6)(2.5,5.3)(3.5,5.3)(3.7,5.6)
% the tentacle thingie
\psline(2.99,6.99)(3.6,8)
\psline(3.581,7.993)(4.1,7.8)
\pscircle(4.35,7.65){0.3}
% arms
\psarc{-}(2.8,4.3){1.1}{130}{231}
\psarc{-}(3.15,4.3){1.1}{-48}{50}
% body
\psbezier(2.1,5.15)(2.0,4.7)(1.8,3.3)(2.6,2.7)
\psbezier(3.85,5.15)(4.1,4.65)(4.1,3.3)(3.4,2.7)
% feet
\psline(1.65,2.7)(4.3,2.7)
\psarc{-}(2.1,2.685){0.45}{70}{180}
\psarc{-}(3.85,2.685){0.45}{0}{105}
\end{pspicture}

\end{document}

Note that I used the memoir document class, but you could also use article if you don't have memoir available (the results would be the same). The alien does not look exactly the same as the official reddit one, but who cares? And here is what you should get when you run this example through LaTeX:

And people say LaTeX suxx...