<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Services\WeiboService;
|
|
use App\Weibo;
|
|
use Illuminate\Http\Request;
|
|
|
|
class WeiboController extends Controller {
|
|
/**
|
|
* Display a listing of the resource.
|
|
*
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function index() {
|
|
//
|
|
}
|
|
|
|
public function list(Request $request) {
|
|
|
|
$size = $request->get("size", 5);
|
|
|
|
// https://m.weibo.cn/api/container/getIndex?containerid=1076035123577126&openApp=0&page='.$i;
|
|
// Fan_Cam_4K 1076035733650527 page 902
|
|
// 儒雅随和 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=
|
|
// 物理 2304133907143723
|
|
|
|
// 230259 自己
|
|
// 轮子哥 2304131916825084
|
|
// 徐圣佑 5893812490
|
|
// 徐圣佑- 新号 1076035893812490
|
|
// Afreecatv 精选 1076037383142802
|
|
// AF-录制 1076037627445357
|
|
// 录像专用小马甲 1076033785550287
|
|
// 录像专用小马甲1 1076037453003153
|
|
// 录像专用小马甲2 1076036637436995
|
|
$list = [
|
|
// "tu是真的tu" => "1076032267562540",
|
|
"自己" => "230259",
|
|
"轮子哥" => "2304131916825084",
|
|
"徐圣佑- 新号" => "1076035893812490",
|
|
"Afreecatv 精选" => "1076037383142802",
|
|
"AF-录制" => "1076037627445357",
|
|
"录像专用小马甲" => "1076033785550287",
|
|
"录像专用小马甲1" => "1076037453003153",
|
|
"录像专用小马甲2" => "1076036637436995",
|
|
"短短" => "1076032137020951",
|
|
"物理" => "2304133907143723",
|
|
"亲亲奥利给 af" => "1005056070814923",
|
|
"FanCam_" => "1076032740158183",
|
|
"ParmyAU" => "1076032482381165",
|
|
"热舞托管站" => "1076037422251891",
|
|
"af尼美舞蹈" => "1076035639898367",
|
|
"傲娇的猫猫猫" => "1076033118852135",
|
|
"绅士甄选" => "1076037644465107",
|
|
"Win话事人" => "1076032439815352",
|
|
"粤上秋璃子" => "1076037747006685",
|
|
"腐团儿" => "1076032304291523",
|
|
"聂小雨" => "1076032579189065",
|
|
"小何同学" => "1076032104580380",
|
|
"只有一个9521" => "1076037504338957",
|
|
"娜扎工作室" => "2304136001863056",
|
|
"刘教師特别授業" => "1076037686776705",
|
|
"Nana姐姐的微博" => "1076037764879728",
|
|
"小蓝蓝 plus" => "1076037409360499",
|
|
"露露" => "1076037731119705",
|
|
"小仓" => "1076036880826706",
|
|
"EstheticBody" => "1076036577888143",
|
|
"kyokyo" => "1076032591431197",
|
|
"softygirls" => "1076035040459465",
|
|
"是你的程儿" => "1076037607376925",
|
|
"Kokuhui" => "1076037504965364",
|
|
"川" => "1076037648703289",
|
|
"小红帽舞托" => "2304137160189611",
|
|
"李一桐工作室" => "1076035973698579",
|
|
"李一桐" => "1076035372556014",
|
|
"Yukicai-" => "1076031035321575",
|
|
"知一呐" => "1076037458616069",
|
|
"" => "1076037040041221",
|
|
// "娜扎工作室" => "2304136001863056_-_WEIBO_SECOND_PROFILE_WEIBO",
|
|
|
|
];
|
|
|
|
$url = array();
|
|
|
|
// for( $i = 341; $i >= 1 ; $i-- )
|
|
// $url[] = 'https://m.weibo.cn/api/container/getIndex?containerid=1076035893812490&openApp=0&page='.$i;
|
|
// for( $i = 100; $i >= 1 ; $i-- )
|
|
// $url[] = 'https://m.weibo.cn/api/container/getIndex?containerid=2304133907143723&openApp=0&page='.$i;
|
|
// for ($i = 100; $i >= 1; $i--) {
|
|
// $url[] = 'https://m.weibo.cn/feed/group?gid=4423532052076817&&page=' . $i;
|
|
// }
|
|
foreach ($list as $key => $value) {
|
|
for ($i = $size; $i >= 1; $i--) {
|
|
$url[] = "https://m.weibo.cn/api/container/getIndex?containerid=$value&page=" . $i;
|
|
}
|
|
}
|
|
// for ($i = $size; $i >= 1; $i--) {
|
|
// $url[] = 'https://m.weibo.cn/api/container/getIndex?containerid=230259&page=' . $i;
|
|
// }
|
|
// for ($i = 20; $i >= 1; $i--) {
|
|
// $url[] = 'https://m.weibo.cn/api/container/getIndex?containerid=2304131916825084&page=' . $i;
|
|
// }
|
|
// for ($i = 20; $i >= 1; $i--) {
|
|
// $url[] = 'https://m.weibo.cn/api/container/getIndex?containerid=1076035893812490&page=' . $i;
|
|
// }
|
|
// for ($i = 20; $i >= 1; $i--) {
|
|
// $url[] = 'https://m.weibo.cn/api/container/getIndex?containerid=1076037383142802&page=' . $i;
|
|
// }
|
|
// for ($i = 20; $i >= 1; $i--) {
|
|
// $url[] = 'https://m.weibo.cn/api/container/getIndex?containerid=1076037627445357&page=' . $i;
|
|
// }
|
|
return response()->json($url);
|
|
}
|
|
|
|
/**
|
|
* Show the form for creating a new resource.
|
|
*
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function create() {
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Store a newly created resource in storage.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return \Illuminate\Http\JsonResponse
|
|
*/
|
|
public function store(Request $request) {
|
|
// die();
|
|
// Log::info($request->input());
|
|
$weibo = new WeiboService();
|
|
$result = $weibo->scrapeWeiboPicAndVideo($request->input("content"));
|
|
// $result = $weibo->scrapeGroupWeiboPicAndVideo($request->input("content"));
|
|
return response()->json($result);
|
|
}
|
|
|
|
/**
|
|
* Display the specified resource.
|
|
*
|
|
* @param \App\Weibo $weibo
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function show(Weibo $weibo) {
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Show the form for editing the specified resource.
|
|
*
|
|
* @param \App\Weibo $weibo
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function edit(Weibo $weibo) {
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Update the specified resource in storage.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @param \App\Weibo $weibo
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function update(Request $request, Weibo $weibo) {
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Remove the specified resource from storage.
|
|
*
|
|
* @param \App\Weibo $weibo
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function destroy(Weibo $weibo) {
|
|
//
|
|
}
|
|
}
|