Giter Site home page Giter Site logo

tieba-api's Introduction

tieba-api

language version GitHub license

封装了百度贴吧的基本操作,登录,签到,回帖等

使用说明

maven

<dependency>
    <groupId>com.github.libsgh</groupId>
    <artifactId>tieba-api</artifactId>
    <version>${lastVersion}</version>
</dependency>

Gradle

implementation 'com.github.libsgh:tieba-api:${lastVersion}'

SBT

libraryDependencies += "com.github.libsgh" % "tieba-api" % "${lastVersion}"

直接引用jar,在tieba-apireleases下载最新版

 TieBaApi api = TieBaApi.getInstance();
 api.uploadPicture(new File(""), bduss, api.getImgTbs(), "fid", false, WatermarkType.NO_WATERMARK);//上传图片,返回图片id(用于回帖)
 api.reply(bduss, "5635882244", "bug", "#bug吧#回帖接口测试", 0);//回帖
 api.getIndexTList("bug",1);//获取首页帖子数组
 api.oneBtnToSign(bduss, stoken);//一键签到
 api.oneBtnToSign(bduss);//一键签到
 api.signOneTieBa("姜敏京", 282280, bduss);//签到一个贴吧
 api.getHideTbs(username);//获取用户所有贴吧(隐藏贴吧)
 api.getMyLikedTB(bduss, stoken);//获取我喜欢的贴吧
 api.getUserInfo(bduss, stoken);//获取用户信息
 api.getHeadImg(username);//获取用户头像
 api.zhiDaoSign(bduss);//知道签到
 api.wenKuSign(bduss);//文库签到
 api.getMsg(bduss, "reply", 1);//查看回复我或艾特我的信息
 api.replyFloor(bduss, "tid", "pid", "fname", "···", 0);//楼中楼回复
 List<ReplyInfo> list = api.getMsg(bduss, "reply", 1);
 for (ReplyInfo replyInfo : list) {
	api.floorpid(bduss, replyInfo.getThread_id(), replyInfo.getPost_id());//获取楼层pid
 }
 //用户名密码登录获取cookie
 api.getBaiDuLoginCookie(account, password, verifyCode, codeString, cookies, token);
 api.focus(bduss, "bug");//关注一个贴吧
 api.unfocus(bduss, "bug");//取消关注一个贴吧
 api.getQRCodeUrl();//获取登录二维码
 api.getFollowList(bduss);//获取关注的用户列表
 api.getFansList(bduss);//获取粉丝列表
 api.removeFans(bduss,fans_uid);//移除粉丝
 api.islogin(bduss);//检测bduss有效性
 api.getCookieFromQRCode(v);//二维码登录获取cookie(bduss,stoken)
 api.jubao(bduss, "123649521597","10004");//举报帖子
 api.isFocus("bug", bduss, stoken);//是否关注某个贴吧
 api.isFocus("bug", bduss);//是否关注某个贴吧
 //api.getFullNameByPanUrl("panUrl");//接口失效
 api.support(bduss, "柯南");//助攻名人堂
 api.prisionReasonList(bduss, "home", "uid");//获取封禁原因列表
 api.commitprison(bduss, "home", "张三", 1 ,"reason");//封禁用户
 api.focus2(bduss, stoken, api.getFid("bug"));//关注贴吧(网页接口,可以关注异常吧)
 api.unfocus2(bduss, stoken, api.getFid("bug"));//取关贴吧(网页接口,可以取关异常吧)
 api.getFid("bug");//获取贴吧fid
 api.qrCodeLoginStatus("sign", "gid");//检查扫码登录状态查询
 api.addThread(bduss, "tbName", "", "c");//上传图片

温馨提示:

  1. 回帖接口可能导致全吧封禁,请谨慎使用
  2. 登录接口许久未更新,目前只做参考,主流方式是扫码登录获取cookie

使用推荐:基于api实现的微信公众号:ponbous,web站点

有问题提issue或q:359916450

tieba-api's People

Contributors

libsgh 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.