Portability | unportable |
---|---|
Stability | unstable |
Maintainer | Róman Joost |
Safe Haskell | None |
Plugins.Monitors.UVMeter
Description
An australian uv monitor for Xmobar
- uvConfig :: IO MConfig
- data UvInfo = UV {
- index :: String
- uvURL :: String
- getData :: IO String
- textToXMLDocument :: String -> Either ParseError [XML]
- formatUVRating :: Maybe Float -> Monitor String
- getUVRating :: String -> [XML] -> Maybe Float
- runUVMeter :: [String] -> Monitor String
- type AttrName = String
- type AttrValue = String
- data Attribute = Attribute (AttrName, AttrValue)
- data XML
- document :: Parser [XML]
- tag :: Parser XML
- xmlDecl :: Parser XML
- elementBody :: Parser XML
- endTag :: String -> Parser String
- text :: Parser XML
- attribute :: Parser Attribute
Documentation
uvURL :: String
getData :: IO String
textToXMLDocument :: String -> Either ParseError [XML]
formatUVRating :: Maybe Float -> Monitor String
getUVRating :: String -> [XML] -> Maybe Float
runUVMeter :: [String] -> Monitor String
type AttrName = String
XML Parsing code comes here. This is a very simple XML parser to just deal with the uvvalues.xml provided by ARPANSA. If you work on a new plugin which needs an XML parser perhaps consider using a real XML parser and refactor this plug-in to us it as well.
Note: This parser can not deal with short tags.
Kudos to: Charlie Harvey for his article about writing an XML Parser with Parsec.
type AttrValue = String
elementBody :: Parser XML