PHP code example of itisbean / weibohit

1. Go to this page and download the library: Download itisbean/weibohit library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

itisbean / weibohit example snippets


// 引入autoload.php(框架中使用不需要)
rname' => 'your account',
    'password' => 'your password',
    'doorImgPath' => 'if need door code, the door image would be saved here'
]);
// 發微博
$ret = $whitInstance->post('I am a robot');
// 評論
$whitInstance->comment($ret['data'], 'right');

/**
 * 发微博
 * @param string $text 发送微博的文字内容
 * @return array
 */
$whitInstance->post($text);

/**
 * 转发
 * @param string $mid 原贴ID
 * @param string $text 发送微博的文字内容
 * @return array
 */
public function repost($mid, $text = '');

/**
 * 评论帖子
 * @param string $mid 贴子ID
 * @param string $text 评论内容
 * @return array
 */
public function comment($mid, $text = '');

/**
 * 移動端評論帖子
 * @param string $mid
 * @param string $text
 * @param boolean $istry
 * @return array
 */
public function mComment($mid, $text, $istry = false);

/**
 * 点赞或取消
 * @param string $mid 贴子ID
 * @return array
 */
public function like($mid);

/**
 * 超话签到
 * @param string $tid 超话ID
 * @return array
 */
public function topicSign($tid);

/**
 * 超话发贴
 * @param string $tid 超话ID
 * @param string $text 贴子内容
 * @return array
 */
public function topicPost($tid, $text);

/**
 * 微博视频信息
 * @param string $tvurl
 * @return array
 */
public function getTvinfo($tvurl);

/**
 * 获取登录用户ID
 * @return array
 */
public function getSelf()

/**
 * 送加油卡
 * @param integer $num 送卡数量
 * @param string $text 发送微博的文字内容
 * @return array
 */
public function incrspt($num = 1, $text = '');