Acfun自动投香蕉

在Acfun自动投香蕉

  1. // ==UserScript==
  2. // @name Acfun自动投香蕉
  3. // @namespace http://zhihaofans.com
  4. // @version 0.0.8
  5. // @description 在Acfun自动投香蕉
  6. // @author zhihaofans
  7. // @match http://www.acfun.cn/v/*
  8. // @match http://www.acfun.cn/a/*
  9. // @match http://www.acfun.tv/v/*
  10. // @match http://www.acfun.tv/a/*
  11. // @match http://www.aixifan.com/a/*
  12. // @match http://www.aixifan.com/v/*
  13. // @grant none
  14. // @note 本脚本已停止更新
  15. // @note Github开源地址:https://github.com/zhihaofans/Acfun/blob/master/acfun.tv/AutoSendBananas/auto.js
  16. // @note Greasyfork地址:https://gf.qytechs.cn/zh-CN/scripts/22843
  17. // @icon http://cdn.aixifan.com/ico/favicon.ico
  18. // @license MIT
  19. // ==/UserScript==
  20. function getCookie(c_name) {
  21. if (document.cookie.length > 0) {
  22. c_start = document.cookie.indexOf(c_name + '=');
  23. if (c_start != -1) {
  24. c_start = c_start + c_name.length + 1;
  25. c_end = document.cookie.indexOf(';', c_start);
  26. if (c_end == -1) {
  27. c_end = document.cookie.length;
  28. }
  29. return unescape(document.cookie.substring(c_start, c_end));
  30. }
  31. }
  32. return '';
  33. }
  34. function acPostBananas(_cid, _uid, _bananas) {
  35. $.post("/banana/throwBanana.aspx", {
  36. count: _bananas,
  37. contentId: _cid,
  38. userId: _uid
  39. },
  40. function(data, status) {
  41. console.log("自动5蕉(status:" + status+")");
  42. if (status == "success") {
  43. if (data.success === true) {
  44. $.info("success", "已自动投5蕉");
  45. } else {
  46. if (data.info != "该稿件已扔过香蕉") {
  47. $.info("error", "自动5蕉:" + data.info);
  48. }
  49. else{
  50. $.info("warning", "自动5蕉:该稿件已扔过香蕉");
  51. }
  52. }
  53. } else {
  54. $.info("error", "自动5蕉:网络错误");
  55. }
  56.  
  57. });
  58. }
  59. $(document).ready(function() {
  60. if (getCookie('auth_key') !== "") {
  61. var url = location.pathname;
  62.  
  63. if (url.substr(0, 5) == "/v/ac") {
  64. var nowcid = url.replace("/v/ac", "");
  65. acPostBananas(nowcid, getCookie('auth_key'),5);
  66. }
  67. if (url.substr(0, 5) == "/a/ac") {
  68. var nowcid = url.replace("/a/ac", "");
  69. acPostBananas(nowcid, getCookie('auth_key'),1);
  70. }
  71. }
  72. });

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址