{"id":16547519,"url":"https://github.com/waiting-for-dev/follow","last_synced_at":"2026-04-20T07:05:02.274Z","repository":{"id":62435977,"uuid":"146020377","full_name":"waiting-for-dev/follow","owner":"waiting-for-dev","description":"Haskell library to follow content published on any subject.","archived":false,"fork":false,"pushed_at":"2018-10-17T13:18:34.000Z","size":205,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-02-27T16:58:39.364Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/waiting-for-dev.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","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":"2018-08-24T17:22:16.000Z","updated_at":"2019-09-03T14:54:59.000Z","dependencies_parsed_at":"2022-11-01T21:02:42.900Z","dependency_job_id":null,"html_url":"https://github.com/waiting-for-dev/follow","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/waiting-for-dev/follow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waiting-for-dev%2Ffollow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waiting-for-dev%2Ffollow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waiting-for-dev%2Ffollow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waiting-for-dev%2Ffollow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waiting-for-dev","download_url":"https://codeload.github.com/waiting-for-dev/follow/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waiting-for-dev%2Ffollow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32036803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-11T19:14:36.800Z","updated_at":"2026-04-20T07:05:02.254Z","avatar_url":"https://github.com/waiting-for-dev.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Follow\n\n`Follow` is a Haskell library to build recipes which allow you to\nfollow the content published about any subject you are interested.\n\nHere bellow you have a quick tutorial you can follow.  Just run the\nsnippets of code in the repl.\n\n```haskell\n:set -XOverloadedStrings\nimport Follow\nimport Data.Time (LocalTime)\nimport qualified Data.Text.IO as T (writeFile)\nimport Data.Yaml (decodeFileThrough)\n```\n\n## Subject\n\nA subject is just a bunch of information about what is being\nfollowed. It consists of a title, a description and a list of tags,\n\n```haskell\nhaskell =\n  Subject\n    { sTitle = \"Haskell\"\n    , sDescription = \"Some resources about Haskell\"\n    , sTags = [\"haskell\", \"programming\"]\n    }\n```\n\n## Directory\n\nA directory is just a subject and a list of entries.\n\nAn entry is an item meant to contain an URI with content relative to\nthe associated subject along with associated information.\n\n```haskell\nmanualDirectory =\n  Directory\n    { dSubject = haskell\n    , dEntries =\n        [ Entry\n            { eURI =\n                Just \"https://bartoszmilewski.com/2013/06/19/basics-of-haskell/\"\n            , eGUID = Just \"basics-of-haskell\"\n            , eTitle = Just \"Basics of Haskell\"\n            , eDescription = Just \"Introductory material for Haskell\"\n            , eAuthor = Just \"Bartosz Milewski\"\n            , ePublishDate = Just (read \"2013-06-19 14:14:00\" :: LocalTime)\n            }\n        ]\n    }\n```\n\n## Fetchers\n\nOf course, building list of entries by hand is not very\nuseful. Fetchers are functions which usually reach the outside world\nto return a list of entries and which can throw an error.\n\nAny fetcher can be used, but `Follow` tries to ship with common\nones. Right now there are two fetchers available:\n\n- [Feed](src/Follow/Fetchers/Feed.hs): Take entries from a RSS or Atom feed.\n- [Web Scraping](src/Follow/Fetchers/WebScraping.hs): Take entries\n  scraping the HTML of a web page.\n\nThe function `directoryFromFetched` can be used to glue a subject with\nsome fetched content:\n\n```haskell\nimport qualified Follow.Fetchers.Feed as Feed\n\ndirectory =\n  directoryFromFetched (Feed.fetch \"https://bartoszmilewski.com/feed/\") haskell\n```\n\n## Middlewares\n\nFetched content may need some further processing in order to fit what\nis actually desired. A middleware is a function which transforms a\ndirectory into another directory, allowing us to do any kind of\ntransformation.\n\nThe aim of `Follow` is to provide some common middlewares. For now,\nthere are these ones:\n\n- [Filter](src/Follow/Middlewares/Filter.hs): Filter entries according\n  some predicate.\n- [Sort](src/Follow/Middlewares/Sort.hs): Sort entries.\n- [Decode](src/Follow/Middlewares/Decode.hs): Decodes entries from\n  UTF8 or other encodings.\n\n```haskell\nimport qualified Follow.Middlewares.Sort as Sort\n\nsortedDirectory =\n  Sort.apply (Sort.byGetter eTitle) \u003c$\u003e directory\n```\n\n## Digesters\n\nOnce you have your distillate content, you need some way to consume\nit. A `Digester` is a function which transforms a directory into\nanything that can be consumed by an end user.\n\nAs before, `Follow` aims to provide useful ones out of the box. Right\nnow the following are available:\n\n- [Simple Text](src/Follow/Digesters/SimpleText.hs): Simple textual\n  representation of the directory.\n- [Pocket](src/Follow/Digesters/Pocket.hs): Send fetched links to\n  [Pocket](https://getpocket.com).\n\n```haskell\nimport qualified Follow.Digesters.SimpleText as SimpleText\n\ncontent = SimpleText.digest \u003c$\u003e sortedDirectory\n```\n\nNow, for example, you are ready to save the content to a file:\n\n```haskell\ncontent \u003e\u003e= T.writeFile \"/your/path/haskell.txt\"\n```\n\n## Recipes: Combining sources and middlewares\n\nContent is not limited to be fetched from a single source. Instead, a\ndirectory can be built merging the entries fetched from different\nsources. Also, the stack of middlewares to be applied to each source can be\ngiven in a single shot.\n\nThis whole process specification is called a `Recipe`, and it contains\nall the information needed to follow a subject.\n\nTo build the recipe you need to provide three fields:\n\n- The subject being followed.\n- A list of two field tuples where:\n  - First field is some fetched content.\n  - Second field is a list of middlewares to apply to the fetched content in the first field.\n- A list of middlewares to apply to the directory resulted after applying the list of fetched/middlewares.\n\n```haskell\nhaskellRecipe =\n  Recipe\n    { rSubject = haskell\n    , rSteps =\n        [ ( Feed.fetch \"https://bartoszmilewski.com/feed/\"\n          , [Sort.apply (Sort.byGetter eTitle)])\n        , (Feed.fetch \"https://planet.haskell.org/rss20.xml\", [])\n        ]\n    , rMiddlewares = []\n    }\n```\n\nYou can combine the function `directoryFromRecipe` and some digester\nto quickly consume a recipe:\n\n```haskell\nSimpleText.digest \u003c$\u003e directoryFromRecipe haskellRecipe\n```\n\n## Collecting recipes\n\nOne nice thing in Follow is that you don't need to create the recipes\nprogrammatically each time you need them. Instead, you can store them\nin a [YAML](https://en.wikipedia.org/wiki/YAML) file and just parse\nthem when you need.\n\nFor example, the previous recipe can be represented in a file\n`recipe.yml` as the following:\n\n```yaml\nsubject:\n  title: Haskell\n  description: Some resources about Haskell\n  tags: [haskell, programming]\nsteps:\n  -\n    - type: feed\n      options:\n        url: \"https://bartoszmilewski.com/feed/\"\n    -\n      - type: sort\n        options:\n          function:\n            type: by_field\n            options:\n              field: title\nmiddlewares: []\n```\n\nYou can use now decode functions in\n[`Data.Yaml`](https://hackage.haskell.org/package/yaml) to get the\nrecipe back:\n\n```haskell\nrecipe' \u003c- decodeFileThrow \"/your/path/recipe.yml\" :: IO (Recipe IO)\ndirectory' = directoryFromRecipe recipe'\n```\n\nLook at [`src/Follow/Parser.hs`](src/Follow/Parser.hs) for details about\nencoding each kind of fetcher and middleware.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at\nhttps://github.com/waiting-for-dev/follow. This project is\nintended to be a safe, welcoming space for collaboration, and\ncontributors are expected to adhere to the [Contributor\nCovenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe package is available as open source under the terms of the [GNU\nLGPLv3 License](http://opensource.org/licenses/LGPL-3.0).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaiting-for-dev%2Ffollow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaiting-for-dev%2Ffollow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaiting-for-dev%2Ffollow/lists"}