GithubHelp home page GithubHelp logo

abilogos / digikala-blackfriday-scrap Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 384 KB

This Project is for digikala.com scrapping challenge of 2021 blackfriday using php/laravel/horizon

License: MIT License

Shell 0.78% PHP 83.40% Blade 15.82%
scraping blackfriday digikala

digikala-blackfriday-scrap's Introduction

Objective

This script is intended for finding the hidden treasure, A scraping challenge by digikala for 2021 black Friday

Prerequisites

  • Php
  • mysql
  • redis

How to install

after cloning, in the project base dir run:

composer install
cp ./.env.example ./.env

fill the required fields in the .env file, like:

DB_DATABASE=digikala_scrap
DB_USERNAME=root
DB_PASSWORD=
QUEUE_CONNECTION=redis

create the database accordingly & provide redis password if its needed any. then, migrate the tables:

php artisan migrate

How to run

Run

go to the treaseure hunting page, and find the page counts. (it was always 47)

you can run the project using this command:

php artisan scrap:digikala 47 && php artisan horizon

Monitor

you can see the running queue, if you want that, you have to serve the http kernel using:

php artisan serve

then visit the horizon dashboard page (usually served under localhost:8000 ) :

localhost:8000/horizon

Result

after horizon queue has get done, the treasure would be the last uploaded picture (by the number field) you can fetch the picture's url by logging in to your mysql dbms, then:

use digikala_scrap;
SELECT src FROM `pictures` ORDER BY number DESC limit 1;

you can browse the url

digikala-blackfriday-scrap's People

Contributors

abilogos avatar leylalogos avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.