Browse Source

add content

feature/new_bilibili_and_instagram_sxs20191126
shixuesen 4 years ago
parent
commit
59b52e7728
35 changed files with 89875 additions and 17528 deletions
  1. +6
    -4
      .env.local
  2. +2
    -0
      .envold
  3. +8
    -0
      .idea/php.xml
  4. +7
    -0
      .valet-env.php
  5. +3
    -3
      app/Console/Commands/BiliVideoCode.php
  6. +3
    -0
      app/Console/Commands/CommonTest.php
  7. +71
    -0
      app/Http/Controllers/GooglePhotoController.php
  8. +4
    -1
      app/Http/Controllers/WeiboController.php
  9. +1
    -1
      app/Services/BilibiliServiceV2.php
  10. +1
    -1
      app/Services/FfmpegService.php
  11. +4
    -4
      app/Services/NewNvshenService.php
  12. +6
    -6
      app/Services/WeiboService.php
  13. +6
    -6
      app/Services/XiurenjiService.php
  14. +50
    -0
      app/Utils/CommonUtils.php
  15. +66
    -0
      app/Utils/helper.php
  16. +1
    -0
      client_secret.json
  17. +4
    -0
      composer.json
  18. +1582
    -889
      composer.lock
  19. +2
    -0
      config/app.php
  20. +8
    -0
      fail.log
  21. +11156
    -10925
      package-lock.json
  22. +6
    -3
      package.json
  23. +1
    -0
      public/client_secret.json
  24. +1
    -0
      public/client_secret_1000190146810-j9mohjt8m4m8j8sj6hupl1bghp6o1pdn.apps.googleusercontent.com.json
  25. +10947
    -15
      public/css/app.css
  26. +65794
    -1
      public/js/app.js
  27. +4
    -0
      public/mix-manifest.json
  28. +4
    -21
      resources/js/app.js
  29. +26
    -0
      resources/js/components/Example.js
  30. +0
    -23
      resources/js/components/ExampleComponent.vue
  31. +36
    -0
      resources/views/albums/connect.blade.php
  32. +62
    -0
      resources/views/albums/index.blade.php
  33. +2
    -0
      routes/web.php
  34. +1
    -1
      webpack.mix.js
  35. +0
    -5624
      yarn.lock

+ 6
- 4
.env.local View File

@ -1,17 +1,17 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:huv04dD9NHrCHQ4HqLhp9GqOgBm6Kgnhn88VNh0OzAk=
APP_KEY=base64:Stqw+jICFFbtY3RCA3cfnv0E3oEoWZmGDgVHoUCTSNs=
APP_DEBUG=true
APP_URL=http://localhost
APP_URL=https://ins.app
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_PORT=3307
DB_DATABASE=ins
DB_USERNAME=root
DB_PASSWORD=
DB_PASSWORD=949sxs949
BROADCAST_DRIVER=log
@ -47,3 +47,5 @@ OAUTH_SCOPES='openid profile offline_access user.read calendars.read'
OAUTH_AUTHORITY=https://login.microsoftonline.com/common
OAUTH_AUTHORIZE_ENDPOINT=/oauth2/v2.0/authorize
OAUTH_TOKEN_ENDPOINT=/oauth2/v2.0/token
albums_authentication_redirect_url=http://localhost:1234/google/photo/connect

+ 2
- 0
.envold View File

@ -0,0 +1,2 @@
local: .env.local
prod: .env.prod

+ 8
- 0
.idea/php.xml View File

@ -172,6 +172,14 @@
<path value="$PROJECT_DIR$/vendor/neutron/temporary-filesystem" />
<path value="$PROJECT_DIR$/vendor/alchemy/binary-driver" />
<path value="$PROJECT_DIR$/vendor/php-ffmpeg/php-ffmpeg" />
<path value="$PROJECT_DIR$/vendor/grpc/grpc" />
<path value="$PROJECT_DIR$/vendor/google/protobuf" />
<path value="$PROJECT_DIR$/vendor/google/grpc-gcp" />
<path value="$PROJECT_DIR$/vendor/google/photos-library" />
<path value="$PROJECT_DIR$/vendor/google/common-protos" />
<path value="$PROJECT_DIR$/vendor/google/gax" />
<path value="$PROJECT_DIR$/vendor/doctrine/deprecations" />
<path value="$PROJECT_DIR$/vendor/paragonie/constant_time_encoding" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="7.1" />


+ 7
- 0
.valet-env.php View File

@ -0,0 +1,7 @@
<?php
return [
'*' => [ // Applies to all
'APP_ENV' => 'local',
],
];

+ 3
- 3
app/Console/Commands/BiliVideoCode.php View File

@ -49,12 +49,12 @@ class BiliVideoCode extends Command
// $bilibili->insertDBTest();exit;
// $bilibili->queryPlayList();
$bilibili->queryUpVideoList(10278125);
// $bilibili->queryUpVideoList(10278125);
// exit;
$bilibili->queryDBCollectionList();
// $bilibili->queryDBCollectionList();
// exit;
$bilibili->queryForVideoParts();
// $bilibili->queryForVideoParts();
$bilibili->compareAndDownloadUpVideos();
// exit;
$bilibili->compareAndDownloadCollectionVideos();


+ 3
- 0
app/Console/Commands/CommonTest.php View File

