Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • David Zweben 268 posts 754 karma points
    Aug 26, 2015 @ 17:08
    David Zweben
    0

    Feature request: Sample Razor code for direct API access

    Hi,

    I'm looking to set up a page that will display a custom-formatted version of my full YouTube channel, with all of the videos listed automatically. This package looks like it does most of the work needed for this, but it just requires videos to be picked manually before output.

    It would be great if the package also came with some sample Razor code to show how the YouTube API can be accessed directly from a Marco or Partial View, without requiring anything to be chosen from a property editor first.

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Sep 01, 2015 @ 10:54
    Warren Buckley
    1

    Hello David
    You should be able to deconstruct the C# code in the project on GitHub to be create your own method for fetching all of your videos in a channel to be printed out in a Razor view directly.

    https://github.com/warrenbuckley/YouTube-Umbraco/blob/master/YouTube/YouTubeHelper.cs

    This is just the Google C# library for YouTube so either use their docs to help build up the request you want to fetch the videos you would like. The sample on their site shows how to loop over a paged request with a while loop.

    Unfortunately I do not have the time to implement this myself for you, but gladly look forward to a pull request you may add this so others can benefit from this.

    Thanks,
    Warren

Please Sign in or register to post replies

Write your reply to:

Draft