psibi / download

High level download interface for Haskell
https://www.stackage.org/package/download
Other
10 stars 3 forks source link

download

Build Status

Download web content as strict bytestring, strings, HTML tags, XML, RSS or Atom feeds or JSON, via HTTP, FTP or file protocols, using a URL interface.

Using the library:

Importing the library:

import Network.Download

Loading a webpage as a ByteString:

doc  <- openURI "http://google.com"

Loading from a file:

doc  <- openURI "file:///tmp/A.hs"

Loading a HTML page as a list of tags:

tags <- openAsTags "http://google.com"

Loading a HTML page as XML:

tags <- openAsXML "http://google.com"

Loading an RSS or Atom feed:

feed <- openAsFeed "http://google.com"

These data types can the be processed further with the XML, Feed and TagSoup libraries.