???? 斗鱼弹幕php实现

栏目: PHP · 发布时间: 7年前

内容简介:之前写过python获取斗鱼的弹幕使用了swoole来连接socket,取代了php的socket的函数,使用起来更加方便灵活,swoole文档

github地址

之前写过 python 获取斗鱼的弹幕 传送门 ,突发奇想,想要用 php 来实现。弹幕获取实现起来很简单,用swoole很容易做到了,后期也做了一些命令行格式的优化

使用了swoole来连接socket,取代了php的socket的函数,使用起来更加方便灵活,swoole文档

默认获取的英雄联盟的弹幕,如果想要看其他房间的弹幕,只需执行命令 php cli.php danmu [room id]即可

找个人气旺的房间,一起来欣赏弹幕吧!

Requirements

  • swoole扩展
  • symfony/console
  • guzzlehttp/guzzle
  • jaeger/querylist

Quick Start

1. pecl install swoole 
省略配置过程,具体参照swoole文档...
2. git clone git@github.com:wjhtime/douyu_danmu_php.git
3. composer install -vvv (安装过程可能较长,通过-vvv查看输出)
4. php cli.php douyu:search <keywords>
5. php cli.php danmu <room_id=288016>
或者 php danmu.php
复制代码

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Data Structures and Algorithms in Java

Data Structures and Algorithms in Java

Robert Lafore / Sams / 2002-11-06 / USD 64.99

Data Structures and Algorithms in Java, Second Edition is designed to be easy to read and understand although the topic itself is complicated. Algorithms are the procedures that software programs use......一起来看看 《Data Structures and Algorithms in Java》 这本书的介绍吧!

SHA 加密
SHA 加密

SHA 加密工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具