{"id":13549198,"url":"https://github.com/mpratt/Embera","last_synced_at":"2025-04-02T22:31:31.327Z","repository":{"id":8501257,"uuid":"10110361","full_name":"mpratt/Embera","owner":"mpratt","description":"A Oembed consumer library, that gives you information about urls. It helps you replace urls to youtube or vimeo for example, with their html embed code. It has advanced features like offline support, responsive embeds and caching support.","archived":false,"fork":false,"pushed_at":"2025-01-04T06:08:19.000Z","size":1466,"stargazers_count":347,"open_issues_count":4,"forks_count":61,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-27T18:04:16.181Z","etag":null,"topics":["dailymotion","embed-videos","facebook","html-embeddable","instagram","oembed","php","twitter","vimeo","youtube"],"latest_commit_sha":null,"homepage":"","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/mpratt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":"FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"https://paypal.me/mtpratt"}},"created_at":"2013-05-16T20:56:09.000Z","updated_at":"2025-02-20T10:36:44.000Z","dependencies_parsed_at":"2023-02-12T04:33:28.614Z","dependency_job_id":"3f5a47b7-d281-488c-937a-b03f23481fff","html_url":"https://github.com/mpratt/Embera","commit_stats":{"total_commits":949,"total_committers":33,"mean_commits":"28.757575757575758","dds":"0.29083245521601686","last_synced_commit":"afa728339c6f078c803c9277a5054ca241b3c469"},"previous_names":[],"tags_count":74,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpratt%2FEmbera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpratt%2FEmbera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpratt%2FEmbera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpratt%2FEmbera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpratt","download_url":"https://codeload.github.com/mpratt/Embera/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246905105,"owners_count":20852812,"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":["dailymotion","embed-videos","facebook","html-embeddable","instagram","oembed","php","twitter","vimeo","youtube"],"created_at":"2024-08-01T12:01:19.287Z","updated_at":"2025-04-02T22:31:30.355Z","avatar_url":"https://github.com/mpratt.png","language":"PHP","readme":"# Embera - PHP Oembed consumer library\n\n\n[![Build Status](https://github.com/mpratt/Embera/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/mpratt/Embera/actions)\n[![Total Downloads](https://img.shields.io/packagist/dt/mpratt/embera.svg)](https://packagist.org/packages/mpratt/embera)\n[![Monthly Downloads](https://img.shields.io/packagist/dm/mpratt/embera)](https://packagist.org/packages/mpratt/embera)\n[![Latest Stable Version](https://img.shields.io/packagist/v/mpratt/embera.svg)](https://packagist.org/packages/mpratt/embera)\n\n[![Support via PayPal](https://cdn.rawgit.com/twolfson/paypal-github-button/1.0.0/dist/button.svg)](https://paypal.me/mtpratt)\n\nEmbera is an Oembed consumer library written in PHP.\nIt takes urls from a text and queries the matching service for information about the media and embeds the resulting html.\nIt supports **+150** sites, such as Youtube, Twitter, Livestream, Dailymotion, Instagram, Vimeo and [many many more](doc/02-providers.md).\n\n## Installation\n\nInstall the latest stable version with:\n\n```bash\n$ composer require mpratt/embera:~2.0\n```\n\n### Standalone Installation (without Composer)\n\nDownload the latest release or clone this repository and include the `Àutoloader.php` file inside the `Embera/src` directory.\n\n```php\nrequire '....../Autoloader.php';\n\nuse Embera\\Embera;\n\n$embera = new Embera();\n```\n\n## Requirements\n\n- PHP \u003e= 7.0 (It should work on 5.6)\n- Curl or allow_url_fopen should be enabled\n\n## Basic Usage\n\nThe most common or basic example is this one:\n\n```php\nuse Embera\\Embera;\n\n$embera = new Embera();\necho $embera-\u003eautoEmbed('Hi! Have you seen this video? https://www.youtube.com/watch?v=J---aiyznGQ Its the best!');\n```\n\nThe last example returns something like the following text:\n\n```html\nHi! Have you seen this video?\n\u003ciframe\n  width=\"459\"\n  height=\"344\"\n  src=\"https://www.youtube.com/embed/J---aiyznGQ?feature=oembed\"\n  frameborder=\"0\"\n  allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n  allowfullscreen\n\u003e\u003c/iframe\u003e\nIts the best!\n```\n\nYou can also inspect urls for their oembed data:\n\n```php\nuse Embera\\Embera;\n\n$embera = new Embera();\nprint_r($embera-\u003egetUrlData([\n    'https://vimeo.com/374131624',\n    'https://www.flickr.com/photos/bees/8597283706/in/photostream',\n]));\n```\n\nThat will return something like this\n\n```php\nArray\n(\n    [https://vimeo.com/374131624] =\u003e Array\n        (\n            [type] =\u003e video\n            [version] =\u003e 1.0\n            [provider_name] =\u003e Vimeo\n            [provider_url] =\u003e https://vimeo.com/\n            [title] =\u003e VACATION movie\n            [author_name] =\u003e Andrey Kasay\n            [author_url] =\u003e https://vimeo.com/andreykasay\n            [is_plus] =\u003e 0\n            [account_type] =\u003e basic\n            [html] =\u003e \u003ciframe src=\".......\"\u003e\u003c/iframe\u003e\n            [width] =\u003e 426\n            [height] =\u003e 240\n            [duration] =\u003e 146\n            [description] =\u003e Остросюжетное кино про жизнь\n            [thumbnail_url] =\u003e https://i.vimeocdn.com/video/832478725_295x166.jpg\n            [thumbnail_width] =\u003e 295\n            [thumbnail_height] =\u003e 166\n            [thumbnail_url_with_play_button] =\u003e https://i.vimeocdn.com/......Fcrawler_play.png\n            [upload_date] =\u003e 2019-11-19 06:27:37\n            [video_id] =\u003e 374131624\n            [uri] =\u003e /videos/374131624\n            [embera_using_fake_response] =\u003e 0\n            [embera_provider_name] =\u003e Vimeo\n        )\n    [https://www.flickr.com/photos/bees/8597283706/in/photostream] =\u003e Array\n        (\n            [type] =\u003e photo\n            [flickr_type] =\u003e photo\n            [title] =\u003e Durumu\n            [author_name] =\u003e ‮‭‬bees‬\n            [author_url] =\u003e https://www.flickr.com/photos/bees/\n            [width] =\u003e 1024\n            [height] =\u003e 723\n            [url] =\u003e https://live.staticflickr.com/8385/8597283706_7b51ea50b1_b.jpg\n            [web_page] =\u003e https://www.flickr.com/photos/bees/8597283706/\n            [thumbnail_url] =\u003e https://live.staticflickr.com/8385/8597283706_7b51ea50b1_q.jpg\n            [thumbnail_width] =\u003e 150\n            [thumbnail_height] =\u003e 150\n            [web_page_short_url] =\u003e https://flic.kr/p/e6HjVq\n            [license] =\u003e All Rights Reserved\n            [license_id] =\u003e 0\n            [html] =\u003e .........\n            [version] =\u003e 1.0\n            [cache_age] =\u003e 3600\n            [provider_name] =\u003e Flickr\n            [provider_url] =\u003e https://www.flickr.com/\n            [embera_using_fake_response] =\u003e 0\n            [embera_provider_name] =\u003e Flickr\n            [html_alternative] =\u003e ........\n        )\n)\n```\n\nThe response data depends on the provider, each of them returns information about the consulted\nmedia, however this library always tries to provide an embeddable `html` key that can be used to\nembed the information on a html document.\n\nThis library has fake responses / Offline support which is a way of getting the html embeddable code without the\nneed of querying the oembed provider. It also has caching support, provider collections, responsive\nembeds and many other features. You can find out more by reading the documentation below.\n\n## Documentation\n\n- [Usage/Configuration instructions](doc/01-usage.md)\n- [Supported providers](doc/02-providers.md)\n- [Using provider collections](doc/03-provider-collections.md)\n- [Using fake Responses](doc/04-fake-responses.md)\n- [Using responsive embeds](doc/05-responsive-embeds.md)\n- [Enabling cache](doc/06-caching.md)\n- [Advanced Usage](doc/07-advanced-usage.md)\n\n## Migrating from version \u003e= 1.9.x\n\nThe folder structure has changed, the library is now in the `src` folder and\nyou can find an autoloader there if you are not using composer.\n\nThe configuration array has changed in order to make it simpler.\nTake a look at the [Usage/Configuration instructions](doc/01-usage.md) to update it.\n\nThe other major change is that the `inspectUrlInfo()` method is now called `getUrlData()`.\nThe `HtmlFormatter` class does not exist anymore since the library allows now other type\nof templating.\n\nUpdating should be fairly easy, check the documentation.\n\n## Submitting bugs and feature requests\n\nBugs and feature request are tracked on [GitHub](https://github.com/mpratt/Embera/issues)\n\n## Author\n\nMichael Pratt - \u003cyo@michael-pratt.com\u003e - \u003chttp://www.michael-pratt.com\u003e\nSee also the list of [contributors](https://github.com/mpratt/Embera/contributors) which participated in this project.\n\nIf you like this library, it has been useful to you and want to support me, you can do it via paypal.\n\n[![Support via PayPal](https://cdn.rawgit.com/twolfson/paypal-github-button/1.0.0/dist/button.svg)](https://paypal.me/mtpratt)\n\n## License\n\nEmbera is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n","funding_links":["https://paypal.me/mtpratt"],"categories":["杂项","PHP","杂项 Miscellaneous","目录","Table of Contents","Configuration","Miscellaneous"],"sub_categories":["标记和CSS Markup and CSS","Markup and CSS","Miscellaneous"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpratt%2FEmbera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpratt%2FEmbera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpratt%2FEmbera/lists"}