packages feed

lambdabot-reference-plugins 5.0.2.1 → 5.0.3

raw patch · 3 files changed

+12/−5 lines, 3 filesdep ~lambdabot-coredep ~utf8-string

Dependency ranges changed: lambdabot-core, utf8-string

Files

lambdabot-reference-plugins.cabal view
@@ -1,5 +1,5 @@ name:                   lambdabot-reference-plugins-version:                5.0.2.1+version:                5.0.3  license:                GPL license-file:           LICENSE@@ -67,14 +67,14 @@                         bytestring              >= 0.9,                         containers              >= 0.4,                         HTTP                    >= 4000,-                        lambdabot-core          >= 5.0.1 && < 5.1,+                        lambdabot-core          >= 5.0.3 && < 5.1,                         mtl                     >= 2,                         oeis                    >= 0.3.1,                         process                 >= 1.1,                         regex-tdfa              >= 1.1,                         split                   >= 0.2,                         tagsoup                 >= 0.12,-                        utf8-string             >= 0.3 && < 1+                        utf8-string             >= 0.3    if flag(network-uri)     build-depends: network-uri >= 2.6, network >= 2.6
src/Lambdabot/Plugin/Reference/Metar.hs view
@@ -25,7 +25,7 @@  addsUri :: String addsUri =-    "http://aviationweather.gov/adds/dataserver_current/httpparam"+    "http://www.aviationweather.gov/adds/dataserver_current/httpparam"  addsSrc :: String -> String addsSrc code = addsUri ++
src/Lambdabot/Plugin/Reference/Search.hs view
@@ -125,5 +125,12 @@ extractConversion :: String -> Maybe String extractConversion (parseTags -> tags) = listToMaybe [txt |     section <- sections (tagOpen ("h2"==) (anyAttr (\(name, value) -> name == "class" && value == "r"))) tags,-    txt <- [strip isSpace $ drop 1 $ dropWhile (/= '=') t | TagText t <- section],+    let txt = take 80 $ strip isSpace $ drop 1 $ dropWhile (/= '=') $ extractText section,     not (null txt)]++extractText :: [Tag String] -> String+extractText (TagText t : ts) = t ++ extractText ts+extractText (TagOpen "sup" _ : TagText t : TagClose "sup" : ts) = "^" ++ t ++ extractText ts+extractText (TagClose "h2" : _) = ""+extractText (_ : ts) = extractText ts+extractText _ = ""