{"id":25872099,"url":"https://github.com/aktsk/luna","last_synced_at":"2025-10-18T16:28:22.580Z","repository":{"id":57530649,"uuid":"60774795","full_name":"aktsk/luna","owner":"aktsk","description":"Utility library for Elixir","archived":false,"fork":false,"pushed_at":"2016-10-13T13:36:25.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":40,"default_branch":"master","last_synced_at":"2025-10-14T17:22:50.342Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aktsk.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":"2016-06-09T12:56:45.000Z","updated_at":"2016-06-09T23:52:19.000Z","dependencies_parsed_at":"2022-09-14T00:11:26.335Z","dependency_job_id":null,"html_url":"https://github.com/aktsk/luna","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/aktsk/luna","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aktsk%2Fluna","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aktsk%2Fluna/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aktsk%2Fluna/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aktsk%2Fluna/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aktsk","download_url":"https://codeload.github.com/aktsk/luna/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aktsk%2Fluna/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279564681,"owners_count":26191824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-18T02:00:06.492Z","response_time":62,"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":"2025-03-02T07:37:48.746Z","updated_at":"2025-10-18T16:28:22.526Z","avatar_url":"https://github.com/aktsk.png","language":"Elixir","readme":"Luna\n====\n\n[![Build Status](https://travis-ci.org/aktsk/luna.svg?branch=master)](https://travis-ci.org/aktsk/luna)\n[![Hex.pm version](https://img.shields.io/hexpm/v/luna.svg)](https://hex.pm/packages/luna)\n[![Hex.pm](https://img.shields.io/hexpm/l/luna.svg)](https://github.com/aktsk/luna/blob/master/LICENSE)\n\nUtility library for Elixir.\n\n\n## Installation\n\nAdd Luna to `mix.exs` dependencies:\n\n\n## Luna.SiteMap\n\nUsage example:\n\n```\ndefmodule MyApp.SiteMap do\n  alias MyApp.{Article, Repo, User}\n\n  def refresh() do\n    now = DateTime.utc_now()\n          |\u003e DateTime.to_iso8601()\n    url_elements = [url_elem(\"/top\", now, %{changefreq: :hourly, priority: 1.0})]\n                   ++ (Repo.all(User) |\u003e Enum.map(\u0026user_url_element/1))\n                   ++ (Repo.all(Article) |\u003e Enum.map(\u0026article_url_element/1))\n    Application.app_dir(:my_app, \"priv/static\")\n    |\u003e Path.join(\"site_map.xml.gz\")\n    |\u003e Luna.SiteMap.write_file(url_elements)\n  end\n\n  defp url_elem(path, lastmod, opts \\\\ %{}) do\n    host = Application.fetch_env!(:my_app, MyApp.Endpoint)[:url][:host]\n    uri = %URI{scheme: \"https\", host: host, path: path}\n          |\u003e URI.to_string()\n    Luna.SiteMap.url_element(uri, lastmod, opts)\n  end\n\n  defp user_url_element(user) do\n    url_elem(Path.join(\"/users\", to_string(user.id)), Ecto.DateTime.to_iso8601(user.updated_at))\n  end\n\n  defp article_url_element(article) do\n    url_elem(Path.join(\"/articles\", to_string(article.id)), Ecto.DateTime.to_iso8601(article.updated_at))\n  end\nend\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faktsk%2Fluna","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faktsk%2Fluna","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faktsk%2Fluna/lists"}