{"id":21191719,"url":"https://github.com/indieweb/rel-me","last_synced_at":"2025-07-10T03:31:01.169Z","repository":{"id":12960066,"uuid":"15638394","full_name":"indieweb/rel-me","owner":"indieweb","description":"A set of PHP functions for discovering, consuming and verifying the rel-me microformat.","archived":false,"fork":false,"pushed_at":"2022-10-08T21:07:09.000Z","size":35,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-10-29T19:01:57.513Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/indieweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-04T19:40:39.000Z","updated_at":"2024-09-29T17:32:48.000Z","dependencies_parsed_at":"2022-09-10T08:11:09.011Z","dependency_job_id":null,"html_url":"https://github.com/indieweb/rel-me","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indieweb%2Frel-me","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indieweb%2Frel-me/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indieweb%2Frel-me/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indieweb%2Frel-me/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indieweb","download_url":"https://codeload.github.com/indieweb/rel-me/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225615187,"owners_count":17496945,"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","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-11-20T19:04:39.357Z","updated_at":"2024-11-20T19:04:40.056Z","avatar_url":"https://github.com/indieweb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rel-me\n\nA set of PHP functions for discovering, consuming and verifying the [rel-me](https://microformats.org/wiki/rel-me) microformat. This is mainly useful for implementing [RelMeAuth](https://indieweb.org/relmeauth).\n\n![Build Status](https://github.com/indieweb/rel-me/actions/workflows/main.yml/badge.svg)\n\n## Usage\n\nInstall using [Composer](https://getcomposer.org) with `./composer.phar require indieweb/rel-me:dev-master`\n\n### Resolve and test a profile URL\n\n```php\n\u003c?php\n\n// Register the composer autoloader (assumed in future code samples.)\nrequire 'vendor/autoload.php';\n\n// This is a profile URL a user has given you, or you have parsed from a page somewhere.\n$givenProfileUrl = 'http://waterpigs.co.uk';\n\nlist($resolvedProfileUrl, $isSecure, $redirectChain) = IndieWeb\\relMeDocumentUrl($givenProfileUrl);\n\nif ($isSecure) {\n\t// $resolvedProfileUrl is the final resolved profile URL derived from the given one.\n} else {\n\techo 'Your profile URL redirected insecurely (changed protocols)';\n\t// Here you might use the $redirectChain (list of URLs) to present a more useful error message.\n}\n```\n\n### Find all `rel=me` links on a page\n\n```php\n// This should be derived and checked using relMeDocumentUrl().\n$resolvedProfileUrl = 'http://waterpigs.co.uk';\n\n$relMeLinks = IndieWeb\\relMeLinks($resolvedProfileUrl);\n```\n\n### Test whether or not a backlinking `rel=me` URL can be securely considered to link\n\n```php\n// A rel=me link from a silo profile page.\n$inboundRelMeUrl = 'http://t.co/qhZqdUcTbQ';\n// The derived profile document URL to test for matches of.\n$meUrl = 'http://waterpigs.co.uk';\n\nlist($matches, $secure, $redirectChain) = IndieWeb\\backlinkingRelMeUrlMatches($inboundRelMeUrl, $meUrl);\n\nif ($matches) {\n\tif ($secure) {\n\t\techo \"{$inboundRelMeUrl} is a secure, valid link to {$meUrl}\";\n\t} else {\n\t\techo \"{$inboundRelMeUrl} isn’t a secure link to {$meUrl} because it redirects insecurely (changes protocols)\";\n\t\t// Here you might use the $redirectChain (list of URLs) to present a more useful error message.\n\t}\n} else {\n\techo \"None of that silo backlink’s redirect chain match {$meUrl}\";\n}\n```\n\n### Utility Functions\n\n* `string $url = IndieWeb\\unparseUrl(array $parsedUrl)` takes the output of core `parse_url()` and makes it into a URL again\n* `string $url = IndieWeb\\normaliseUrl($url)` normalises a URL by parsing, then unparsing it\n* `list(string $body, array $headers, array $info) = IndieWeb\\httpGet($url)` performs a basic HTTP GET on a URL\n* `string $nextUrl | null = IndieWeb\\followOneRedirect($url)` fetches a URL and returns the redirect URL if it’s a redirect, else `null`\n* `bool $match = IndieWeb\\urlsMatchOtherThanScheme($url1, $url2)` compares two URLs and returns whether or not they are the same, ignoring differences in their scheme\n\n## Testing\n\nRun the test suite with `./vendor/bin/phpunit`\n\nThere’s also an experimental HTML+microformats test suite which can be run with  `./tests/html-test-runner.php`\n\n## Version History\n\n### 0.1.1 2022-10-08\n* Update dependencies, including php-mf2 v0.5.0\n* Update CI to Github Actions\n\n### 0.1.0 2014-01-04\n* Initial extraction from indiewebify.me, conversion into a composer package\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findieweb%2Frel-me","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findieweb%2Frel-me","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findieweb%2Frel-me/lists"}