Permalink
Browse files

Applied patch from N. Ohkawa. Thanks man!

  • Loading branch information...
1 parent f74cdfa commit 355f333894db96db422429c79707db0a7e9071de @elginer committed Nov 14, 2010
Showing with 10 additions and 8 deletions.
  1. +2 −0 .gitignore
  2. +3 −3 Network/Shpider/Forms.hs
  3. +2 −2 Network/Shpider/Links.hs
  4. +1 −1 Network/Shpider/State.hs
  5. +2 −2 shpider.cabal
View
@@ -0,0 +1,2 @@
+dist/
+*.swp
@@ -56,17 +56,17 @@ mkForm a m ps =
}
-- | Gets all forms from a list of tags.
-gatherForms :: [ Tag ] -> [ Form ]
+gatherForms :: [ Tag String ] -> [ Form ]
gatherForms =
tParse allForms
-- | The `TagParser` which parses all forms.
-allForms :: TagParser [ Form ]
+allForms :: TagParser String [ Form ]
allForms = do
fs <- allWholeTags "form"
return $ mapMaybe toForm fs
-toForm :: WholeTag -> Maybe Form
+toForm :: WholeTag String -> Maybe Form
toForm ( TagOpen _ attrs , innerTags , _ ) = do
m <- methodLookup attrs
a <- attrLookup "action" attrs
@@ -11,12 +11,12 @@ import Text.HTML.TagSoup.Parsec
import Network.Shpider.TextUtils
-- | Parse all links from a list of tags.
-gatherLinks :: [ Tag ] -> [ Link ]
+gatherLinks :: [ Tag String ] -> [ Link ]
gatherLinks =
tParse allLinks
-- | The parser responsible for getting all the links.
-allLinks :: TagParser [ Link ]
+allLinks :: TagParser String [ Link ]
allLinks = do
ls <- allWholeTags "a"
return $ toLinks ls
@@ -65,7 +65,7 @@ initialSt =
data Page =
Page { links :: [ Link ]
, forms :: [ Form ]
- , tags :: [ Tag ]
+ , tags :: [ Tag String ]
, source :: String
, addr :: String
}
View
@@ -1,5 +1,5 @@
Name: shpider
-Version: 0.0.7
+Version: 0.1.0
Synopsis: Web automation library in Haskell.
Description:
Shpider is a web automation library for Haskell. It allows you to quickly write crawlers, and for simple cases ( like following links ) even without reading the page source.
@@ -23,7 +23,7 @@ License: BSD3
License-file: LICENSE
Author: Johnny Morrice
Maintainer: Johnny Morrice <spoon@killersmurf.com>
-Homepage: http://www.killersmurf.com/projects/shpider
+Homepage: http://github.com/elginer/shpider
Build-type: Configure
Cabal-version: >= 1.2.0
Extra-source-files: LICENSE.CURL, configure, configure.ac, curl.buildinfo.in

0 comments on commit 355f333

Please sign in to comment.