Support amp-playbuzz component
Playbuzz Content can be embedded by using code snippet (including Script element, that can reside in the head element and div with class="pb_feed").
Issue
Playbuzz items being embedded with code snippet are not being transformed to amp-playbuzz component.
Steps required to reproduce Issue
- Install amp-wp Plugin
- Create a new WP post
- Embed a Playbuzz item via code snippet (see below code snippet for example)
- Published AMP post via amp-wp plugin
- The new AMP post doesn't contain Playbuzz embedded item
Suggested solution
Support Playbuzz out of the box
- Playbuzz embed handler should be part of the default embed handlers.
- Playbuzz embed handler should support amp-playbuzz attributes
Instructions on how to transform code snippet to amp component
Code snippet
<script type="text/javascript" src="//cdn.playbuzz.com/widget/feed.js"></script>
<div class="pb_feed" data-item="3103bc0a-4633-43e6-8ca9-ae005551924d" data-game="HistoryUK/10-classic-christmas-movies" data-game-info="false" data-shares="true" data-comments="false"></div>
Should be converted to
<amp-playbuzz src="https://www.playbuzz.com/HistoryUK/10-classic-christmas-movies" data-item="a6aa5a14-8888-4618-b2e3-fe6a30d8c51b" height="500" data-item-info="false" data-share-buttons="true" data-comments="false"></amp-playbuzz>
Attributes to convert
data-item ( only if code snippet contains data-item )
- Take the value from the code snippet attribute data-item.
src ( only if code snippet contains data-game )
- Take the value from the code snippet attribute data-game and prefixing with www.playbuzz.com Example:
Code snippet
data-game="HistoryUK/10-classic-christmas-movies"
Should be converted to
src="//www.playbuzz.com/HistoryUK/10-classic-christmas-movies"
height
- Value should be 500.
data-item-info ( only if code snippet contains data-game-info )
- Take the value from the code snippet attribute data-game-info.
data-share-buttons ( only if code snippet contains data-shares )
- Take the value from the code snippet attribute data-shares.
data-comments ( only if code snippet contains data-comments )
- Take the value from the code snippet attribute data-comments.
It looks like with the merge of #664 this can be closed?
Yep.