mirror of
https://github.com/pablouser1/ProxiTok.git
synced 2024-12-06 19:27:30 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5dea2468f8 | |||
| e8ec0ab293 | |||
| 78fe44070c |
@@ -3,16 +3,16 @@ namespace App\Controllers;
|
||||
|
||||
use App\Helpers\ErrorHandler;
|
||||
use App\Helpers\Wrappers;
|
||||
use App\Models\FeedTemplate;
|
||||
use App\Models\DiscoverTemplate;
|
||||
|
||||
class DiscoverController {
|
||||
static public function get() {
|
||||
$api = Wrappers::api();
|
||||
$feed = $api->discover();
|
||||
if ($feed->meta->success) {
|
||||
Wrappers::latte('discover', new FeedTemplate('Discover', $feed));
|
||||
$data = $api->discover();
|
||||
if ($data->meta->success) {
|
||||
Wrappers::latte('discover', new DiscoverTemplate($data));
|
||||
} else {
|
||||
ErrorHandler::showMeta($feed->meta);
|
||||
ErrorHandler::showMeta($data->meta);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,10 +18,6 @@ class UserController {
|
||||
if ($user->ok()) {
|
||||
$info = $user->getInfo();
|
||||
$feed = $user->getFeed();
|
||||
if ($info->detail->privateAccount) {
|
||||
ErrorHandler::showText(401, "Private account detected! Not supported");
|
||||
return;
|
||||
}
|
||||
Wrappers::latte('user', new FullTemplate($info->detail->nickname, $info, $feed));
|
||||
} else {
|
||||
ErrorHandler::showMeta($user->error());
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
|
||||
use TikScraper\Models\Discover;
|
||||
|
||||
class DiscoverTemplate extends BaseTemplate {
|
||||
public Discover $data;
|
||||
|
||||
function __construct(Discover $data) {
|
||||
parent::__construct("Discover");
|
||||
$this->data = $data;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
|
||||
use TikScraper\Models\Feed;
|
||||
|
||||
/**
|
||||
* Base for templates with a feed
|
||||
*/
|
||||
class FeedTemplate extends BaseTemplate {
|
||||
public object $data;
|
||||
public Feed $feed;
|
||||
|
||||
function __construct(string $title, object $feed) {
|
||||
function __construct(string $title, Feed $feed) {
|
||||
parent::__construct($title);
|
||||
$this->data = (object) [
|
||||
'feed' => $feed
|
||||
];
|
||||
$this->feed = $feed;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "pablouser1/proxitok",
|
||||
"description": "An alternative frontend for TikTok",
|
||||
"version": "2.4.4.3",
|
||||
"version": "2.4.6.0",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"type": "project",
|
||||
"authors": [
|
||||
|
||||
Generated
+7
-7
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "acb47eb00001b55dbf6825b0ce79cd0b",
|
||||
"content-hash": "8536364f5905bc49a9a88d4fa3daa3be",
|
||||
"packages": [
|
||||
{
|
||||
"name": "bramus/router",
|
||||
@@ -263,16 +263,16 @@
|
||||
},
|
||||
{
|
||||
"name": "pablouser1/tikscraper",
|
||||
"version": "v2.3.3.5",
|
||||
"version": "v2.3.4.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pablouser1/TikScraperPHP.git",
|
||||
"reference": "d3b51e6e0fab4cacce27dbbdf76bcb6fa8bf41ef"
|
||||
"reference": "4426ee91c13b4661fd11e1d3f4b5da33c64fbc75"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/d3b51e6e0fab4cacce27dbbdf76bcb6fa8bf41ef",
|
||||
"reference": "d3b51e6e0fab4cacce27dbbdf76bcb6fa8bf41ef",
|
||||
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/4426ee91c13b4661fd11e1d3f4b5da33c64fbc75",
|
||||
"reference": "4426ee91c13b4661fd11e1d3f4b5da33c64fbc75",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -305,9 +305,9 @@
|
||||
"description": "Get data from TikTok API",
|
||||
"support": {
|
||||
"issues": "https://github.com/pablouser1/TikScraperPHP/issues",
|
||||
"source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.3.3.5"
|
||||
"source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.3.4.1"
|
||||
},
|
||||
"time": "2023-01-26T16:19:23+00:00"
|
||||
"time": "2023-01-28T16:31:29+00:00"
|
||||
},
|
||||
{
|
||||
"name": "php-webdriver/webdriver",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div n:ifset="$info" class="buttons">
|
||||
<div class="buttons">
|
||||
{* is_numeric is used to avoid having a back button with ttwid cursors *}
|
||||
{if isset($_GET['cursor']) && is_numeric($_GET['cursor']) && $_GET['cursor'] != 0}
|
||||
<a class="button is-danger" href="?cursor=0">First</a>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{/block}
|
||||
|
||||
{block content}
|
||||
{foreach $data->feed->items as $type => $items}
|
||||
{foreach $data->items as $type => $items}
|
||||
<p class="title">{$type|firstUpper}</p>
|
||||
<div class="columns is-multiline is-vcentered">
|
||||
{foreach $items as $item}
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
</figure>
|
||||
<p class="title">{$info->detail->uniqueId}</p>
|
||||
<p class="subtitle">{include '../components/rss.latte'}</p>
|
||||
{if $info->detail->privateAccount}
|
||||
<p><strong>Private account</strong></p>
|
||||
{/if}
|
||||
<p></p>
|
||||
<p>{$info->detail->signature}</p>
|
||||
<p>Following: {number($info->stats->followingCount)} / Followers: {number($info->stats->followerCount)}</p>
|
||||
<p>Hearts: {number($info->stats->heartCount)} / Videos: {$info->stats->videoCount}</p>
|
||||
|
||||
Reference in New Issue
Block a user