@ -2,6 +2,7 @@
namespace App\Console\Commands;
use App\BilibiliVideos;
use App\Services\CommonScrapeService;
use App\Services\FfmpegService;
use App\Services\FileService;
@ -43,6 +44,8 @@ class CommonTest extends Command
*/
public function handle()
{
// $list = BilibiliVideos::where("created_at", ">", "2021-09-09 00:00:00")->get();
// dump($list[0]->getAttributes());exit;
date_default_timezone_set('PRC');
$path = $this->argument("path");
$service = new FfmpegService();


+ 71
- 0
app/Http/Controllers/GooglePhotoController.php View File

@ -0,0 +1,71 @@
<?php
namespace App\Http\Controllers;
use Google\ApiCore\ApiException;
use Google\Photos\Library\V1\PhotosLibraryClient;
use Illuminate\Http\Request;
class GooglePhotoController extends Controller {
public function connect(Request $request)
{
connectWithGooglePhotos($request,
['https://www.googleapis.com/auth/photoslibrary'],
config('app.albums_authentication_redirect_url')
);
}
public function index()
{
$credentials = session("credentials");
if ($credentials == null || $credentials == "") {
return view("albums/connect");
}
$photosLibraryClient = new PhotosLibraryClient(['credentials' => $credentials]);
try {
// $options['proxy'] = 'http://127.0.0.1:1087';
// $pagedResponse = $photosLibraryClient->listAlbums();
// $options['pageSize'] = 5;
$pagedResponse = $photosLibraryClient->listMediaItems();
// echo 111;
// var_dump($pagedResponse->iterateAllElements());exit;
$iterator = $pagedResponse->iterateAllElements();
$albums = [];
$yccImages = [];
while (true) {
for ($i = 0; $i < 100; $i++) {
$album = $iterator->current();
if (strstr($album->getFilename(), "ycc")) {
$yccImages[] = $album->getId();
}
$iterator->next();
}
if (count($yccImages) > 1) {
$photosLibraryClient->batchAddMediaItemsToAlbum("AN5jk26M4hJ-wxLPKSzIDyjruMMkWjlDlVkgNaWWk3d3c7TGhm1vKU-YM0JhfgK5CfcfneoIx_8E", $yccImages);
echo "add " . count($yccImages) . " images to ycc\n";
$yccImages = [];
}
break;
}
//// echo $album->getProductUrl();
// $albums[] = $album;
// $iterator->next();
// }
// exit;
// By using iterateAllElements, pagination is handled for us.
return view("albums.index", ['albums' => $pagedResponse->iterateAllElements()]);
// echo $templates->render(
// 'albums::index',
// ['albums' => $pagedResponse->iterateAllElements()]);
// echo $templates->render(
// 'albums::index',
// ['mediaItems' => $albums]
// );
// );
} catch (ApiException $e) {
// echo $templates->render('error', ['exception' => $e]);
view("error");
}
}
}

+ 4
- 1
app/Http/Controllers/WeiboController.php View File

@ -26,6 +26,9 @@ class WeiboController extends Controller
// 儒雅随和 1076035123577126 page 139
// 徐圣佑 1076035893812490 page 283
// https://m.weibo.cn/api/container/getIndex?containerid=230259&openApp=0
// 短短 1076032137020951
// https://m.weibo.cn/api/container/getIndex?containerid=230259&openApp=0&page=
$url = array();
@ -33,7 +36,7 @@ class WeiboController extends Controller
// for( $i = 341; $i >= 1 ; $i-- )
// $url[] = 'https://m.weibo.cn/api/container/getIndex?containerid=1076035893812490&openApp=0&page='.$i;
for( $i = 50; $i >= 1 ; $i-- )
$url[] = 'https://m.weibo.cn/api/container/getIndex?containerid=230259&openApp=0&page='.$i;
$url[] = 'https://m.weibo.cn/api/container/getIndex?containerid=1076032137020951&openApp=0&page='.$i;
// for ($i = 5; $i >= 1; $i--) {
// $url[] = 'https://m.weibo.cn/feed/group?gid=4423532052076817&&page=' . $i;
// }


+ 1
- 1
app/Services/BilibiliServiceV2.php View File

@ -876,7 +876,7 @@ class BilibiliServiceV2
foreach ($aidMap as $aid => $parts) {
dump($aid);
Log::info("current download command is : cd '{$innerDir}' && annie -r https://www.bilibili.com/video/av80815149 -p " . $aid);
$downloadResult = shell_exec('cd "' .$innerDir .'" && url="https://www.bilibili.com/video/av' . $aid . '?p="
$downloadResult = shell_exec('export http_proxy=http://127.0.0.1:1087; export https_proxy=http://127.0.0.1:1087; cd "' .$innerDir .'" && url="https://www.bilibili.com/video/av' . $aid . '?p="
for i in $(seq 1 ' . $parts . ')
do
annie -f 64 $url$i


+ 1
- 1
app/Services/FfmpegService.php View File

@ -136,7 +136,7 @@ class FfmpegService
}
dump("targetFile", [$targetFile]);
Log::info("process target file : $targetFile");
$result = shell_exec("ffmpeg -threads 4 -i '". $pathFile ."' -preset ultrafast -c:v libx265 -vtag hvc1 '" . $targetFile . "' && echo 'ok'");
$result = shell_exec("ffmpeg -threads 4 -i ". escapeshellarg($pathFile) ." -preset ultrafast -c:v libx265 -vtag hvc1 " . escapeshellarg($targetFile) . " && echo 'ok'");
echo $result;
if (trim($result) == "ok") {
echo "compress work done remove the file \n";


+ 4
- 4
app/Services/NewNvshenService.php View File

@ -113,9 +113,9 @@ class NewNvshenService
}
// dump($albumCodeMap);exit;
}
$baseUrl = "https://www.invshen.net";
$baseUrl = "https://www.fnvshen.com";
usleep(random_int(100, 1000) * 1000);
$peopleUrl = "https://www.invshen.net/girl/";
$peopleUrl = "https://www.fnvshen.com/girl/";
$peopleUrl .= $name['code'];
@ -152,7 +152,7 @@ class NewNvshenService
$totalAlbumPage = ceil($totalAlbumNum / 30);
}
$baseAlbumUrl = "https://www.invshen.net/girl/{$name['code']}/album/";
$baseAlbumUrl = "https://www.fnvshen.com/girl/{$name['code']}/album/";
// 表示限制抓取相册数
$countLimit = 5;
if ($isAll) {
@ -282,7 +282,7 @@ class NewNvshenService
public function subTest()
{
$baseUrl = "https://www.invshen.net";
$baseUrl = "https://www.fnvshen.com";
$album = "/g/31347/";
$pageQL = QueryList::get($baseUrl . $album);
$page = $pageQL->find(".albumInfo > span")->htmls();


+ 6
- 6
app/Services/WeiboService.php View File

@ -27,8 +27,8 @@ class WeiboService
// $video_dir = "/Volumes/Samsung/weibo/people/徐圣佑/video";
// $image_dir = "/Volumes/Samsung/weibo/people/徐圣佑/image";
$video_dir = "/Volumes/Samsung/weibo/video";
$image_dir = "/Volumes/Samsung/weibo/image";
$video_dir = "/Volumes/Samsung/weibo/video/短短";
$image_dir = "/Volumes/Samsung/weibo/image/短短";
try {
if (strlen($content) > 0) {
@ -41,10 +41,10 @@ class WeiboService
continue;
}
$mblog = $card['mblog'];
$subdir = "data/video";
if (!file_exists($subdir)) {
mkdir($subdir);
}
// $subdir = "data/video";
// if (!file_exists($subdir)) {
// mkdir($subdir);
// }
echo json_encode($mblog);
if (array_key_exists("pics", $mblog)) {
$pics = $mblog['pics'];


+ 6
- 6
app/Services/XiurenjiService.php View File

@ -11,8 +11,8 @@ use QL\QueryList;
class XiurenjiService
{
public $domainUrl = "https://www.xiurenji.cc";
public $xiurenRootUrl = "https://www.xiurenji.cc/XiuRen/";
public $domainUrl = "https://www.xiurenji.vip";
public $xiurenRootUrl = "https://www.xiurenji.vip/XiuRen/";
// public $rootDir = "/Users/shixuesen/Documents/tmp/xiuren/";
public $rootDir = "/Volumes/Backup/images/xiuren/";
// public $rootDir = "/Volumes/intel660p/image/xiuren/";
@ -26,7 +26,7 @@ class XiurenjiService
{
echo "111";
$pageSize = 20;
$pageCount = $this->getEncodeHtmlContent("https://www.xiurenji.cc/XiuRen/index.html")->find(".page span")->htmls()->get(0);
$pageCount = $this->getEncodeHtmlContent("https://www.xiurenji.vip/XiuRen/index.html")->find(".page span")->htmls()->get(0);
print_r($pageCount);
if ((int)$pageCount > 0) {
$pageCount = 40;
@ -116,7 +116,7 @@ class XiurenjiService
usleep(random_int(10, 100) * 100);
$imageUrl = $image->getAttribute("src");
$trueImageUrl = "https://x1.plmn5.com/U". substr($imageUrl, 2);
$trueImageUrl = "https://www.xiurenji.cc" . $imageUrl;
$trueImageUrl = "https://www.xiurenji.vip" . $imageUrl;
$fileInfo = pathinfo($trueImageUrl);
if (file_exists($dir . "/" .$fileInfo["basename"])) {
rename($dir . "/" . $fileInfo["basename"], $dir . "/" . $imageNo . "-" . $fileInfo["basename"]);
@ -195,7 +195,7 @@ class XiurenjiService
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_HTTPHEADER => array(
'authority: www.xiurenji.cc',
'authority: www.xiurenji.vip',
'pragma: no-cache',
'cache-control: no-cache',
'sec-ch-ua: " Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"',
@ -207,7 +207,7 @@ class XiurenjiService
'sec-fetch-mode: navigate',
'sec-fetch-user: ?1',
'sec-fetch-dest: document',
'referer: https://www.xiurenji.cc/XiuRen/',
'referer: https://www.xiurenji.vip/XiuRen/',
'accept-language: zh-CN,zh;q=0.9',
'cookie: UM_distinctid=177fd93a0ca93c-06b94658d5d337-121a4759-13c680-177fd93a0cbcaf; ASPSESSIONIDCATDQACD=FDPMPCLAMHNCPJFCBLKFLCKH; CNZZDATA1278618868=367774893-1614867004-%7C1625926983; __51cke__=; __tins__20641871=%7B%22sid%22%3A%201625931982756%2C%20%22vd%22%3A%203%2C%20%22expires%22%3A%201625933829110%7D; __51laig__=7'
),


+ 50
- 0
app/Utils/CommonUtils.php View File

@ -2,6 +2,8 @@
namespace App\Utils;
use Exception;
use Google\Auth\Credentials\UserRefreshCredentials;
use Google\Auth\OAuth2;
use Illuminate\Support\Facades\Log;
class CommonUtils {
@ -12,5 +14,53 @@ class CommonUtils {
Log::error("sleep error message: {$e}");
}
}
public static function connectWithGooglePhotos(array $scopes, $redirectURI)
{
$clientSecretJson = json_decode(
file_get_contents('../../client_secret.json'),
true
)['web'];
$clientId = $clientSecretJson['client_id'];
$clientSecret = $clientSecretJson['client_secret'];
$oauth2 = new OAuth2([
'clientId' => $clientId,
'clientSecret' => $clientSecret,
'authorizationUri' => 'https://accounts.google.com/o/oauth2/v2/auth',
// Where to return the user to if they accept your request to access their account.
// You must authorize this URI in the Google API Console.
'redirectUri' => $redirectURI,
'tokenCredentialUri' => 'https://www.googleapis.com/oauth2/v4/token',
'scope' => $scopes,
'expiry' => \Google\Auth\OAuth2::DEFAULT_EXPIRY_SECONDS *24
]);
// The authorization URI will, upon redirecting, return a parameter called code.
if (!isset($_GET['code'])) {
$authenticationUrl = $oauth2->buildFullAuthorizationUri(['access_type' => 'offline']);
header("Location: " . $authenticationUrl);
} else {
// With the code returned by the OAuth flow, we can retrieve the refresh token.
$oauth2->setCode($_GET['code']);
$authToken = $oauth2->fetchAuthToken();
$refreshToken = $authToken['access_token'];
// The UserRefreshCredentials will use the refresh token to 'refresh' the credentials when
// they expire.
$_SESSION['credentials'] = new UserRefreshCredentials(
$scopes,
[
'client_id' => $clientId,
'client_secret' => $clientSecret,
'refresh_token' => $refreshToken
]
);
// Return the user to the home page.
redirect('/google/home/index');
// header("Location: index.php");
}
}
}

+ 66
- 0
app/Utils/helper.php View File

@ -0,0 +1,66 @@
<?php
use Google\Auth\Credentials\UserRefreshCredentials;
use Google\Auth\HttpHandler\Guzzle7HttpHandler;
use Google\Auth\OAuth2;
use GuzzleHttp\Client;
function connectWithGooglePhotos($request, array $scopes, $redirectURI)
{
$clientSecretJson = json_decode(
file_get_contents('client_secret_1000190146810-j9mohjt8m4m8j8sj6hupl1bghp6o1pdn.apps.googleusercontent.com.json'),
true
)['web'];
// dump($clientSecretJson);exit;
$clientId = $clientSecretJson['client_id'];
$clientSecret = $clientSecretJson['client_secret'];
$oauth2 = new OAuth2([
'clientId' => $clientId,
'clientSecret' => $clientSecret,
'authorizationUri' => 'https://accounts.google.com/o/oauth2/v2/auth',
// Where to return the user to if they accept your request to access their account.
// You must authorize this URI in the Google API Console.
'redirectUri' => $redirectURI,
'tokenCredentialUri' => 'https://www.googleapis.com/oauth2/v4/token',
'scope' => $scopes,
'expiry' => \Google\Auth\OAuth2::DEFAULT_EXPIRY_SECONDS *24
]);
$client = new Client(['proxy' => 'http://127.0.0.1:1087']);
$httpHandler = new Guzzle7HttpHandler($client);
// The authorization URI will, upon redirecting, return a parameter called code.
$code = $request->get('code');
if ($code == null || $code == "") {
$authenticationUrl = $oauth2->buildFullAuthorizationUri(['access_type' => 'offline']);
// dump($authenticationUrl);
// redirect($authenticationUrl);
header("Location: " . $authenticationUrl);
// redirect()->to($authenticationUrl);
} else {
dump("code is " . $code);
// With the code returned by the OAuth flow, we can retrieve the refresh token.
$oauth2->setCode($code);
$authToken = $oauth2->fetchAuthToken();
$refreshToken = $authToken['access_token'];
// The UserRefreshCredentials will use the refresh token to 'refresh' the credentials when
// they expire.
$credentials = new UserRefreshCredentials(
$scopes,
[
'client_id' => $clientId,
'client_secret' => $clientSecret,
'refresh_token' => $refreshToken
]
);
session(['credentials' => $credentials]);
// Return the user to the home page.
dump("before redirect");
redirect('google/home/index');
// header("Location: index.php");
}
}

+ 1
- 0
client_secret.json View File

@ -0,0 +1 @@
{"web":{"client_id":"1000190146810-j9mohjt8m4m8j8sj6hupl1bghp6o1pdn.apps.googleusercontent.com","project_id":"photo1-1584853697553","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"oSPGIFy-Z_z92IG9iT03Dhor","redirect_uris":["http://localhost:8080/oauth2callback","http://localhost:1234/albums/connect.php","http://localhost:1234/filters/connect.php","https://ins.app/google/photo/connect"]}}

+ 4
- 0
composer.json View File

@ -16,6 +16,7 @@
"encore/laravel-admin": "^1.7",
"fideloper/proxy": "^4.0",
"google/apiclient": "^2.0",
"google/photos-library": "^1.6",
"guzzlehttp/guzzle": "~6.0",
"jaeger/querylist": "^4.1",
"james-heinrich/getid3": "^1.9",
@ -63,6 +64,9 @@
"classmap": [
"database/seeds",
"database/factories"
],
"files": [
"app/Utils/helper.php"
]
},
"autoload-dev": {


+ 1582
- 889
composer.lock
File diff suppressed because it is too large
View File


+ 2
- 0
config/app.php View File

@ -123,6 +123,8 @@ return [
'cipher' => 'AES-256-CBC',
'albums_authentication_redirect_url' => env('albums_authentication_redirect_url'),
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers


+ 8
- 0
fail.log View File

@ -2359,3 +2359,11 @@
/Users/shixuesen/OneDrive/Pictures/instagram/sharalinmusic/ https://scontent-lax3-1.cdninstagram.com/v/t50.12441-16/240619062_127369326282806_1269662062799596549_n.mp4?efg=eyJ2ZW5jb2RlX3RhZyI6InZ0c192b2RfdXJsZ2VuLjcyMC5zdG9yeS5iYXNlbGluZSJ9&_nc_ht=scontent-lax3-1.cdninstagram.com&_nc_cat=102&_nc_ohc=UpU7tuZFnfAAX_IajUt&edm=AOVtZ6oBAAAA&vs=300247991857288_2891961278&_nc_vs=HBkcFQAYJEdEYU9WdzQyeUhKNzEzTUFBQVdzOVUzcnZwNFJicGt3QUFBRhUAAsgBACgAGAAbAYgHdXNlX29pbAExFQAAJsiiudS6%2F8c%2FFQIoAkMzLBdAKO6XjU%2FfOxgSZGFzaF9iYXNlbGluZV8yX3YxEQB16AcA&_nc_rid=25fcb41fb7&ccb=7-4&oe=61267E05&oh=25d27fd252c98536d3e77c025fc065f9&_nc_sid=bab638
/Users/shixuesen/OneDrive/Pictures/instagram/amandacerny/ https://scontent-lax3-1.cdninstagram.com/v/t50.2886-16/10000000_139543141668053_2611204976473764495_n.mp4?efg=eyJ2ZW5jb2RlX3RhZyI6InZ0c192b2RfdXJsZ2VuLjcyMC5jbGlwcy5iYXNlbGluZSJ9&_nc_ht=scontent-lax3-1.cdninstagram.com&_nc_cat=105&_nc_ohc=F9sacvi--MQAX82QYKc&edm=ABmJApABAAAA&vs=1172788593228470_431478627&_nc_vs=HBksFQAYJEdJQ1dtQURWMUdQcjZYNEFBSTl5YzJJWDNUd2ticV9FQUFBRhUAAsgBABUAGCRHSzVyVlE2aWJueEFFS0lEQUo3aFpuMkRDWlprYnFfRUFBQUYVAgLIAQAoABgAGwGIB3VzZV9vaWwBMBUAACaQwfXc8OLPPxUCKAJDMywXQEXZmZmZmZoYEmRhc2hfYmFzZWxpbmVfMV92MREAdf4HAA%3D%3D&_nc_rid=9d9e7b5a95&ccb=7-4&oe=6126E75D&oh=42aa5d53f4ce1fa596adec6911173ba9&_nc_sid=6136e7
/Users/shixuesen/OneDrive/Pictures/instagram/weiman_the_real_one/ https://scontent-lax3-2.cdninstagram.com/v/t51.2885-15/e35/240929191_360046995581239_7835808278865687311_n.jpg?se=7&_nc_ht=scontent-lax3-2.cdninstagram.com&_nc_cat=107&_nc_ohc=VecQ6GIt44QAX8CH7A6&edm=ABmJApABAAAA&ccb=7-4&oh=a9f484adbe964e41348044c550c6edfa&oe=6136BBAF&_nc_sid=6136e7&ig_cache_key=MjY1MjQwNDE5Njc2MTY3NDk5MA%3D%3D.2-ccb7-4
/Users/shixuesen/OneDrive/Pictures/instagram/mobe_carrie0223/ https://scontent-lax3-2.cdninstagram.com/v/t50.2886-16/241061088_397577785043235_4888341887987473706_n.mp4?efg=eyJ2ZW5jb2RlX3RhZyI6InZ0c192b2RfdXJsZ2VuLjcyMC5mZWVkLmRlZmF1bHQifQ&_nc_ht=scontent-lax3-2.cdninstagram.com&_nc_cat=103&_nc_ohc=yH1xxm1shN0AX9PHSwF&edm=ABmJApABAAAA&vs=17994837586369884_601349238&_nc_vs=HBksFQAYJEdPQk1YZzRqNmFWS21Ha0JBQ3JkSnk0TTRkWkRia1lMQUFBRhUAAsgBABUAGCRHRXhIWGc3U1h1U2c0WjhCQU9udUxfX3ZLMlpUYmtZTEFBQUYVAgLIAQAoABgAGwGIB3VzZV9vaWwBMBUAACbg%2B8KKuqTaPxUCKAJDMywXQEARBiTdLxsYEmRhc2hfYmFzZWxpbmVfMV92MREAdeoHAA%3D%3D&_nc_rid=ad795d1515&ccb=7-4&oe=613AAFE1&oh=f0b8c34400640edac08909714474ebbe&_nc_sid=6136e7
/Users/shixuesen/OneDrive/Pictures/instagram/mobe_carrie0223/ https://scontent-lax3-2.cdninstagram.com/v/t51.2885-15/e35/241043965_594222575080392_4943529006986666544_n.jpg?se=7&_nc_ht=scontent-lax3-2.cdninstagram.com&_nc_cat=100&_nc_ohc=F6U0IBkXFI8AX_5-Wei&edm=ABmJApABAAAA&ccb=7-4&oh=d7be4c433757af3cc2b0d2bb0a28f83e&oe=613F0971&_nc_sid=6136e7&ig_cache_key=MjY1NDQ4ODgwMDE5MDIyOTM1OA%3D%3D.2-ccb7-4
/Users/shixuesen/OneDrive/Pictures/instagram/mobe_carrie0223/ https://scontent-lax3-2.cdninstagram.com/v/t51.2885-15/e35/217951073_4526813404010159_2284524917321461749_n.jpg?se=7&_nc_ht=scontent-lax3-2.cdninstagram.com&_nc_cat=111&_nc_ohc=UE_KpXwvaS8AX8P6eYf&edm=ABmJApABAAAA&ccb=7-4&oh=2f8d60dbf7293c6d0cab793aeded7a33&oe=613EE4FD&_nc_sid=6136e7&ig_cache_key=MjYxNzY0NTY5MTE5Nzg4MTM5OQ%3D%3D.2-ccb7-4
/Users/shixuesen/OneDrive/Pictures/instagram/jennawang525/ https://scontent-hou1-1.cdninstagram.com/v/t50.12441-16/242397379_1029576921211458_165289030188636679_n.mp4?efg=eyJ2ZW5jb2RlX3RhZyI6InZ0c192b2RfdXJsZ2VuLjcyMC5zdG9yeS5iYXNlbGluZSJ9&_nc_ht=scontent-hou1-1.cdninstagram.com&_nc_cat=106&_nc_ohc=WWLWQqHiBUkAX_VrkBe&edm=AOVtZ6oBAAAA&vs=287262772876184_2279277801&_nc_vs=HBksFQAYJEdNT3djZzVDWXFnT1phZ0RBQWVhcVVsLU9Vc0NicGt3QUFBRhUAAsgBABUAGCRHQ19tY2c2TTdYUzdOSGNCQURFWnNUUXg5NUFiYnBrd0FBQUYVAgLIAQAoABgAGwGIB3VzZV9vaWwBMRUAACaileL9%2BNjYPxUCKAJDMywXQByp%2B%2Bdsi0QYEmRhc2hfYmFzZWxpbmVfMl92MREAdegHAA%3D%3D&_nc_rid=d50c4e6986&ccb=7-4&oe=614BA103&oh=d13378fa2440f27104506f395a4bbb2b&_nc_sid=bab638&_nc_vts_prog=1
/Users/shixuesen/OneDrive/Pictures/instagram/isangelc/ https://scontent-hou1-1.cdninstagram.com/v/t50.12441-16/242274385_817169532301913_8458841233011757105_n.mp4?efg=eyJ2ZW5jb2RlX3RhZyI6InZ0c192b2RfdXJsZ2VuLjcyMC5zdG9yeS5iYXNlbGluZSJ9&_nc_ht=scontent-hou1-1.cdninstagram.com&_nc_cat=105&_nc_ohc=5XIp3w3x5V8AX8i-vi5&edm=AOVtZ6oBAAAA&vs=376874350653247_4082043071&_nc_vs=HBksFQAYJEdGSFFjQTVac3JFYk51Y0NBREhRRjlsSTEyTjFicGt3QUFBRhUAAsgBABUAGCRHSFpqY3c2OTBkVnVxS0lBQUlJdlZ2S1FpQlVQYnBrd0FBQUYVAgLIAQAoABgAGwGIB3VzZV9vaWwBMRUAACbM%2B7GVuNqjQBUCKAJDMywXQCa7ZFocrAgYEmRhc2hfYmFzZWxpbmVfM192MREAdegHAA%3D%3D&_nc_rid=95787a2e67&ccb=7-4&oe=614B8EF5&oh=3fd3ffade83d957a51d4a1e0ac34c9a6&_nc_sid=bab638&_nc_vts_prog=1
/Users/shixuesen/OneDrive/Pictures/instagram/Likes/ https://scontent-hou1-1.cdninstagram.com/v/t50.2886-16/241762732_1964324837074509_774784568224117860_n.mp4?efg=eyJ2ZW5jb2RlX3RhZyI6InZ0c192b2RfdXJsZ2VuLjcyMC5jbGlwcy5iYXNlbGluZSJ9&_nc_ht=scontent-hou1-1.cdninstagram.com&_nc_cat=109&_nc_ohc=N9DD3lRyousAX_QFU4v&edm=APv5SkIBAAAA&vs=4673620266004604_404870497&_nc_vs=HBksFQAYJEdLd0JhUTVOSmlNRWktb0dBR1QwYzdaMWxzQUticV9FQUFBRhUAAsgBABUAGCRHRWF6YkE1eFF2ZTFTclVLQUpFa3JMcVdhYXhrYnFfRUFBQUYVAgLIAQAoABgAGwGIB3VzZV9vaWwBMBUAACaWooW49ojAPxUCKAJDMywXQDh3S8an754YEmRhc2hfYmFzZWxpbmVfMV92MREAdf4HAA%3D%3D&_nc_rid=d723adebfb&ccb=7-4&oe=614BCF7A&oh=8ac8eec40dcbf473a4cd1be58cf87bae&_nc_sid=7479f6&_nc_vts_prog=1
/Users/shixuesen/OneDrive/Pictures/instagram/amandacerny/ https://scontent-lax3-2.cdninstagram.com/v/t50.2886-16/10000000_883442198956439_8683797876571381447_n.mp4?efg=eyJ2ZW5jb2RlX3RhZyI6InZ0c192b2RfdXJsZ2VuLjcyMC5jbGlwcy5iYXNlbGluZSJ9&_nc_ht=scontent-lax3-2.cdninstagram.com&_nc_cat=111&_nc_ohc=Q2AU_wkOa0MAX_WJSHl&edm=ABmJApABAAAA&vs=1259518084493797_2953349738&_nc_vs=HBksFQAYJEdJQ1dtQUNYeVhKcWZDTURBTWNlVlBZb0RJTjRicV9FQUFBRhUAAsgBABUAGCRHQlhoamc1QnV1MkRfQ1VEQUNQVFdYS1E3c3N3YnFfRUFBQUYVAgLIAQAoABgAGwGIB3VzZV9vaWwBMBUAACbOw6C3587UQBUCKAJDMywXQE33bItDlYEYEmRhc2hfYmFzZWxpbmVfMV92MREAdf4HAA%3D%3D&_nc_rid=d5b0d6ea86&ccb=7-4&oe=615A976F&oh=c4309eca4f320f1be60162f583a3916b&_nc_sid=6136e7&_nc_vts_prog=1&vts=1
/Users/shixuesen/OneDrive/Pictures/instagram/duyenn.hipp/ https://scontent-lax3-2.cdninstagram.com/v/t50.2886-16/10000000_176342064645864_2852026291184528688_n.mp4?efg=eyJ2ZW5jb2RlX3RhZyI6InZ0c192b2RfdXJsZ2VuLjcyMC5jbGlwcy5iYXNlbGluZSJ9&_nc_ht=scontent-lax3-2.cdninstagram.com&_nc_cat=100&_nc_ohc=qe8GVaDHk3QAX9EyIvK&edm=ABmJApABAAAA&vs=849539289092317_145701975&_nc_vs=HBksFQAYJEdJQ1dtQURvUmgtV1lhQUFBRER0SUJqTmJwUW5icV9FQUFBRhUAAsgBABUAGCRHTE02aGc1NExvbmdEU29DQUFVMU5lX3ZKRVlsYnFfRUFBQUYVAgLIAQAoABgAGwGIB3VzZV9vaWwBMBUAACaIzPzNpqjKPxUCKAJDMywXQEHu2RaHKwIYEmRhc2hfYmFzZWxpbmVfMV92MREAdf4HAA%3D%3D&_nc_rid=c41d35b8b4&ccb=7-4&oe=615BC281&oh=561814cc07a557468062c6c7770dad9f&_nc_sid=6136e7&_nc_vts_prog=1&vts=1

+ 11156
- 10925
package-lock.json
File diff suppressed because it is too large
View File


+ 6
- 3
package.json View File

@ -10,6 +10,7 @@
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"@babel/preset-react": "^7.0.0",
"autoprefixer": "^10.2.4",
"axios": "^0.18",
"bootstrap": "^4.0.0",
@ -19,10 +20,12 @@
"lodash": "^4.17.5",
"popper.js": "^1.12",
"postcss": "^8.2.6",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"resolve-url-loader": "^2.3.1",
"sass": "^1.15.2",
"sass-loader": "^7.1.0",
"tailwindcss": "^2.0.3",
"vue": "^2.5.17"
}
"tailwindcss": "^2.0.3"
},
"dependencies": {}
}

+ 1
- 0
public/client_secret.json View File

@ -0,0 +1 @@
{"web":{"client_id":"1000190146810-j9mohjt8m4m8j8sj6hupl1bghp6o1pdn.apps.googleusercontent.com","project_id":"photo1-1584853697553","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"oSPGIFy-Z_z92IG9iT03Dhor","redirect_uris":["http://localhost:8080/oauth2callback","http://localhost:1234/albums/connect.php","http://localhost:1234/filters/connect.php","https://ins.app/google/photo/connect"]}}

+ 1
- 0
public/client_secret_1000190146810-j9mohjt8m4m8j8sj6hupl1bghp6o1pdn.apps.googleusercontent.com.json View File

@ -0,0 +1 @@
{"web":{"client_id":"1000190146810-j9mohjt8m4m8j8sj6hupl1bghp6o1pdn.apps.googleusercontent.com","project_id":"photo1-1584853697553","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"oSPGIFy-Z_z92IG9iT03Dhor","redirect_uris":["http://localhost:8080/oauth2callback","http://localhost:1234/albums/connect.php","http://localhost:1234/filters/connect.php","https://ins.app/google/photo/connect","http://localhost:1234/google/photo/connect"]}}

+ 10947
- 15
public/css/app.css
File diff suppressed because it is too large
View File


+ 65794
- 1
public/js/app.js
File diff suppressed because it is too large
View File


+ 4
- 0
public/mix-manifest.json View File

@ -0,0 +1,4 @@
{
"/js/app.js": "/js/app.js",
"/css/app.css": "/css/app.css"
}

+ 4
- 21
resources/js/app.js View File

@ -1,33 +1,16 @@
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
* includes React and other helpers. It's a great starting point while
* building robust, powerful web applications using React + Laravel.
*/
require('./bootstrap');
window.Vue = require('vue');
/**
* The following block of code may be used to automatically register your
* Vue components. It will recursively scan this directory for the Vue
* components and automatically register them with their "basename".
*
* Eg. ./components/ExampleComponent.vue -> <example-component></example-component>
*/
// const files = require.context('./', true, /\.vue$/i)
// files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default))
Vue.component('example-component', require('./components/ExampleComponent.vue').default);
/**
* Next, we will create a fresh Vue application instance and attach it to
* Next, we will create a fresh React component instance and attach it to
* the page. Then, you may begin adding components to this application
* or customize the JavaScript scaffolding to fit your unique needs.
*/
const app = new Vue({
el: '#app'
});
require('./components/Example');

+ 26
- 0
resources/js/components/Example.js View File

@ -0,0 +1,26 @@
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
export default class Example extends Component {
render() {
return (
<div className="container">
<div className="row justify-content-center">
<div className="col-md-8">
<div className="card">
<div className="card-header">Example Component</div>
<div className="card-body">
I'm an example component!
</div>
</div>
</div>
</div>
</div>
);
}
}
if (document.getElementById('example')) {
ReactDOM.render(<Example />, document.getElementById('example'));
}

+ 0
- 23
resources/js/components/ExampleComponent.vue View File

@ -1,23 +0,0 @@
<template>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card card-default">
<div class="card-header">Example Component</div>
<div class="card-body">
I'm an example component.
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
mounted() {
console.log('Component mounted.')
}
}
</script>

+ 36
- 0
resources/views/albums/connect.blade.php View File

@ -0,0 +1,36 @@
<?php
/**
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//$this->layout('template', ['title' => 'Connect with Google Photos'])
?>
<div id="intro">
<h4>Google Photos Library API sample</h4>
<img src="http://www.baidu.com" alt="">
<h2>Title</h2>
<p>This sample will cover</p>
<ul>
<li>Connecting to a Google Photos Library</li>
<li>Requesting scopes from a Google Photos user</li>
<li>Read the entire library</li>
<li>Apply filters to a library</li>
</ul>
<a class="connect-btn" href="/google/photo/connect">
<img src="../common/google_photos_logo.png">
Connect to Google Photos
</a>
</div>

+ 62
- 0
resources/views/albums/index.blade.php View File

@ -0,0 +1,62 @@
<?php
/**
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//$this->layout('template', ['title' => 'Photos Library API PHP Sample', 'additionalStylesheets' => ['views/style.css']])
<dialog class="mdl-dialog">
<h4 class="mdl-dialog__title">Create a new album</h4>
<form action="album.php">
<div class="mdl-dialog__content">
<div class="mdl-textfield mdl-js-textfield">
<input type="text" class="mdl-textfield__input" name="create" id="create"/>
<label for="create" class="mdl-textfield__label">Title</label>
</div>
</div>
<div class="mdl-dialog__actions">
<button class="mdl-button">Create</button>
<a class="mdl-button close">Cancel</a>
</div>
</form>
</dialog>
<div class="mdl-grid">
<div class="mdl-cell mdl-cell--12-col description">
<h3>This is your Google Photos library</h3>
<p>You've used the <span class="code">photoslibrary</span> scope to view the albums in the
user's library.</p>
<p>Use the create action to add a new album.</p>
<button id='create-btn' class="mdl-button mdl-button--raised mdl-button--colored">Create</button>
</div>
<?php $this->insert('album_grid', ['albums' => $albums, 'photoLink' => 'album.php']);?>
<!-- --><?php //$this->insert('image_grid', ['mediaItems' => $mediaItems]); ?>
</div>
<script>
var dialog = document.querySelector('dialog');
var showModalButton = document.querySelector('#create-btn');
showModalButton.addEventListener('click', function() {
dialog.showModal();
});
dialog.querySelector('.close').addEventListener('click', function() {
dialog.close();
});
</script>

+ 2
- 0
routes/web.php View File

@ -9,5 +9,7 @@ Route::get('/instagram', 'InstagramController@index');
Route::post('api/receiveCookie', 'BiCookiesController@receiveCookie');
Route::get('api/weibo/list', 'WeiboController@list');
Route::post('api/weibo/store', 'WeiboController@store');
Route::get('google/photo/connect', 'GooglePhotoController@connect');
Route::get('google/photo/index', 'GooglePhotoController@index');

+ 1
- 1
webpack.mix.js View File

@ -11,5 +11,5 @@ const mix = require('laravel-mix');
|
*/
mix.js('resources/js/app.js', 'public/js')
mix.react('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');

+ 0
- 5624
yarn.lock
File diff suppressed because it is too large
View File


Loading…
Cancel
Save