↑ Return to F90 Youtube

F94 Youtube Objects Attributes


Page no: F94

Object Mapping

 

Object   Youtube API Object Feed WordPress
RSS Syntax
Physical WordPress Table
Video   WP_POSTS
Channel snippet <channel><channelId>
Author <author>
Tag
Category pre-defined by Youtube  

…..

Basic Feed: Example 

This feed only contains basic fields:

<channel>

<channelId>

<channelTitle>

<title>

<link>

<pubDate>

<description>

 

It is for debugging use!

 

<channel>
<title>FeedVideos</title>
<item>
<title>Corona Crash 2</title>
<link>https://youtube.com/watch?v=nmYZcacm_zY</link>
<pubDate>2020-03-19T19:44:24.000Z</pubDate>
<description>
<![CDATA[
Während wir noch Anfang Jahr an den weltweiten Aktienmärkten eher eine Situation der Überbewertung sahen. Sehen wir nach Corona – bei aller Unsicherheit …
]]>
</description>
<channelId>UCn8aVW6QGQcRjhF3Znt35mg</channelId>
<channelTitle>Fintool</channelTitle>
</item>
<item>
<title>Altersvorsorge in Deutschland 2</title>
<link>https://youtube.com/watch?v=ckBCK1yBbLQ</link>
<pubDate>2020-03-19T09:00:12.000Z</pubDate>
<description>
<![CDATA[
Das traditionelle Verständnis der Deutschen zur Altersvorsorge: Kritische Gedanken.
]]>
</description>

More Complex feed: Example

<channel>
<title>FeedVideos</title>
<item>
<id>nmYZcacm_zY</id>
<title>Corona Crash 2</title>
<description>
<![CDATA[
Während wir noch Anfang Jahr an den weltweiten Aktienmärkten eher eine Situation der Überbewertung sahen. Sehen wir nach Corona – bei aller Unsicherheit – eher wieder Opportunitäten.
]]>
</description>
<excerpt>
<![CDATA[
Während wir noch Anfang Jahr an den weltweiten Aktienmärkten eher eine Situation der Überbewertung sahen. Sehen wir nach Corona – bei aller Unsicherheit – eher wieder Opportunitäten.
]]>
</excerpt>
<date>2020-03-19T19:44:24.000Z</date>
<feature_image>https://i.ytimg.com/vi/nmYZcacm_zY/mqdefault.jpg</feature_image>
<categoryId>27</categoryId>
<channelId>UCn8aVW6QGQcRjhF3Znt35mg</channelId>
<channelTitle>Fintool</channelTitle>
<defaultLanguage>de</defaultLanguage>
<subtitles>false</subtitles>
<license>1</license>
<views>658</views>
<likes>54</likes>
<dislikes>0</dislikes>
<player>
<![CDATA[
<iframe width=”480″ height=”270″ src=”//www.youtube.com/embed/nmYZcacm_zY” frameborder=”0″ allow=”accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture” allowfullscreen></iframe>
]]>
</player>
</item>

Database Structure

Logical Database Structure

 

Video_Type is an object.

to be done later

 

 

Physical Database Model

 

 

DB Structure
DB Structure

- Click to enlarge

Video fields mapped to WP fields

 

Youtube
Attribute
Youtube Purpose Youtube name RSS Field Example WP table WP name WP type of field Issues…………………………
ID Id of the video id <id> nmYZcacm_zY posts_meta video_id
Title Title of the video snippet.title <title> Corona Crash 2 posts title
Description Description of the video snippet.description <content:encoded>
<![CDATA[
Während wir noch Anfan
]]>
posts text
Excerpt Short description of the video snippet.description <excerpt>
<![CDATA[
Während wir noch Anfan
]]>
posts excerpt
Date Publication date of the video snippet.publishedAt <pubDate> 2020-03-19T09:00:12.000Z posts published_date When WP publish post, published date gets overriden.
Feature image Thumbnail of the video as a Featured image in the snippet.thumbnails.(key).url <image> >https://i.ytimg.com/vi/nmYZcacm_zY/mqdefault.jpg posts_meta _wp_attachment.*
Tags Tags of the post snippet.tags[] <tags> fintool does not have tags terms many fields
Categories Youtube categories of the video snippet.categoryId <categoryId> 27, details on Youtube categories terms many fields
Author Categories  Does not exist We take the author terms

Terms_Rel

Channel id ID needed for taking info about the channel snippet.channelId <channelId> UCn8aVW6QGQcRjhF3Znt35mg posts_meta video_channel_id
Channel name Name of the channel snippet.channelName <channelTitle> Fintool posts_meta video_channel_name
Default lang Default language of the video snippet.defaultLanguage <defaultLanguage> de posts_meta video_lang
Subtitles Information about subtitles of the video contentDetails.caption <subtitles> false posts_meta video_caption
License License of the video contentDetails.licensedContent <license> 1 posts_meta video_license
Views Views statistic statistics.viewCount <views> 321 posts_meta video_views
Likes Likes statistic statistics.likeCount <likes> 321 posts_meta video_likes
Dislikes Dislike statistic statistics.dislikeCount <dislikes> 2 posts_meta video_dislike
Player Player iframe code player.embedHtml <player>
<![CDATA[
<iframe width=”480″ height=”270″ src=”//www.youtube.com/embed/nmYZcacm_zY” frameborder=”0″ allow=”accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture” allowfullscreen></iframe>
]]>
posts_meta video_player
 

 

Channel fields mapped to WP fields

 

Currently these fields are mapped to authors, but they can easily be mapped to categories, tags or custom post types

 

Field Purpose Youtube API name WP type of field WP table WP name
Channel category ID ID of the category of the channel categoryId custom field usermeta channel_category_id
Username Username of the channel forUsername custom field usermeta channel_username
Title Title generated from the owner of the channel snippet.title custom field usermeta channel_title
Description Description of the channel snippet.description custom field usermeta channel_description
URL Url of the channel snippet.customUrl custom field usermeta channel_url
Creation date Date when the channel started snippet.publishedAt custom field usermeta channel_start_date
Avatar Channel avatar snippet.thumbnails.(key).url custom field usermeta channel_avatar
Language Default language of the channel snippet.defaultLanguage custom field usermeta channel_lang
Country Country of the channel snippet.country custom field usermeta channel_country
Playlists List with all public playlists of the channel contentDetails.relatedPlaylists custom field usermeta channel_playlists
Views Views statistic statistics.viewCount custom field usermeta channel_views
Comments Comments statistic statistics.commentCount custom field usermeta channel_comments
Subscribers Subscribers statistic statistics.subscriberCount custom field usermeta channel_subscriber
 

See more for Autofeed