Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load attachment thumbnail to template #166

Open
wants to merge 2 commits into
base: gh-pages
Choose a base branch
from

Conversation

vojtasvoboda
Copy link

With this tiny change, you can use RSS channel to load YouTube videos without API and API KEY. After that you are able to load video thumbnail in template like that:

<a href="{{=it.link}}" target="_blank">
    <img src="{{=it.attachment_thumbnail}}" alt=""{{=it.title}}>
</a>

YouTube RSS channel link is in that format: https://www.youtube.com/feeds/videos.xml?channel_id=UCsFctXdFnbeoKpLefdEloEQ

So JS will be:

$('.youtube-feed').socialfeed({
    rss: {
        urls: ['https://www.youtube.com/feeds/videos.xml?channel_id=UCkhimgIt9ib6NXkIjHfVnVA'],
        limit: 3
    },
    length: 200,
    show_media: true,
    template_html:
        '<a href="{{=it.link}}" target="_blank"> \
            <img src="{{=it.attachment_thumbnail}}"> \
        </a>'
});

This was referenced Mar 21, 2016
@vojtasvoboda
Copy link
Author

Freshly updated from master (gh-pages) branch.

@vojtasvoboda
Copy link
Author

Hello? Anybody there? :-)

@martijngastkemper
Copy link
Collaborator

YouTube specific code is not allowed in the general RSS option. You have to add YouTube as a separate social network. Like proposed in #160.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants