Skip to content

Instantly share code, notes, and snippets.

@chrisdone
Created November 30, 2014 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisdone/d541c65b049eb5220811 to your computer and use it in GitHub Desktop.
Save chrisdone/d541c65b049eb5220811 to your computer and use it in GitHub Desktop.
import Data.Conduit.Shell
import qualified Data.Conduit.Shell.Segments as SH
import System.Environment
main =
do args <- getArgs
case args of
[user] ->
do pos:_ <- run (SH.strings (posConduit user))
putStrLn pos
_ -> error "specify a username"
url = "https://gist.githubusercontent.com/paulmillr/2657075\
\/raw/1d8bb770fa12fcac95d30252a0d28eed70e62630/active.md"
posConduit user =
curl "-s" url $|
grep user $|
sed "-r" "s/.*>(\\#[0-9]+).*/\\1/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment