1 About This Recipe

Use this recipe to connect to your YouTube channel, get the metadata of videos (such as title, description, and URL), and post the videos on LinkedIn and Twitter.

Note:

This recipe is available as YouTube — Socials | Share Video Posts in Oracle Integration. Oracle provides this recipe as a sample only. The recipe is meant only for guidance, and is not warranted to be error-free. No support is provided for this recipe.

Overview

The recipe demonstrates how to connect to your YouTube channel, get all the playlists, fetch the metadata of videos (such as title, description, and URL), and post the videos to the OCI Streaming service as a JSON.

Two independent app-driven orchestration flows poll the OCI Streaming service, retrieve the JSON data, and share it on LinkedIn and Twitter, respectively.

Note:

Each time the app-driven integrations poll the video post from OCI Streaming, a random video post is shared on the socials. A random integer is generated to obtain video postings from an array queried from the OCI Streaming service. For instance, if there are thirty videos in a playlist, a random number between 1 and 30 is generated using the JavaScript library, and based on that random number, the video post is fetched from the playlist array and posted on socials.

In this recipe, we use the OCI Streaming service to publish all the playlist video posts as a JSON, and two subscribers are connected to the same stream to consume the video posts.

System and Access Requirements

  • OCI Streaming

  • Compute Instance

  • Oracle Integration

Recipe Schema

This section provides an architectural overview of the recipe.



This recipe has the following integrations:
  • YouTube OCI Streaming YT Posts: This integration connects to your YouTube channel using REST APIs, gets all the playlists, fetches the metadata of videos (such as title, description, and URL), and posts videos to the OCI Streaming service as a JSON array.
  • Share YT Posts on Twitter: This integration polls all the messages from the OCI Streaming service, and shares them on Twitter.
  • Share YT Posts on LinkedIn: This integration polls all the messages from the OCI Steaming service, and shares them on LinkedIn.

The recipe has the following controls:

  • Exclude Playlist IDs: Use this control to exclude playlists from being shared on socials. Enter comma-separated IDs of the playlists that you want to exclude in the exludePlaylistIds key of the lookup table. See Configure the Lookup Table.
  • Don’t share video posts on LinkedIn and Twitter: Use this control to prevent sharing posts on socials. For the following keys, set value to false to prevent sharing videos on LinkedIn and Twitter, respectively.
    • publishVideoOnLinkedIn
    • publishVideoOnTwitter

    The default value for both the keys is true.

  • Share number of video posts on LinkedIn and Twitter: Use this control to specify the number of posts you want to share on LinkedIn and Twitter. You can configure this using the following keys in the lookup table.
    • publishVideoOnLinkedIn
    • publishVideoOnTwitter

    The maximum possible value for the keys is 50, and the default value is 1.