/**
* 構造化データ (Schema.org) ビルダーヘルパー
*
* 動画データから VideoObject の連想配列を組み立てる共通処理。
* チャンネルトップ (channel-popular-list / channel-latest-list) と
* 一覧ページ (channel-popular-videos / channel-videos) の両方で同一仕様を使う。
*/
if ( ! function_exists( 'build_schema_video_object' ) ) {
/**
* 動画データ配列から Schema.org VideoObject 形式の連想配列を生成する。
*
* @param array $video get_video_data() / get_channel_cache_data() で取得した動画データ
* @param string $channel_id 親チャンネル ID (URL 組み立て用)
*
* @return array|null video_id が空なら null
*/
function build_schema_video_object( $video, $channel_id ) {
if ( empty( $video['video_id'] ) ) {
return null;
}
$desc_parts = array();
$desc_parts[] = '再生回数' . number_format( $video['video_view'] ) . '回';
$desc_parts[] = 'いいね' . number_format( $video['video_like'] ) . '件';
$desc_parts[] = 'コメント' . number_format( $video['video_comment'] ) . '件';
if ( ! empty( $video['video_published_at'] ) ) {
$desc_parts[] = '投稿日' . date( 'Y/m/d', $video['video_published_at'] );
}
// Duration: 6-digit HHMMSS → ISO 8601
$iso_duration = '';
if ( ! empty( $video['video_duration'] ) ) {
$dur = sprintf( '%06d', $video['video_duration'] );
$h = (int) substr( $dur, 0, 2 );
$m = (int) substr( $dur, 2, 2 );
$s = (int) substr( $dur, 4, 2 );
$iso_duration = 'PT';
if ( $h > 0 ) {
$iso_duration .= $h . 'H';
}
if ( $m > 0 ) {
$iso_duration .= $m . 'M';
}
$iso_duration .= $s . 'S';
}
$item_data = array(
'@type' => 'VideoObject',
'name' => $video['video_title'],
'url' => 'https://digitalcreators.jp/channel/' . $channel_id . '/videos/' . $video['video_id'] . '/',
'thumbnailUrl' => 'https://img.youtube.com/vi/' . $video['video_id'] . '/maxresdefault.jpg',
'embedUrl' => 'https://www.youtube.com/embed/' . $video['video_id'],
'description' => implode( '、', $desc_parts ),
'interactionStatistic' => array(
array(
'@type' => 'InteractionCounter',
'interactionType' => array( '@type' => 'WatchAction' ),
'userInteractionCount' => (int) $video['video_view'],
),
array(
'@type' => 'InteractionCounter',
'interactionType' => array( '@type' => 'LikeAction' ),
'userInteractionCount' => (int) $video['video_like'],
),
array(
'@type' => 'InteractionCounter',
'interactionType' => array( '@type' => 'CommentAction' ),
'userInteractionCount' => (int) $video['video_comment'],
),
),
);
if ( ! empty( $iso_duration ) ) {
$item_data['duration'] = $iso_duration;
}
if ( ! empty( $video['video_published_at'] ) ) {
$item_data['uploadDate'] = date( "Y-m-d\TH:i:s+09:00", (int) $video['video_published_at'] );
}
return $item_data;
}
}
if ( ! function_exists( 'build_channel_additional_properties' ) ) {
/**
* チャンネルの統計値を Schema.org additionalProperty (PropertyValue の配列) として生成する。
* チャンネルランキング(カルーセルの各ListItem)とチャンネルページ(ProfilePage の mainEntity)で共用。
*
* @param array $c チャンネルデータ連想配列。channel_ranking.JP の行 / get_channel_data() の結果。
* 必要列: channel_difference_user, channel_difference_view, channel_video_view,
* channel_user, channel_newest_avg_view_count, channel_newest_avg_good,
* channel_newest_avg_comment, channel_newest_per_engagement。
*
* @return array PropertyValue 連想配列のリスト(該当データが無い項目はスキップ)。
*/
function build_channel_additional_properties( $c ) {
// label => array( 列名, 値の型 )。値は表示中の項目に対応。
$map = array(
'30-Day Subscriber Growth' => array( 'channel_difference_user', 'int' ),
'30-Day View Count Growth' => array( 'channel_difference_view', 'int' ),
'Lifetime Channel Views' => array( 'channel_video_view', 'int' ),
'Total Channel Subscribers' => array( 'channel_user', 'int' ),
'Average Views Per Video' => array( 'channel_newest_avg_view_count', 'round' ),
'Average Likes Per Video' => array( 'channel_newest_avg_good', 'round' ),
'Average Comments Per Video' => array( 'channel_newest_avg_comment', 'round' ),
'Channel Engagement Rate' => array( 'channel_newest_per_engagement', 'rate' ),
);
$props = array();
foreach ( $map as $label => $def ) {
list( $col, $type ) = $def;
if ( ! isset( $c[ $col ] ) || $c[ $col ] === '' || $c[ $col ] === null ) {
continue;
}
$raw = $c[ $col ];
if ( $type === 'rate' ) {
// engagement率: 保存値は比率(0.0615)なので %(6.15) に変換し unitText を付与。
$props[] = array(
'@type' => 'PropertyValue',
'name' => $label,
'value' => round( (float) $raw * 100, 2 ),
'unitText' => 'PERCENT',
);
continue;
}
$value = ( $type === 'round' ) ? (int) round( (float) $raw ) : (int) $raw;
$props[] = array(
'@type' => 'PropertyValue',
'name' => $label,
'value' => $value,
);
}
return $props;
}
}
国際夫婦チャンネル・なるチャンが、アメリカ人旦那の実家で1日密着!アメリカ人家庭のリアルな日常を大公開! | YouTuberトレンド分析メディア:デジタルクリエイターズ国際夫婦チャンネル・なるチャンが、アメリカ人旦那の実家で1日密着!アメリカ人家庭のリアルな日常を大公開!
By KA / 2024/02/15
国際結婚の生活の様子を発信している『なるチャン』にて、旦那の実家で一日過ごす様子を密着のような形で映像にした日常vlog動画が投稿された。
アメリカ人旦那の実家で、1日密着!
一日密着in旦那の実家という内容の動画を投稿した、YouTubeチャンネル『なるチャン』の『ナルミ』。その日はホリデーという事もあり、9時に起床し、ブラインドをあげ、ベッドメイキングをする。家族がいるリビングに向かうと、朗らかな雰囲気の旦那さんの家族と、犬がお出迎え。家族と世間話を楽しみながら、ゆっくりとした朝を過ごしている。身支度を整え、家事を進めていく投稿主。12時頃溜まったメールを消化すると、Amish(アメリカ合衆国に居住するドイツ系移民の宗教団体)のファーマーズマーケットに向かう。他の国では見ない、小規模のマーケットで売られている商品を購入した。
その後は、料理やキッチンんオ片付けで家族と共に作業し、家庭のレシピを教えてもらったりしている。
夕ご飯の時間になると、家族にお皿を配り、それぞれスープをよそっていく。
仲睦まじそうな家族の様子や、日本とはまた違った雰囲気の家庭の日常を楽しむことができる動画となっている。
その他の『なるチャン』の記事はこちら!