TikTok Scraper task for Storyclash

Slobodan Todorov 94f4a795a5 Fixed documentation typo 6 yıl önce
app 6a72b7df28 Initial commit 6 yıl önce
bootstrap 6a72b7df28 Initial commit 6 yıl önce
config 6a72b7df28 Initial commit 6 yıl önce
database 6a72b7df28 Initial commit 6 yıl önce
public 6a72b7df28 Initial commit 6 yıl önce
resources 6a72b7df28 Initial commit 6 yıl önce
routes 6a72b7df28 Initial commit 6 yıl önce
storage 6a72b7df28 Initial commit 6 yıl önce
tests 6a72b7df28 Initial commit 6 yıl önce
.editorconfig 6a72b7df28 Initial commit 6 yıl önce
.env.example 6a72b7df28 Initial commit 6 yıl önce
.gitattributes 6a72b7df28 Initial commit 6 yıl önce
.gitignore 6a72b7df28 Initial commit 6 yıl önce
.styleci.yml 6a72b7df28 Initial commit 6 yıl önce
CHANGELOG.md 6a72b7df28 Initial commit 6 yıl önce
README.md 94f4a795a5 Fixed documentation typo 6 yıl önce
artisan 6a72b7df28 Initial commit 6 yıl önce
composer.json 6a72b7df28 Initial commit 6 yıl önce
composer.lock 6a72b7df28 Initial commit 6 yıl önce
package.json 6a72b7df28 Initial commit 6 yıl önce
phpunit.xml 6a72b7df28 Initial commit 6 yıl önce
server.php 6a72b7df28 Initial commit 6 yıl önce
webpack.mix.js 6a72b7df28 Initial commit 6 yıl önce

README.md

TikTok Scraper

Installation

TikTok Scraper requires some external libraries to be installed, prior to using it. Installation is simple, using Composer:

composer install

After installing required composer packages, you should run migrations, so that the required database structure is created. ou should create MySQL database on your desired server, and place the login credentials and database name into .env file, so Laravel can pick it up. After setting the database up, run

php artisan migrate

So that database is populated with necessary tables.

Running TikTok Scraper

TikTok Scraper is built to be run through artisan commands:

  • php artisan tiktok:getusers <user> [<user> [...]] - Supplied with the list of users, fetches data regarding that TikTok user.
  • php artisan tiktok:getvideos -f <file> - Fetches video data from the supplied file. For the correct format of the file, see storage/videos.json sample file.

Operation

As per requirements, the first run of getusers command, data is inserted into the database. On subsequent runs, existing data is updated, while new data is inserted.

When running getvideos, as with previous command, data is inserted on the first run, and updated on subsequent calls.

NOTE: If you run getvideos before running getusers, or the user doesn't exist in the database, video data insertion will fail due to foreign key constraints. This is by design, and should not be considered a bug.