CURLは一致に
このコミットが含まれているのは:
コミット
5cf61e1df6
|
@ -17,42 +17,20 @@ class Common extends Engine {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLocal () {
|
public function getLocal () {
|
||||||
$ch = curl_init();
|
return $this->ptapi_get('/api/v1/oauth-clients/local');
|
||||||
curl_setopt($ch, CURLOPT_URL, env('PEER_URI').'/api/v1/oauth-clients/local');
|
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
||||||
|
|
||||||
$get = curl_exec($ch);
|
|
||||||
$err = curl_error($ch);
|
|
||||||
curl_close($ch);
|
|
||||||
|
|
||||||
if (!$get) return $err;
|
|
||||||
$get = json_decode($get);
|
|
||||||
if (isset($get->status) && $get->status == 404) return [];
|
|
||||||
|
|
||||||
return $get;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMe () {
|
public function getMe () {
|
||||||
$ch = curl_init();
|
return $this->ptapi_get('/api/v1/users/me');
|
||||||
curl_setopt($ch, CURLOPT_URL, env('PEER_URI').'/api/v1/users/me');
|
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
||||||
|
|
||||||
$get = curl_exec($ch);
|
|
||||||
$err = curl_error($ch);
|
|
||||||
curl_close($ch);
|
|
||||||
|
|
||||||
if (!$get) return $err;
|
|
||||||
$get = json_decode($get);
|
|
||||||
if (isset($get->status) && $get->status == 404) return [];
|
|
||||||
|
|
||||||
return $get;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNotify () {
|
public function getNotify () {
|
||||||
|
return $this->ptapi_get('/api/v1/users/me/notifications?start=0&count=0&unread=true');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function ptapi_get ($url) {
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_URL, env('PEER_URI').'/api/v1/users/me/notifications?start=0&count=0&unread=true');
|
curl_setopt($ch, CURLOPT_URL, env('PEER_URI').$url);
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ class Watch extends Common {
|
||||||
|
|
||||||
public function index ($id) {
|
public function index ($id) {
|
||||||
$res = [];
|
$res = [];
|
||||||
|
$res['page'] = 'watch';
|
||||||
$res['detail'] = $this->getDetail($id);
|
$res['detail'] = $this->getDetail($id);
|
||||||
$res['comment'] = $this->getComment($id);
|
$res['comment'] = $this->getComment($id);
|
||||||
$res['recommend'] = $this->getRecommend($res['detail']->tags);
|
$res['recommend'] = $this->getRecommend($res['detail']->tags);
|
||||||
|
@ -22,57 +23,18 @@ class Watch extends Common {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDetail ($id) {
|
function getDetail ($id) {
|
||||||
$ch = curl_init();
|
return $this->ptapi_get('/api/v1/videos/'.$id);
|
||||||
curl_setopt($ch, CURLOPT_URL, env('PEER_URI').'/api/v1/videos/'.$id);
|
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
||||||
|
|
||||||
$get = curl_exec($ch);
|
|
||||||
$err = curl_error($ch);
|
|
||||||
curl_close($ch);
|
|
||||||
|
|
||||||
if (!$get) return $err;
|
|
||||||
$get = json_decode($get);
|
|
||||||
|
|
||||||
return $get;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRecommend ($tags) {
|
public function getRecommend ($tags) {
|
||||||
$ch = curl_init();
|
|
||||||
$tag = '';
|
$tag = '';
|
||||||
foreach ($tags as $t) {
|
foreach ($tags as $t) {
|
||||||
$tag .= 'tagsOneOf='.urlencode($t).'&';
|
$tag .= 'tagsOneOf='.urlencode($t).'&';
|
||||||
}
|
}
|
||||||
|
return $this->ptapi_get('/api/v1/search/videos?start=0&count=6&nsfw=both&'.$tag.'sort=-publishedAt&searchTarget=local');
|
||||||
curl_setopt($ch, CURLOPT_URL, env('PEER_URI').'/api/v1/search/videos?start=0&count=6&nsfw=both&'.$tag.'sort=-publishedAt&searchTarget=local');
|
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
||||||
|
|
||||||
$get = curl_exec($ch);
|
|
||||||
$err = curl_error($ch);
|
|
||||||
curl_close($ch);
|
|
||||||
|
|
||||||
if (!$get) return $err;
|
|
||||||
$get = json_decode($get);
|
|
||||||
if (isset($get->status) && $get->status == 404) return [];
|
|
||||||
|
|
||||||
return $get;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getComment ($id) {
|
public function getComment ($id) {
|
||||||
$ch = curl_init();
|
return $this->ptapi_get('/api/v1/videos/'.$id.'/comment-threads');
|
||||||
curl_setopt($ch, CURLOPT_URL, env('PEER_URI').'/api/v1/videos/'.$id.'/comment-threads');
|
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
||||||
|
|
||||||
$get = curl_exec($ch);
|
|
||||||
$err = curl_error($ch);
|
|
||||||
curl_close($ch);
|
|
||||||
|
|
||||||
if (!$get) return $err;
|
|
||||||
$get = json_decode($get);
|
|
||||||
if (isset($get->status) && $get->status == 404) return [];
|
|
||||||
|
|
||||||
return $get;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,5 @@
|
||||||
@extends('theme.'.env('THEME').'.peertube')
|
@extends('theme.'.env('THEME').'.peertube')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
@include('theme.'.env('THEME').'.component.peertube.w')
|
||||||
<div class="peertube-container user-logged-in">
|
|
||||||
@include('theme.'.env('THEME').'.component.peertube.parts.header')
|
|
||||||
<div class="sub-header-container">
|
|
||||||
@include('theme.'.env('THEME').'.component.peertube.parts.menu')
|
|
||||||
@include('theme.'.env('THEME').'.component.peertube.w')
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
<?php
|
||||||
|
$name = '';
|
||||||
|
|
||||||
|
if (isset($res['page'])) {
|
||||||
|
if ($res['page'] == 'watch') $name = $res['detail']->name;
|
||||||
|
else if ($res['page'] == 'account') $name = $res['owner']->displayName.'さんのチャンネル一覧';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
|
@ -12,5 +21,7 @@
|
||||||
|
|
||||||
<base href="{{ env('APP_URL') }}/peertube/client/ja-JP/">
|
<base href="{{ env('APP_URL') }}/peertube/client/ja-JP/">
|
||||||
|
|
||||||
<title>{{ $res['detail']->name }} - 076動画</title>
|
<title>
|
||||||
|
{{ $name }} - 076動画
|
||||||
|
</title>
|
||||||
<meta name="description" content="テクニカル諏訪子様の動画サイト" />
|
<meta name="description" content="テクニカル諏訪子様の動画サイト" />
|
|
@ -1,6 +1,15 @@
|
||||||
|
<?php
|
||||||
|
$name = '';
|
||||||
|
|
||||||
|
if (isset($res['page'])) {
|
||||||
|
if ($res['page'] == 'watch') $name = $res['detail']->name;
|
||||||
|
else if ($res['page'] == 'account') $name = $res['owner']->displayName.'さんのチャンネル一覧';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
<meta property="og:type" content="video" />
|
<meta property="og:type" content="video" />
|
||||||
<meta property="og:site_name" content="076動画" />
|
<meta property="og:site_name" content="076動画" />
|
||||||
<meta property="og:title" content="{{ $res['detail']->name }}" />
|
<meta property="og:title" content="{{ $name }}" />
|
||||||
<meta property="og:image" content="https://video.076.ne.jp/lazy-static/previews/8d97cbd1-50bb-4de3-9eb6-914027346996.jpg" />
|
<meta property="og:image" content="https://video.076.ne.jp/lazy-static/previews/8d97cbd1-50bb-4de3-9eb6-914027346996.jpg" />
|
||||||
<meta property="og:url" content="{{ env('APP_URL') }}/peertube/w/b8oKB37kqyCdt7gBtPWeWV" />
|
<meta property="og:url" content="{{ env('APP_URL') }}/peertube/w/b8oKB37kqyCdt7gBtPWeWV" />
|
||||||
<meta property="og:description" content="" />
|
<meta property="og:description" content="" />
|
||||||
|
@ -9,11 +18,11 @@
|
||||||
<meta property="og:video:type" content="text/html" />
|
<meta property="og:video:type" content="text/html" />
|
||||||
<meta property="og:video:width" content="560" />
|
<meta property="og:video:width" content="560" />
|
||||||
<meta property="og:video:height" content="315" />
|
<meta property="og:video:height" content="315" />
|
||||||
<meta property="name" content="{{ $res['detail']->name }}" />
|
<meta property="name" content="{{ $name }}" />
|
||||||
<meta property="description" content="" />
|
<meta property="description" content="" />
|
||||||
<meta property="image" content="https://video.076.ne.jp/lazy-static/previews/8d97cbd1-50bb-4de3-9eb6-914027346996.jpg" />
|
<meta property="image" content="https://video.076.ne.jp/lazy-static/previews/8d97cbd1-50bb-4de3-9eb6-914027346996.jpg" />
|
||||||
<meta property="twitter:card" content="summary_large_image" />
|
<meta property="twitter:card" content="summary_large_image" />
|
||||||
<meta property="twitter:site" content="@TechnicalSuwako" />
|
<meta property="twitter:site" content="@TechnicalSuwako" />
|
||||||
<meta property="twitter:title" content="{{ $res['detail']->name }}" />
|
<meta property="twitter:title" content="{{ $name }}" />
|
||||||
<meta property="twitter:description" content="" />
|
<meta property="twitter:description" content="" />
|
||||||
<meta property="twitter:image" content="https://video.076.ne.jp/lazy-static/previews/8d97cbd1-50bb-4de3-9eb6-914027346996.jpg" />
|
<meta property="twitter:image" content="https://video.076.ne.jp/lazy-static/previews/8d97cbd1-50bb-4de3-9eb6-914027346996.jpg" />
|
|
@ -1,4 +1,13 @@
|
||||||
<link rel="alternate" type="application/json+oembed" href="https://video.076.ne.jp/services/oembed?url=https%3A%2F%2Fvideo.076.ne.jp%2Fw%2Fb8oKB37kqyCdt7gBtPWeWV" title="{{ $res['detail']->name }}" />
|
<?php
|
||||||
|
$name = '';
|
||||||
|
|
||||||
|
if (isset($res['page'])) {
|
||||||
|
if ($res['page'] == 'watch') $name = $res['detail']->name;
|
||||||
|
else if ($res['page'] == 'account') $name = $res['owner']->displayName.'さんのチャンネル一覧';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<link rel="alternate" type="application/json+oembed" href="https://video.076.ne.jp/services/oembed?url=https%3A%2F%2Fvideo.076.ne.jp%2Fw%2Fb8oKB37kqyCdt7gBtPWeWV" title="{{ $name }}" />
|
||||||
<link rel="canonical" href="https://video.076.ne.jp/videos/watch/52039d41-8b56-4690-b6fa-25dedfedd5c5" />
|
<link rel="canonical" href="https://video.076.ne.jp/videos/watch/52039d41-8b56-4690-b6fa-25dedfedd5c5" />
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://video.076.ne.jp/styles.b0a7806028b73e54111d.css" media="print" onload="this.media='all'">
|
<link rel="stylesheet" href="https://video.076.ne.jp/styles.b0a7806028b73e54111d.css" media="print" onload="this.media='all'">
|
||||||
|
|
|
@ -8,6 +8,12 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="custom-css">
|
<body id="custom-css">
|
||||||
@yield('content')
|
<div class="peertube-container user-logged-in">
|
||||||
|
@include('theme.'.env('THEME').'.component.peertube.parts.header')
|
||||||
|
<div class="sub-header-container">
|
||||||
|
@include('theme.'.env('THEME').'.component.peertube.parts.menu')
|
||||||
|
@yield('content')
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
新しいイシューから参照