]> gitweb.michael.orlitzky.com - dead/halcyon.git/blobdiff - src/Twitter/User.hs
Add referenced users' timeline URLs to the bottom of each message.
[dead/halcyon.git] / src / Twitter / User.hs
index 75cf4b6f36c3f575ce50830e2abb9f5cee13573a..ffa01ba747a8a7d7b13e684d6e0204c6c20acaa4 100644 (file)
@@ -1,3 +1,4 @@
+-- | Functions and data for working with Twitter users.
 module Twitter.User
 where
 
@@ -5,10 +6,13 @@ import Text.XML.HaXml
 
 import Twitter.Xml
 
+-- |Represents a Twitter user, and contains the only attribute thereof
+-- that we care about: the screen (user) name.
 data User = User { screen_name :: String }
           deriving (Show, Eq)
 
-              
+
+-- |Create a 'User' from HaXML 'Content'.
 user_from_content :: Content -> (Maybe User)
 user_from_content c =
     if (length names) == 0
@@ -21,3 +25,9 @@ user_from_content c =
 
     where
     names = user_screen_name c
+
+
+-- |Get the URL for the given screen name's timeline.
+screen_name_to_timeline_url :: String -> String
+screen_name_to_timeline_url sn =
+    "http://twitter.com/" ++ sn