{"id":16340256,"url":"https://github.com/robbinch/zim-parser","last_synced_at":"2026-01-21T09:02:23.912Z","repository":{"id":56883405,"uuid":"43957546","full_name":"robbinch/zim-parser","owner":"robbinch","description":"Haskell library for parsing ZIM files","archived":false,"fork":false,"pushed_at":"2018-09-08T00:36:49.000Z","size":1441,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-08T19:21:31.001Z","etag":null,"topics":["haskell-library","wikipedia","zim","zim-files"],"latest_commit_sha":null,"homepage":null,"language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robbinch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-09T13:40:45.000Z","updated_at":"2018-09-08T00:36:50.000Z","dependencies_parsed_at":"2022-08-20T23:10:47.839Z","dependency_job_id":null,"html_url":"https://github.com/robbinch/zim-parser","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/robbinch/zim-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robbinch%2Fzim-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robbinch%2Fzim-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robbinch%2Fzim-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robbinch%2Fzim-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robbinch","download_url":"https://codeload.github.com/robbinch/zim-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robbinch%2Fzim-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28630938,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["haskell-library","wikipedia","zim","zim-files"],"created_at":"2024-10-10T23:56:20.280Z","updated_at":"2026-01-21T09:02:23.869Z","avatar_url":"https://github.com/robbinch.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zim-parser: Haskell library for parsing ZIM files\n\nThis is a library for parsing ZIM (http://openzim.org) files.\nZIM files contain offline web content (eg, Wikipedia) which\ncan be browsed locally without an Internet connection.\n\nZIM files of Wikimedia Foundation (Wikipedia, Wikibooks, etc) can be\nfound at http://ftpmirror.your.org/pub/kiwix/zim.\n\nBelow is a full example of a Scotty web server that serves a ZIM file\n(specified on command line) on localhost port 3000:\n```haskell\n{-# LANGUAGE OverloadedStrings #-}\n\nimport Control.Monad.IO.Class (liftIO)\nimport Data.Text.Lazy (toStrict, fromStrict)\nimport Data.Text.Encoding (decodeUtf8, encodeUtf8)\nimport System.Environment (getArgs)\nimport Network.HTTP.Types.Status (status404)\nimport Web.Scotty\nimport Codec.Archive.Zim.Parser (getMainPageUrl, getContent, Url(..))\n\nmain :: IO ()\nmain = do\n    [fp] \u003c- getArgs\n    scotty 3000 $ do\n      get \"/\" (redirectToZimMainPage fp)\n      get (regex \"^/(./.*)$\") (serveZimUrl fp)\n      notFound $ text \"Invalid URL!\"\n\nredirectToZimMainPage :: FilePath -\u003e ActionM ()\nredirectToZimMainPage fp = do\n    res \u003c- liftIO $ getMainPageUrl fp\n    case res of\n      Nothing -\u003e do\n        status status404\n        text \"This ZIM file has no main page specified!\"\n      Just (Url url) -\u003e redirect . fromStrict $ decodeUtf8 url\n\nserveZimUrl :: FilePath -\u003e ActionM ()\nserveZimUrl fp = do\n    url \u003c- (encodeUtf8 . toStrict) \u003c$\u003e param \"1\"\n    res \u003c- liftIO $ fp `getContent` Url url\n    case res of\n      Nothing -\u003e do\n        liftIO . putStrLn $ \"Invalid URL: \" ++ show url\n        status status404\n        text $ \"Invalid URL!\"\n      Just (mimeType, content) -\u003e do\n        liftIO . putStrLn $ \"Serving: \" ++ show url\n        setHeader \"Content-Type\" (fromStrict $ decodeUtf8 mimeType)\n        raw content\n\n```\n\nFeedback and contributions are welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobbinch%2Fzim-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobbinch%2Fzim-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobbinch%2Fzim-parser/lists"}