{"id":15077833,"url":"https://github.com/mpalourdio/twitterwidgetbundle","last_synced_at":"2025-03-16T14:45:14.807Z","repository":{"id":21435738,"uuid":"24753963","full_name":"mpalourdio/TwitterWidgetBundle","owner":"mpalourdio","description":"Twig extension to easily display twitter embedded timelines widgets","archived":false,"fork":false,"pushed_at":"2018-12-29T09:12:49.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-23T05:49:29.970Z","etag":null,"topics":["bundle","symfony","symfony-bundle","symfony3","symfony3-bundle","timeline-widget","twig","twig-extension","twitter"],"latest_commit_sha":null,"homepage":"https://github.com/mpalourdio/TwitterWidgetBundle","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/mpalourdio.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":"2014-10-03T09:59:36.000Z","updated_at":"2018-12-29T09:12:50.000Z","dependencies_parsed_at":"2022-08-23T13:50:37.896Z","dependency_job_id":null,"html_url":"https://github.com/mpalourdio/TwitterWidgetBundle","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpalourdio%2FTwitterWidgetBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpalourdio%2FTwitterWidgetBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpalourdio%2FTwitterWidgetBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpalourdio%2FTwitterWidgetBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpalourdio","download_url":"https://codeload.github.com/mpalourdio/TwitterWidgetBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243885891,"owners_count":20363644,"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":["bundle","symfony","symfony-bundle","symfony3","symfony3-bundle","timeline-widget","twig","twig-extension","twitter"],"created_at":"2024-09-25T04:32:43.290Z","updated_at":"2025-03-16T14:45:13.179Z","avatar_url":"https://github.com/mpalourdio.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/mpalourdio/TwitterWidgetBundle.svg?branch=master)](https://travis-ci.org/mpalourdio/TwitterWidgetBundle)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/mpalourdio/TwitterWidgetBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/mpalourdio/TwitterWidgetBundle/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/mpalourdio/TwitterWidgetBundle/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/mpalourdio/TwitterWidgetBundle/?branch=master)\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/55cdf6c4-bdcb-423a-bd3e-20dda3f8ad13/mini.png)](https://insight.sensiolabs.com/projects/55cdf6c4-bdcb-423a-bd3e-20dda3f8ad13)\n[![PHP 7.0+][ico-engine]][lang]\n[![MIT Licensed][ico-license]][license]\n\n[ico-engine]: http://img.shields.io/badge/php-7.0+-8892BF.svg\n[lang]: http://php.net\n[ico-license]: http://img.shields.io/packagist/l/adlawson/veval.svg\n[license]: LICENSE\n\nTwitterWidgetBundle\n===================\nTwig extension to easily display twitter embedded timelines widgets in Symfony project. Based on this library : https://github.com/mpalourdio/TwitterWidgets\n\nRequirements\n============\nPHP 7.0+ - Only Composer installation supported\n\nInstallation\n============\nRun the command below to install via Composer\n\n```shell\ncomposer require mpalourdio/twitter-widget-bundle\n```\n\nAdd ```new TwitterWidgetBundle\\TwitterWidgetBundle()``` to your **AppKernel.php**\n\nUsage\n=====\n- 1) Create a timeline widget here : https://twitter.com/settings/widgets/new\n- 2) In the javascript generated code, get the URL and the data-widget-id (minimum information required)\n- 3) Finally, in a twig template, use as following: \n\n```php\n{{ \n  tw({\n         'dataWidgetId' : '1245687955000', =\u003e the id must be a string (quotes), because of long integer converted to float\n         'href'         : 'https://twitter.com/NickName',\n         'hrefText'     : 'Here type a title'\n     },\n     true/false\n}}\n```\n\nAll the following options are handled : https://dev.twitter.com/web/embedded-timelines#options\n\nTheir PHP equivalent as array keys to use in the twig function are  :\n\n```php\n'class'           =\u003e 'A css class, by default it will be twitter-timeline',\n'href'            =\u003e 'The link to the timeline',\n'hrefText'        =\u003e 'A title for your timeline to display',\n'dataWidgetId'    =\u003e 'Your data widget ID : must be a string (!)',\n'dataTheme'       =\u003e 'ex: dark',\n'dataLinkColor'   =\u003e 'ex: #cc0000',\n'width'           =\u003e 300 (integer),\n'height'          =\u003e 400 (integer),\n'dataChrome'      =\u003e 'noheader nofooter noborders noscrollbar transparent', =\u003e a string with options separated by a single space\n'dataBorderColor' =\u003e 'border color used by the widget',\n'language'        =\u003e 'The widget language detected from the page, based on the HTML lang attribute of your content. You can also set the HTML lang attribute on the embed code itself.',\n'dataTweetLimit'  =\u003e 20,\n'dataRelated'     =\u003e 'benward,endform',\n'dataAriaPolite'  =\u003e 'polite or assertive',\n```\n\nYou can give an instance of ```TwitterWidgets\\Options\\WidgetOptions``` instead of an array (or any implementation of ```TwitterWidgets\\Timeline\\WidgetOptionsInterface```).\n\n```php\n$options = new TwitterWidgets\\Options\\WidgetOptions();\n$options-\u003esetDataWidgetId('1245687955000');\n$options-\u003esetHref('https://twitter.com/NickName');\n$options-\u003esetHrefText('Here type a title');\n\n{{ tw(options) }}\n```\n\nThe function second parameter is a boolean (true by default), that indicates if you must render the javascript code for your widget. If you have more that one widget on your page,\nuse the ```OneTimeJs``` extension to only add once the javascript code, just before your ```\u003c/body\u003e```. This will avoid some overhead. See https://dev.twitter.com/web/javascript/loading\n\n```php\n{% block javascripts %}\n        \u003cscript\u003e{{ twJs() }}\u003c/script\u003e\n{% endblock %}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpalourdio%2Ftwitterwidgetbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpalourdio%2Ftwitterwidgetbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpalourdio%2Ftwitterwidgetbundle/lists"}