Home > Article > Backend Development > php implements Douyu barrage, let’s enjoy the barrage together~
Recommended: "PHP Video Tutorial"
Douyu Barrage PHP Version
github Address: https://github.com/wjhtime
I have written python before to get the barrage of Douyu Portal, I had a sudden idea and wanted to use php to fulfill. Obtaining the barrage is very simple to implement. It is easy to do it with swoole. In the later period, some optimization of the command line format was also done.
Used swoole to connect to the socket, which replaced the php socket function and is more convenient to use. Flexible, swoole document
The barrages of League of Legends are obtained by default. If you want to see the barrages of other rooms, just execute the command php cli.php danmu [room id]
Find a popular room and enjoy the barrage together!
Requirements
swoole extension
symfony/console
guzzlehttp/guzzle
jaeger/querylist
Quick Start
1. pecl install swoole
Omit the configuration process, refer to the swoole document for details...
2. git clone git@github.com:wjhtime/douyu_danmu_php.git
3. composer install -vvv (The installation process may be long, check the output through -vvv)
4. php cli.php douyu:search
5. php cli.php danmu
or php danmu.php
Feature
Screenshots
##Illustrate
To Do List
The classification of barrage information is not clear enough and there are too many unknown types of data
The above is the detailed content of php implements Douyu barrage, let’s enjoy the barrage together~. For more information, please follow other related articles on the PHP Chinese website!