Write PHP script to Get Video Details

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 1
Joined: Sat Oct 09, 2021 6:42 am

Sat Oct 09, 2021 6:47 am

Write a PHP script that opens a youtube video URL and finds the following details:

1. TItle of Video

2. Description of Video

3. Duration of Video

4. No. of Views

5. No. of Likes

6. No. of Dislikes

7. Upload Date

8. No. of Comments

9. Is the Channel Verified

10. No. Of subscribers of channel

11. Links in description (if any)

Please note that the number of subscribers may not be exact on the video page, so please extract the number of subscribers as an approximation from the video page, for example if the number is 234K, please extract it as 234000 and do not try to get subscriber count from the channel page.

- Use CURL to open page with proper headers

- Use DomDocument for parsing the page, you may use xpath

- Write clean code with 4 space tab as standard

- Ensure you follow PSR standard

- Use PascalCase for writing class names

- Use camelCase or underscore for function/method names

- Use underscore for variable or property naming

- Use ALL CAPS for constants

- Use classes to demonstrate implementation of OOPS principle
php-forum Super User
php-forum Super User
Posts: 153
Joined: Mon Jun 08, 2020 2:00 am

Sat Oct 09, 2021 11:41 am

I'll do it for 200 quid.
Post Reply