wikipedia4epub (empty) → 0.0.1
raw patch · 4 files changed
+112/−0 lines, 4 filesdep +Cabaldep +HDBCdep +HDBC-sqlite3setup-changed
Dependencies added: Cabal, HDBC, HDBC-sqlite3, HTTP, base, bytestring, directory, epub, filepath, ghc, haskell98, network, regex-base, regex-posix, tagsoup, url, xml, zip-archive
Files
- LICENSE +27/−0
- Setup.hs +2/−0
- src/wiki4e-firefox-epub.hs +33/−0
- wikipedia4epub.cabal +50/−0
+ LICENSE view
@@ -0,0 +1,27 @@+Copyright (c) Radoslav Dorcik 2009++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions+are met:+1. Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.+2. Redistributions in binary form must reproduce the above copyright+ notice, this list of conditions and the following disclaimer in the+ documentation and/or other materials provided with the distribution.+3. Neither the name of the author nor the names of his contributors+ may be used to endorse or promote products derived from this software+ without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF+SUCH DAMAGE.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ src/wiki4e-firefox-epub.hs view
@@ -0,0 +1,33 @@+import Text.HTML.TagSoup+import System.Environment+import System.Directory+import System.FilePath+import Wikipedia4epub.Commands+import System.IO ++main = do+ name <- getProgName+ args <- getArgs+ case args of + [] -> firefox2epub "Wikipedia_Articles_From_Firefox"+ ['-':_] -> usageHelp name+ ['/':_] -> usageHelp name+ [xs] -> firefox2epub xs+ _ -> usageHelp name++usageHelp name = putStrLn $ "Usage: " ++ name ++ " [<Title Name of new e-book>]"++firefox2epub bookName = do+ xs <- wiki4e_listFirefoxURLs+ tmpDir <- getTemporaryDirectory+ let tmpDirFetch = tmpDir </> "wiki4e_fetch" + let tmpDirSanitize = tmpDir </> "wiki4e_sanitize"+ createDirectoryIfMissing True tmpDirFetch+ createDirectoryIfMissing True tmpDirSanitize+ putStrLn $ "Fetching "++show (length xs)++" Articles..."+ wiki4e_fetchArticles tmpDirFetch xs+ putStrLn "Sanitize Articles..."+ wiki4e_sanitizeArticles tmpDirFetch tmpDirSanitize+ putStrLn "Constructing EPUB..."+ wiki4e_createEpub bookName tmpDirSanitize+ putStrLn "Done."
+ wikipedia4epub.cabal view
@@ -0,0 +1,50 @@+Name: wikipedia4epub+Version: 0.0.1+License: BSD3+License-File: LICENSE+Homepage: http://rampa.sk/static/wikipedia4epub.html+Synopsis: Wikipedia EPUB E-Book construction from Firefox history.+Author: Radoslav Dorcik <radoslav.dorcik@gmail.com>+Maintainer: radoslav.dorcik@gmail.com+Description: + .+ Wikipedia EPUB E-Book construction from Firefox History.+ It dumps history and select only wikipedia articles, fetch+ them and strip thier content before put into EPUB book+ for E-Book readers.+ .+Category: Text+Stability: experimental+Build-Type: Simple+Cabal-Version: >= 1.6++Source-Repository head+ type: darcs+ location: http://patch-tag.com/r/dixiecko/wikipedia4epub+ +Library+ Build-Depends: ghc,+ base < 5,+ filepath,+ bytestring,+ haskell98,+ url,+ directory,+ epub,+ regex-posix,+ network,+ regex-base,+ HDBC-sqlite3,+ HDBC >= 2.1.1,+ tagsoup >= 0.8,+ HTTP, + zip-archive,+ xml,+ Cabal >= 1.5 && < 1.9+ Hs-Source-Dirs: src+ Extensions: CPP, PatternGuards+ Ghc-Options: -Wall -fno-warn-orphans++Executable wiki4e-firefox-epub+ Hs-Source-Dirs: src+ Main-Is: wiki4e-firefox-epub.hs