RSSHelper

A way to add a rss feed button on webpage

  1. // ==UserScript==
  2. // @name RSSHelper
  3. // @version 0.1.0
  4. // @description A way to add a rss feed button on webpage
  5. // @author SettingDust
  6. //
  7. // @include http*://*
  8. // @license MIT
  9. //
  10. // @require https://cdn.bootcss.com/jquery/3.3.1/jquery.slim.min.js
  11. // @require https://cdn.bootcss.com/clipboard.js/2.0.1/clipboard.min.js
  12. //
  13. // @grant GM_addStyle
  14. // @grant GM_setValue
  15. // @grant GM_getValue
  16. // @namespace https://gf.qytechs.cn/users/149095
  17. // ==/UserScript==
  18.  
  19. /******/ (function(modules) { // webpackBootstrap
  20. /******/ // The module cache
  21. /******/ var installedModules = {};
  22. /******/
  23. /******/ // The require function
  24. /******/ function __webpack_require__(moduleId) {
  25. /******/
  26. /******/ // Check if module is in cache
  27. /******/ if(installedModules[moduleId]) {
  28. /******/ return installedModules[moduleId].exports;
  29. /******/ }
  30. /******/ // Create a new module (and put it into the cache)
  31. /******/ var module = installedModules[moduleId] = {
  32. /******/ i: moduleId,
  33. /******/ l: false,
  34. /******/ exports: {}
  35. /******/ };
  36. /******/
  37. /******/ // Execute the module function
  38. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  39. /******/
  40. /******/ // Flag the module as loaded
  41. /******/ module.l = true;
  42. /******/
  43. /******/ // Return the exports of the module
  44. /******/ return module.exports;
  45. /******/ }
  46. /******/
  47. /******/
  48. /******/ // expose the modules object (__webpack_modules__)
  49. /******/ __webpack_require__.m = modules;
  50. /******/
  51. /******/ // expose the module cache
  52. /******/ __webpack_require__.c = installedModules;
  53. /******/
  54. /******/ // define getter function for harmony exports
  55. /******/ __webpack_require__.d = function(exports, name, getter) {
  56. /******/ if(!__webpack_require__.o(exports, name)) {
  57. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  58. /******/ }
  59. /******/ };
  60. /******/
  61. /******/ // define __esModule on exports
  62. /******/ __webpack_require__.r = function(exports) {
  63. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  64. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  65. /******/ }
  66. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  67. /******/ };
  68. /******/
  69. /******/ // create a fake namespace object
  70. /******/ // mode & 1: value is a module id, require it
  71. /******/ // mode & 2: merge all properties of value into the ns
  72. /******/ // mode & 4: return value when already ns object
  73. /******/ // mode & 8|1: behave like require
  74. /******/ __webpack_require__.t = function(value, mode) {
  75. /******/ if(mode & 1) value = __webpack_require__(value);
  76. /******/ if(mode & 8) return value;
  77. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  78. /******/ var ns = Object.create(null);
  79. /******/ __webpack_require__.r(ns);
  80. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  81. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  82. /******/ return ns;
  83. /******/ };
  84. /******/
  85. /******/ // getDefaultExport function for compatibility with non-harmony modules
  86. /******/ __webpack_require__.n = function(module) {
  87. /******/ var getter = module && module.__esModule ?
  88. /******/ function getDefault() { return module['default']; } :
  89. /******/ function getModuleExports() { return module; };
  90. /******/ __webpack_require__.d(getter, 'a', getter);
  91. /******/ return getter;
  92. /******/ };
  93. /******/
  94. /******/ // Object.prototype.hasOwnProperty.call
  95. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  96. /******/
  97. /******/ // __webpack_public_path__
  98. /******/ __webpack_require__.p = "";
  99. /******/
  100. /******/
  101. /******/ // Load entry module and return exports
  102. /******/ return __webpack_require__(__webpack_require__.s = 0);
  103. /******/ })
  104. /************************************************************************/
  105. /******/ ([
  106. /* 0 */
  107. /***/ (function(module, exports, __webpack_require__) {
  108.  
  109. __webpack_require__(1);
  110.  
  111. const router = __webpack_require__(2);
  112. router();
  113.  
  114. new ClipboardJS('#rss-helper');
  115.  
  116.  
  117. /***/ }),
  118. /* 1 */
  119. /***/ (function(module, exports) {
  120.  
  121. $.fn.feedInit = function() {
  122. this.attr('target', '_blank');
  123. this.attr('id', 'rss-helper');
  124. return this;
  125. };
  126.  
  127. $.fn.href = function(href) {
  128. this.attr('href', href);
  129. this.attr('data-clipboard-text', href);
  130. };
  131.  
  132.  
  133. /***/ }),
  134. /* 2 */
  135. /***/ (function(module, exports, __webpack_require__) {
  136.  
  137. const Route = __webpack_require__(3);
  138.  
  139. const Router = __webpack_require__(4);
  140. const router = new Router();
  141.  
  142. module.exports = () => {
  143. router.push(new Route(/yande\.re\/.*/, __webpack_require__(7)));
  144. router.push(new Route(/\/?.*\.?bilibili\.com\/.*/, __webpack_require__(17)));
  145. router.push(new Route(/\/?.*\.?weibo\.com\/.*/, __webpack_require__(28)));
  146. router.push(new Route(/\/?.*\.?pixiv\.net\/.*/, __webpack_require__(29)));
  147.  
  148. router.push(new Route(/.+/, __webpack_require__(33)));
  149.  
  150. router.load(location.href);
  151. };
  152.  
  153.  
  154. /***/ }),
  155. /* 3 */
  156. /***/ (function(module, exports) {
  157.  
  158. module.exports = class Route {
  159. constructor(url, route) {
  160. this._url = url;
  161. this._route = route;
  162. }
  163.  
  164. get url() {
  165. return this._url;
  166. }
  167.  
  168. get route() {
  169. return this._route;
  170. }
  171.  
  172. test(link) {
  173. let regex = new RegExp(this.url);
  174. if (link.input) return regex.test(link.input);
  175. else return regex.test(link);
  176. }
  177.  
  178. match(link) {
  179. let regex = new RegExp(this.url);
  180. if (link.input) return regex.exec(link.input);
  181. else return regex.exec(link);
  182. }
  183.  
  184. call(args) {
  185. this.route(args);
  186. }
  187. };
  188.  
  189.  
  190. /***/ }),
  191. /* 4 */
  192. /***/ (function(module, exports, __webpack_require__) {
  193.  
  194. const logger = __webpack_require__(5);
  195. module.exports = class Router {
  196. constructor() {
  197. this._routes = [];
  198. }
  199.  
  200. push(router) {
  201. this.routes.push(router);
  202. }
  203.  
  204. get routes() {
  205. return this._routes;
  206. }
  207.  
  208. load(href) {
  209. logger.debug(this.routes);
  210. this.routes.some((route) => {
  211. if (route.test(href)) {
  212. route.call(route.match(href));
  213. return true;
  214. }
  215. });
  216. }
  217. };
  218.  
  219.  
  220. /***/ }),
  221. /* 5 */
  222. /***/ (function(module, exports, __webpack_require__) {
  223.  
  224. const monkey = __webpack_require__(6);
  225. module.exports = {
  226. info: (message) => {
  227. console.info(`[${monkey.header.name}]`, message);
  228. },
  229. debug: (message) => {
  230. console.debug(`[${monkey.header.name}]`, message);
  231. },
  232. warn: (message) => {
  233. console.warn(`[${monkey.header.name}]`, message);
  234. }
  235. };
  236.  
  237. /***/ }),
  238. /* 6 */
  239. /***/ (function(module, exports) {
  240.  
  241. let name = 'RSSHelper';
  242. let version = '0.1.0';
  243. let description = 'A way to add a rss feed button on webpage';
  244.  
  245. const config = {
  246. entry: './src/javascript/index.js'
  247. };
  248.  
  249. const header = {
  250. name: name,
  251. version: version,
  252. description: description,
  253. author: 'SettingDust',
  254. include: ['http*://*'],
  255. license: 'MIT',
  256. require: [
  257. 'https://cdn.bootcss.com/jquery/3.3.1/jquery.slim.min.js',
  258. 'https://cdn.bootcss.com/clipboard.js/2.0.1/clipboard.min.js'
  259. ],
  260. grant: [
  261. //https://tampermonkey.net/documentation.php#GM_addStyle
  262. 'GM_addStyle', //GM_addStyle(require('file').toString())
  263. 'GM_setValue',
  264. 'GM_getValue'
  265. ]
  266. };
  267.  
  268. module.exports.config = config;
  269. module.exports.header = header;
  270. module.exports.buildedHeader = () => {
  271. let headerString = [];
  272. headerString.push('// ==UserScript==');
  273. for (let headerKey in header) {
  274. if (Array.isArray(header[headerKey])) {
  275. if (header[headerKey].length > 0) headerString.push('//');
  276. for (let p in header[headerKey]) {
  277. headerString.push('// @' + headerKey.padEnd(13) + header[headerKey][p]);
  278. }
  279. } else {
  280. headerString.push('// @' + headerKey.padEnd(13) + header[headerKey]);
  281. }
  282. }
  283. headerString.push('// ==/UserScript==');
  284. headerString.push('');
  285. return headerString.join('\n');
  286. };
  287.  
  288.  
  289. /***/ }),
  290. /* 7 */
  291. /***/ (function(module, exports, __webpack_require__) {
  292.  
  293. const Route = __webpack_require__(3);
  294. const logger = __webpack_require__(5);
  295.  
  296. const Router = __webpack_require__(4);
  297. const router = new Router();
  298.  
  299. router.push(new Route(/tags=(?:(.+))?/, __webpack_require__(8)));
  300. router.push(new Route(/post/, __webpack_require__(14)));
  301.  
  302. module.exports = async (args) => {
  303. router.load(args);
  304. GM_addStyle(__webpack_require__(15).toString());
  305. logger.debug(__webpack_require__(15).toString());
  306. };
  307.  
  308.  
  309. /***/ }),
  310. /* 8 */
  311. /***/ (function(module, exports, __webpack_require__) {
  312.  
  313. const rssPrefix = 'https://yande.re/post/piclens?tags=';
  314. const variable = __webpack_require__(9);
  315. const { language } = variable;
  316.  
  317. const rssElem = $('<a\>').feedInit();
  318. rssElem.attr('title', language.feed);
  319. rssElem.text(language.feed);
  320.  
  321. module.exports = async (args) => {
  322. rssElem.href(`${rssPrefix}${args[1]}`);
  323. $('#post-list > div.sidebar > div:nth-child(1) > form > div').append(rssElem);
  324. };
  325.  
  326.  
  327. /***/ }),
  328. /* 9 */
  329. /***/ (function(module, exports, __webpack_require__) {
  330.  
  331. const config = __webpack_require__(10);
  332. const { rsshub, language } = config;
  333.  
  334. module.exports = {
  335. language: __webpack_require__(11)(`./${language}`),
  336. rsshub
  337. };
  338.  
  339.  
  340. /***/ }),
  341. /* 10 */
  342. /***/ (function(module, exports) {
  343.  
  344. module.exports = {
  345. language: 'en_US',
  346. rsshub: 'https://rsshub.app'
  347. };
  348.  
  349.  
  350. /***/ }),
  351. /* 11 */
  352. /***/ (function(module, exports, __webpack_require__) {
  353.  
  354. var map = {
  355. "./en_US": 12,
  356. "./en_US.json": 12,
  357. "./zh_CN": 13,
  358. "./zh_CN.json": 13
  359. };
  360.  
  361.  
  362. function webpackContext(req) {
  363. var id = webpackContextResolve(req);
  364. return __webpack_require__(id);
  365. }
  366. function webpackContextResolve(req) {
  367. if(!__webpack_require__.o(map, req)) {
  368. var e = new Error("Cannot find module '" + req + "'");
  369. e.code = 'MODULE_NOT_FOUND';
  370. throw e;
  371. }
  372. return map[req];
  373. }
  374. webpackContext.keys = function webpackContextKeys() {
  375. return Object.keys(map);
  376. };
  377. webpackContext.resolve = webpackContextResolve;
  378. module.exports = webpackContext;
  379. webpackContext.id = 11;
  380.  
  381. /***/ }),
  382. /* 12 */
  383. /***/ (function(module) {
  384.  
  385. module.exports = {"feed":"RSS Feed"};
  386.  
  387. /***/ }),
  388. /* 13 */
  389. /***/ (function(module) {
  390.  
  391. module.exports = {"feed":"RSS订阅"};
  392.  
  393. /***/ }),
  394. /* 14 */
  395. /***/ (function(module, exports, __webpack_require__) {
  396.  
  397. const rssPrefix = 'https://yande.re/post/piclens';
  398. const variable = __webpack_require__(9);
  399. const { language } = variable;
  400.  
  401. const rssElem = $('<a\>').feedInit();
  402. rssElem.attr('title', language.feed);
  403. rssElem.text(language.feed);
  404.  
  405. module.exports = async () => {
  406. rssElem.href(rssPrefix);
  407. $('#post-list > div.sidebar > div:nth-child(1) > form > div').append(rssElem);
  408. };
  409.  
  410.  
  411. /***/ }),
  412. /* 15 */
  413. /***/ (function(module, exports, __webpack_require__) {
  414.  
  415. exports = module.exports = __webpack_require__(16)(false);
  416. // imports
  417.  
  418.  
  419. // module
  420. exports.push([module.i, "#post-list>div.sidebar>div:first-child>form>div{display:-webkit-box;display:-webkit-flex;display:flex;line-height:20px}#post-list>div.sidebar>div:first-child>form>div #rss-helper{margin-left:4px}", ""]);
  421.  
  422. // exports
  423.  
  424.  
  425. /***/ }),
  426. /* 16 */
  427. /***/ (function(module, exports) {
  428.  
  429. /*
  430. MIT License http://www.opensource.org/licenses/mit-license.php
  431. Author Tobias Koppers @sokra
  432. */
  433. // css base code, injected by the css-loader
  434. module.exports = function(useSourceMap) {
  435. var list = [];
  436.  
  437. // return the list of modules as css string
  438. list.toString = function toString() {
  439. return this.map(function (item) {
  440. var content = cssWithMappingToString(item, useSourceMap);
  441. if(item[2]) {
  442. return "@media " + item[2] + "{" + content + "}";
  443. } else {
  444. return content;
  445. }
  446. }).join("");
  447. };
  448.  
  449. // import a list of modules into the list
  450. list.i = function(modules, mediaQuery) {
  451. if(typeof modules === "string")
  452. modules = [[null, modules, ""]];
  453. var alreadyImportedModules = {};
  454. for(var i = 0; i < this.length; i++) {
  455. var id = this[i][0];
  456. if(typeof id === "number")
  457. alreadyImportedModules[id] = true;
  458. }
  459. for(i = 0; i < modules.length; i++) {
  460. var item = modules[i];
  461. // skip already imported module
  462. // this implementation is not 100% perfect for weird media query combinations
  463. // when a module is imported multiple times with different media queries.
  464. // I hope this will never occur (Hey this way we have smaller bundles)
  465. if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
  466. if(mediaQuery && !item[2]) {
  467. item[2] = mediaQuery;
  468. } else if(mediaQuery) {
  469. item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
  470. }
  471. list.push(item);
  472. }
  473. }
  474. };
  475. return list;
  476. };
  477.  
  478. function cssWithMappingToString(item, useSourceMap) {
  479. var content = item[1] || '';
  480. var cssMapping = item[3];
  481. if (!cssMapping) {
  482. return content;
  483. }
  484.  
  485. if (useSourceMap && typeof btoa === 'function') {
  486. var sourceMapping = toComment(cssMapping);
  487. var sourceURLs = cssMapping.sources.map(function (source) {
  488. return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
  489. });
  490.  
  491. return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
  492. }
  493.  
  494. return [content].join('\n');
  495. }
  496.  
  497. // Adapted from convert-source-map (MIT)
  498. function toComment(sourceMap) {
  499. // eslint-disable-next-line no-undef
  500. var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
  501. var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
  502.  
  503. return '/*# ' + data + ' */';
  504. }
  505.  
  506.  
  507. /***/ }),
  508. /* 17 */
  509. /***/ (function(module, exports, __webpack_require__) {
  510.  
  511. const Route = __webpack_require__(3);
  512.  
  513. const Router = __webpack_require__(4);
  514. const router = new Router();
  515.  
  516. router.push(new Route(/video\/av\d+/, __webpack_require__(18)));
  517. router.push(new Route(/space\.bilibili\.com\/\d+/, __webpack_require__(20)));
  518. router.push(new Route(/live\.bilibili\.com\/\d+/, __webpack_require__(21)));
  519. router.push(new Route(/bangumi/, __webpack_require__(23)));
  520.  
  521. module.exports = async (args) => {
  522. router.load(args);
  523. };
  524.  
  525.  
  526. /***/ }),
  527. /* 18 */
  528. /***/ (function(module, exports, __webpack_require__) {
  529.  
  530. const variable = __webpack_require__(9);
  531. const { language, rsshub } = variable;
  532. const rssPrefix = `${rsshub}/bilibili/user/video/`;
  533.  
  534. const rssElem = $('<a\>').feedInit();
  535. rssElem.addClass('btn');
  536. rssElem.addClass('default-btn');
  537. rssElem.addClass('bi-btn');
  538. rssElem.attr('title', language.feed);
  539. rssElem.text(language.feed);
  540.  
  541. module.exports = async () => {
  542. let mid = $('#v_upinfo .u-face>a')
  543. .attr('href')
  544. .match(/\d+/)[0];
  545. rssElem.href(`${rssPrefix}${mid}`);
  546. let task = setInterval(() => {
  547. if ($('.trynew-btn').length) {
  548. rssElem.addClass('old');
  549. $('.followe.btn').append(rssElem);
  550. clearInterval(task);
  551. }
  552. if ($('.more-ops-list').length) {
  553. $('.btn-panel').append(rssElem);
  554. clearInterval(task);
  555. }
  556. }, 100);
  557. GM_addStyle(__webpack_require__(19).toString());
  558. };
  559.  
  560.  
  561. /***/ }),
  562. /* 19 */
  563. /***/ (function(module, exports, __webpack_require__) {
  564.  
  565. exports = module.exports = __webpack_require__(16)(false);
  566. // imports
  567.  
  568.  
  569. // module
  570. exports.push([module.i, "#v_upinfo .followe{margin-left:-89px}#v_upinfo .btn-panel{margin-left:0;top:8px;position:relative;-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end}#rss-helper{padding:4px 16px;margin-left:12px;margin-top:0}#rss-helper.old{height:20px;line-height:20px}", ""]);
  571.  
  572. // exports
  573.  
  574.  
  575. /***/ }),
  576. /* 20 */
  577. /***/ (function(module, exports, __webpack_require__) {
  578.  
  579. const variable = __webpack_require__(9);
  580. const { language, rsshub } = variable;
  581. const rssPrefix = `${rsshub}/bilibili/user/dynamic/`;
  582.  
  583. const rssElem = $('<a\>').feedInit();
  584. rssElem.addClass('h-f-btn');
  585. rssElem.attr('title', language.feed);
  586. rssElem.text(language.feed);
  587.  
  588. module.exports = async (args) => {
  589. rssElem.href(`${rssPrefix}${args[1]}`);
  590. let task = setInterval(() => {
  591. let elem = $('.h-action .h-message');
  592. if (elem.length) {
  593. elem.after(rssElem);
  594. clearInterval(task);
  595. }
  596. }, 500);
  597. };
  598.  
  599.  
  600. /***/ }),
  601. /* 21 */
  602. /***/ (function(module, exports, __webpack_require__) {
  603.  
  604. const variable = __webpack_require__(9);
  605. const { language, rsshub } = variable;
  606. const rssPrefix = `${rsshub}/bilibili/live/room/`;
  607.  
  608. const rssElem = $('<a\>').feedInit();
  609. rssElem.addClass('p-absolute');
  610. rssElem.attr('title', language.feed);
  611. rssElem.text(language.feed);
  612.  
  613. module.exports = async (args) => {
  614. rssElem.href(`${rssPrefix}${args[1]}`);
  615. let task = setInterval(() => {
  616. let elem = $('.room-info-down-row .attention-btn-ctnr');
  617. if (elem.length) {
  618. elem.after(rssElem);
  619. clearInterval(task);
  620. }
  621. }, 500);
  622. GM_addStyle(__webpack_require__(22).toString());
  623. };
  624.  
  625.  
  626. /***/ }),
  627. /* 22 */
  628. /***/ (function(module, exports, __webpack_require__) {
  629.  
  630. exports = module.exports = __webpack_require__(16)(false);
  631. // imports
  632.  
  633.  
  634. // module
  635. exports.push([module.i, ".room-info-down-row #rss-helper{height:22px;line-height:22px;padding-left:16px;padding-right:16px;background-color:#23ade5;color:#fff!important;border-radius:4px;right:130px;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);-webkit-transition:125ms ease-in-out;transition:125ms ease-in-out}.room-info-down-row #rss-helper:hover{background-color:#23b9f1}", ""]);
  636.  
  637. // exports
  638.  
  639.  
  640. /***/ }),
  641. /* 23 */
  642. /***/ (function(module, exports, __webpack_require__) {
  643.  
  644. const Route = __webpack_require__(3);
  645.  
  646. const Router = __webpack_require__(4);
  647. const router = new Router();
  648.  
  649. router.push(new Route(/media\/md(\d+)/, __webpack_require__(24)));
  650. router.push(new Route(/play\/ep\d+/, __webpack_require__(26)));
  651.  
  652. module.exports = async (args) => {
  653. router.load(args);
  654. };
  655.  
  656.  
  657. /***/ }),
  658. /* 24 */
  659. /***/ (function(module, exports, __webpack_require__) {
  660.  
  661. const variable = __webpack_require__(9);
  662. const { language, rsshub } = variable;
  663. const rssPrefix = `${rsshub}/bilibili/bangumi/media/`;
  664.  
  665. const rssElem = $('<a\>').feedInit();
  666. rssElem.addClass('bangumi-btn');
  667. rssElem.attr('title', language.feed);
  668. rssElem.text(language.feed);
  669.  
  670. module.exports = async (ctx) => {
  671. rssElem.href(`${rssPrefix}${ctx[1]}`);
  672. $('.bangumi-btn').after(rssElem);
  673. GM_addStyle(__webpack_require__(25).toString());
  674. };
  675.  
  676.  
  677. /***/ }),
  678. /* 25 */
  679. /***/ (function(module, exports, __webpack_require__) {
  680.  
  681. exports = module.exports = __webpack_require__(16)(false);
  682. // imports
  683.  
  684.  
  685. // module
  686. exports.push([module.i, "#rss-helper{width:128px;height:48px;line-height:48px;background-color:#f36392;border-radius:8px;text-align:center;color:#fff;font-size:18px;-webkit-transition:all .3s ease;transition:all .3s ease}", ""]);
  687.  
  688. // exports
  689.  
  690.  
  691. /***/ }),
  692. /* 26 */
  693. /***/ (function(module, exports, __webpack_require__) {
  694.  
  695. const variable = __webpack_require__(9);
  696. const { language, rsshub } = variable;
  697. const rssPrefix = `${rsshub}/bilibili/bangumi/media/`;
  698.  
  699. const rssElem = $('<a\>').feedInit();
  700. rssElem.addClass('bangumi-btn');
  701. rssElem.attr('title', language.feed);
  702. rssElem.text(language.feed);
  703.  
  704. module.exports = async () => {
  705. const mdid = $('.info-title>a').attr('href').match(/(\d+)/);
  706. rssElem.href(`${rssPrefix}${mdid}`);
  707. $('.bangumi-btn').after(rssElem);
  708. GM_addStyle(__webpack_require__(27).toString());
  709. };
  710.  
  711.  
  712. /***/ }),
  713. /* 27 */
  714. /***/ (function(module, exports, __webpack_require__) {
  715.  
  716. exports = module.exports = __webpack_require__(16)(false);
  717. // imports
  718.  
  719.  
  720. // module
  721. exports.push([module.i, "#rss-helper{width:80px;height:28px;line-height:28px;background-color:#f36392;border:1px solid #f36392;border-radius:4px;text-align:center;color:#fff;font-size:14px}.bangumi-info .info-right .info-title h2{width:500px}", ""]);
  722.  
  723. // exports
  724.  
  725.  
  726. /***/ }),
  727. /* 28 */
  728. /***/ (function(module, exports, __webpack_require__) {
  729.  
  730. const variable = __webpack_require__(9);
  731. const { language, rsshub } = variable;
  732. const rssPrefix = `${rsshub}/weibo/user/`;
  733.  
  734. const rssElem = $('<a\>').feedInit();
  735.  
  736. module.exports = async () => {
  737. window.onload = () => {
  738. if ($('.opt_box.clearfix').length) {
  739. rssElem.addClass('W_btn_d');
  740. rssElem.addClass('btn_34px');
  741.  
  742. rssElem.attr('title', language.feed);
  743. rssElem.text(language.feed);
  744. rssElem.href(rssPrefix + $oid);
  745.  
  746. $('div.pf_opt > .opt_box').append(rssElem);
  747. }
  748. };
  749. };
  750.  
  751.  
  752. /***/ }),
  753. /* 29 */
  754. /***/ (function(module, exports, __webpack_require__) {
  755.  
  756. const Route = __webpack_require__(3);
  757. const logger = __webpack_require__(5);
  758.  
  759. const Router = __webpack_require__(4);
  760. const router = new Router();
  761.  
  762. router.push(new Route(/member\.php\?id=\d+/, __webpack_require__(30)));
  763. router.push(new Route(/member_illust\.php\?.*illust_id=\d+/, __webpack_require__(31)));
  764.  
  765. module.exports = async (args) => {
  766. router.load(args);
  767. GM_addStyle(__webpack_require__(32).toString());
  768. logger.debug(__webpack_require__(32).toString());
  769. };
  770.  
  771.  
  772. /***/ }),
  773. /* 30 */
  774. /***/ (function(module, exports, __webpack_require__) {
  775.  
  776. const variable = __webpack_require__(9);
  777. const { language, rsshub } = variable;
  778. const rssPrefix = `${rsshub}/pixiv/user/`;
  779.  
  780. const rssElem = $('<a\>').feedInit();
  781. rssElem.addClass('YryPnZn _30SjOFD');
  782. rssElem.attr('title', language.feed);
  783. rssElem.text(language.feed);
  784.  
  785. module.exports = async () => {
  786. rssElem.href(rssPrefix + Object.keys(globalInitData.preload.user)[0]);
  787. let task = setInterval(() => {
  788. let elem = $('div._3yalhqB');
  789. if (elem.length) {
  790. elem.append(rssElem);
  791. clearInterval(task);
  792. }
  793. }, 500);
  794. };
  795.  
  796.  
  797. /***/ }),
  798. /* 31 */
  799. /***/ (function(module, exports, __webpack_require__) {
  800.  
  801. const variable = __webpack_require__(9);
  802. const { language, rsshub } = variable;
  803. const rssPrefix = `${rsshub}/pixiv/user/`;
  804.  
  805. const rssElem = $('<a\>').feedInit();
  806. rssElem.addClass('YryPnZn');
  807. rssElem.attr('title', language.feed);
  808. rssElem.text(language.feed);
  809.  
  810. module.exports = async () => {
  811. rssElem.href(rssPrefix + Object.keys(globalInitData.preload.user)[0]);
  812. let task = setInterval(() => {
  813. let elem = $('.sc-dRCTWM.cRuxjo');
  814. if (elem.length) {
  815. elem.append(rssElem);
  816. clearInterval(task);
  817. }
  818. }, 500);
  819. };
  820.  
  821.  
  822. /***/ }),
  823. /* 32 */
  824. /***/ (function(module, exports, __webpack_require__) {
  825.  
  826. exports = module.exports = __webpack_require__(16)(false);
  827. // imports
  828.  
  829.  
  830. // module
  831. exports.push([module.i, "#rss-helper{text-decoration:none}._3yalhqB{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;width:auto}._3yalhqB #rss-helper{margin-left:12px}.sc-dRCTWM.cRuxjo #rss-helper{margin-top:12px}", ""]);
  832.  
  833. // exports
  834.  
  835.  
  836. /***/ }),
  837. /* 33 */
  838. /***/ (function(module, exports, __webpack_require__) {
  839.  
  840. const variable = __webpack_require__(9);
  841. const { language } = variable;
  842. const logger = __webpack_require__(5);
  843.  
  844. const rssContainer = $('<div\>').feedInit();
  845.  
  846. const rssElem = $('<a\>');
  847. rssElem.attr('target', '_blank');
  848. rssElem.addClass('rss-item');
  849. rssElem.append('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><circle cx="6.18" cy="17.82" r="2.18"/><path d="M4 4.44v2.83c7.03 0 12.73 5.7 12.73 12.73h2.83c0-8.59-6.97-15.56-15.56-15.56zm0 5.66v2.83c3.9 0 7.07 3.17 7.07 7.07h2.83c0-5.47-4.43-9.9-9.9-9.9z"/></svg>');
  850.  
  851. const rssElemText = $('<span\>');
  852. rssElemText.text(language.feed);
  853. rssElem.append(rssElemText);
  854.  
  855. module.exports = async () => {
  856. const types = [
  857. 'application/rss+xml',
  858. 'application/atom+xml',
  859. 'application/rdf+xml',
  860. 'application/rss',
  861. 'application/atom',
  862. 'application/rdf',
  863. 'text/rss+xml',
  864. 'text/atom+xml',
  865. 'text/rdf+xml',
  866. 'text/rss',
  867. 'text/atom',
  868. 'text/rdf'
  869. ];
  870. const links = [
  871. '/feed',
  872. '/rss',
  873. '/rss.xml',
  874. '/atom.xml',
  875. '/feed.xml'
  876. ];
  877. let feeds = [];
  878. $(async () => {
  879. $('link[type]').each(function() {
  880. if (types.includes($(this).attr('type'))) {
  881. let feed = {
  882. href: $(this).attr('href'),
  883. name: $(this).attr('title')
  884. };
  885. feeds.push(feed);
  886. }
  887. });
  888. logger.debug(feeds);
  889. if (feeds.length) {
  890. for (const feed of feeds) {
  891. const rssElemClone = rssElem.clone();
  892. rssElemClone.href(feed.href.startsWith('/') ? `${location.protocol}//${location.host}${feed.href}` : feed.href);
  893. rssElemClone.find('span').text(feed.name);
  894. rssContainer.append(rssElemClone);
  895. rssElemClone.mouseenter(() => {
  896. rssElemClone.css('width', rssElemClone.find('span').width() + 30 + 8);
  897. });
  898. rssElemClone.mouseleave(() => {
  899. rssElemClone.css('width', 30);
  900. });
  901. }
  902. $('body').append(rssContainer);
  903. } else {
  904. for (const link of links) {
  905. fetch(link, {
  906. headers: {
  907. 'User-Agent': 'curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3'
  908. }
  909. }).then(async (data) => {
  910. if (data.ok) {
  911. const html = await data.text();
  912. logger.debug(link);
  913. if (html.startsWith('<rss') || html.includes('\n<feed xmlns=')) {
  914. const rssElemClone = rssElem.clone();
  915. rssElemClone.href(data.url);
  916. rssElemClone.find('span').text(html.match(/title>(.+)<\/title/)[1]);
  917. rssContainer.append(rssElemClone);
  918. rssElemClone.mouseenter(() => {
  919. rssElemClone.css('width', rssElemClone.find('span').width() + 30 + 8);
  920. });
  921. rssElemClone.mouseleave(() => {
  922. rssElemClone.css('width', 30);
  923. });
  924. }
  925. }
  926. }).catch((data) => {
  927. logger.debug(data);
  928. });
  929. $('body').append(rssContainer);
  930. }
  931. }
  932. });
  933. GM_addStyle(__webpack_require__(34).toString());
  934. };
  935.  
  936.  
  937. /***/ }),
  938. /* 34 */
  939. /***/ (function(module, exports, __webpack_require__) {
  940.  
  941. exports = module.exports = __webpack_require__(16)(false);
  942. // imports
  943.  
  944.  
  945. // module
  946. exports.push([module.i, "#rss-helper{display:grid;justify-items:end;grid-gap:8px;position:fixed;bottom:128px;z-index:12000;right:0;font-size:14px;color:#212121!important;line-height:24px}#rss-helper .rss-item{display:-webkit-box;display:-webkit-flex;display:flex;width:30px;box-sizing:border-box;border-bottom-left-radius:4px;border-top-left-radius:4px;background-color:#f8f8f8;overflow:hidden;padding:3px 4px;box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12);-webkit-transition:125ms ease-in-out;transition:125ms ease-in-out}#rss-helper .rss-item svg{min-width:24px}#rss-helper .rss-item span{margin-left:4px;white-space:nowrap;opacity:0;-webkit-transition:125ms ease-in-out;transition:125ms ease-in-out}#rss-helper .rss-item:hover{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}#rss-helper .rss-item:hover span{opacity:1}", ""]);
  947.  
  948. // exports
  949.  
  950.  
  951. /***/ })
  952. /******/ ]);

QingJ © 2025

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