Created
November 30, 2014 19:09
-
-
Save chrisdone/d541c65b049eb5220811 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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