{"id":16771510,"url":"https://github.com/trntv/sitemaped","last_synced_at":"2025-07-27T20:34:19.685Z","repository":{"id":45145626,"uuid":"131303725","full_name":"trntv/sitemaped","owner":"trntv","description":null,"archived":false,"fork":false,"pushed_at":"2022-01-05T11:53:55.000Z","size":32,"stargazers_count":2,"open_issues_count":2,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-11T12:45:25.101Z","etag":null,"topics":["php","sitemap","sitemap-builder","sitemap-generator"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/trntv.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":"2018-04-27T14:00:13.000Z","updated_at":"2020-05-29T01:07:09.000Z","dependencies_parsed_at":"2022-08-30T09:32:00.682Z","dependency_job_id":null,"html_url":"https://github.com/trntv/sitemaped","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/trntv/sitemaped","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trntv%2Fsitemaped","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trntv%2Fsitemaped/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trntv%2Fsitemaped/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trntv%2Fsitemaped/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trntv","download_url":"https://codeload.github.com/trntv/sitemaped/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trntv%2Fsitemaped/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267419157,"owners_count":24084112,"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-07-27T02:00:11.917Z","response_time":82,"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":["php","sitemap","sitemap-builder","sitemap-generator"],"created_at":"2024-10-13T06:28:19.259Z","updated_at":"2025-07-27T20:34:19.634Z","avatar_url":"https://github.com/trntv.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Sitemap abstraction library\n--- \n1. Add urls one-by-one\n    ```php\n    $urlset = new Urlset($links);\n    \n    foreach(range('a', 'z') as $letter) {\n             $url = new Url(\n                 'https://vocabula.ry/'.$letter,\n                 new \\DateTime('2017-01-01 00:00:01'),\n                 Url::CHANGEFREQ_MONTHLY,\n                 0.8\n             );\n             \n             $url-\u003eaddImage(new Image('https://test.com/image/'.$i));\n             $url-\u003eaddVideo(new Video('https://test.com/video/'.$i, 'Title '.$i, 'Description '.$i));\n             $url-\u003eaddNews(new News('Awesome news '.$i, '2018-01-01', 'Awesome news name '.$i, 'ru-RU'));\n             \n             $urlset-\u003eaddUrl($url);\n         }\n     \n    \n    $sitemap = new Sitemap($urlset);\n    \n    $sitemap-\u003etoXmlString();\n    $sitemap-\u003etoTxtString();\n    $sitemap-\u003ewrite(__DIR__ . '/sitemap.xml');\n    $sitemap-\u003ewrite(__DIR__ . '/sitemap.txt', Sitemap::FORMAT_TXT);\n    ```\n\n2. Using links generator\n    ```php\n    $links = function() {\n         foreach(range('a', 'z') as $letter) {\n             $url = new Url(\n                 'https://vocabula.ry/'.$letter,\n                 new \\DateTime('2017-01-01 00:00:01'),\n                 Url::CHANGEFREQ_MONTHLY,\n                 0.8\n             );\n             \n             $url-\u003eaddImage(new Image('https://test.com/image/'.$i));\n             $url-\u003eaddVideo(new Video('https://test.com/video/'.$i, 'Title '.$i, 'Description '.$i));\n             $url-\u003eaddNews(new News('Awesome news '.$i, '2018-01-01', 'Awesome news name '.$i, 'ru-RU'));\n             \n             yield $url;\n         }\n    }\n     \n    $urlset = new Urlset($links);\n    $sitemap = new Sitemap($urlset);\n    \n    $sitemap-\u003etoXmlString();\n    $sitemap-\u003etoTxtString();\n    $sitemap-\u003ewrite(__DIR__ . '/sitemap.xml');\n    $sitemap-\u003ewrite(__DIR__ . '/sitemap.txt', Sitemap::FORMAT_TXT);\n    ```\n3. Sitemap index\n    ```php\n    $index = new Sitemapindex();\n    $sitemap = new Sitemap($index);\n    \n    foreach (range(1, 2) as $i) {\n        $sitemap = new SitemapindexSitemap(\n            'http://test.com/'.$i,\n           '-1 year'\n        );\n        $index-\u003eaddSitemap($sitemap);\n    }\n\n    $content = $sitemap-\u003etoXmlString();\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrntv%2Fsitemaped","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrntv%2Fsitemaped","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrntv%2Fsitemaped/lists"}