RSSHelper

A way to add a rss feed button on webpage

当前为 2018-11-23 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name RSSHelper
  3. // @version 0.0.4
  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.min.js
  11. //
  12. // @grant GM_addStyle
  13. // @namespace https://greasyfork.org/users/149095
  14. // ==/UserScript==
  15.  
  16. !function(modules) {
  17. var installedModules = {};
  18. function __webpack_require__(moduleId) {
  19. if (installedModules[moduleId]) return installedModules[moduleId].exports;
  20. var module = installedModules[moduleId] = {
  21. i: moduleId,
  22. l: !1,
  23. exports: {}
  24. };
  25. return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__),
  26. module.l = !0, module.exports;
  27. }
  28. __webpack_require__.m = modules, __webpack_require__.c = installedModules, __webpack_require__.d = function(exports, name, getter) {
  29. __webpack_require__.o(exports, name) || Object.defineProperty(exports, name, {
  30. enumerable: !0,
  31. get: getter
  32. });
  33. }, __webpack_require__.r = function(exports) {
  34. "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {
  35. value: "Module"
  36. }), Object.defineProperty(exports, "__esModule", {
  37. value: !0
  38. });
  39. }, __webpack_require__.t = function(value, mode) {
  40. if (1 & mode && (value = __webpack_require__(value)), 8 & mode) return value;
  41. if (4 & mode && "object" == typeof value && value && value.__esModule) return value;
  42. var ns = Object.create(null);
  43. if (__webpack_require__.r(ns), Object.defineProperty(ns, "default", {
  44. enumerable: !0,
  45. value: value
  46. }), 2 & mode && "string" != typeof value) for (var key in value) __webpack_require__.d(ns, key, function(key) {
  47. return value[key];
  48. }.bind(null, key));
  49. return ns;
  50. }, __webpack_require__.n = function(module) {
  51. var getter = module && module.__esModule ? function() {
  52. return module.default;
  53. } : function() {
  54. return module;
  55. };
  56. return __webpack_require__.d(getter, "a", getter), getter;
  57. }, __webpack_require__.o = function(object, property) {
  58. return Object.prototype.hasOwnProperty.call(object, property);
  59. }, __webpack_require__.p = "", __webpack_require__(__webpack_require__.s = 0);
  60. }([ function(module, exports, __webpack_require__) {
  61. const Route = __webpack_require__(1), router = new (__webpack_require__(3))();
  62. router.push(new Route(/yande\.re\/.*/, __webpack_require__(6))), router.push(new Route(/\/?.*\.?bilibili\.com\/.*/, __webpack_require__(15))),
  63. router.push(new Route(/\/?.*\.?weibo\.com\/.*/, __webpack_require__(20))), router.push(new Route(/\/?.*\.?pixiv\.net\/.*/, __webpack_require__(22))),
  64. router.push(new Route(/.+/, __webpack_require__(26))), router.load(location.href);
  65. }, function(module, exports, __webpack_require__) {
  66. const pathToRegexp = __webpack_require__(2);
  67. module.exports = class {
  68. constructor(url, route) {
  69. this._url = url, this._route = route;
  70. }
  71. get url() {
  72. return this._url;
  73. }
  74. get route() {
  75. return this._route;
  76. }
  77. test(link) {
  78. let regex = pathToRegexp(this.url);
  79. return link.input ? regex.test(link.input) : regex.test(link);
  80. }
  81. match(link) {
  82. let regex = pathToRegexp(this.url);
  83. return link.input ? regex.exec(link.input) : regex.exec(link);
  84. }
  85. call(args) {
  86. this.route(args);
  87. }
  88. };
  89. }, function(module, exports) {
  90. module.exports = pathToRegexp, module.exports.parse = parse, module.exports.compile = function(str, options) {
  91. return tokensToFunction(parse(str, options));
  92. }, module.exports.tokensToFunction = tokensToFunction, module.exports.tokensToRegExp = tokensToRegExp;
  93. var DEFAULT_DELIMITER = "/", DEFAULT_DELIMITERS = "./", PATH_REGEXP = new RegExp([ "(\\\\.)", "(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?" ].join("|"), "g");
  94. function parse(str, options) {
  95. for (var res, tokens = [], key = 0, index = 0, path = "", defaultDelimiter = options && options.delimiter || DEFAULT_DELIMITER, delimiters = options && options.delimiters || DEFAULT_DELIMITERS, pathEscaped = !1; null !== (res = PATH_REGEXP.exec(str)); ) {
  96. var m = res[0], escaped = res[1], offset = res.index;
  97. if (path += str.slice(index, offset), index = offset + m.length, escaped) path += escaped[1],
  98. pathEscaped = !0; else {
  99. var prev = "", next = str[index], name = res[2], capture = res[3], group = res[4], modifier = res[5];
  100. if (!pathEscaped && path.length) {
  101. var k = path.length - 1;
  102. delimiters.indexOf(path[k]) > -1 && (prev = path[k], path = path.slice(0, k));
  103. }
  104. path && (tokens.push(path), path = "", pathEscaped = !1);
  105. var partial = "" !== prev && void 0 !== next && next !== prev, repeat = "+" === modifier || "*" === modifier, optional = "?" === modifier || "*" === modifier, delimiter = prev || defaultDelimiter, pattern = capture || group;
  106. tokens.push({
  107. name: name || key++,
  108. prefix: prev,
  109. delimiter: delimiter,
  110. optional: optional,
  111. repeat: repeat,
  112. partial: partial,
  113. pattern: pattern ? escapeGroup(pattern) : "[^" + escapeString(delimiter) + "]+?"
  114. });
  115. }
  116. }
  117. return (path || index < str.length) && tokens.push(path + str.substr(index)), tokens;
  118. }
  119. function tokensToFunction(tokens) {
  120. for (var matches = new Array(tokens.length), i = 0; i < tokens.length; i++) "object" == typeof tokens[i] && (matches[i] = new RegExp("^(?:" + tokens[i].pattern + ")$"));
  121. return function(data, options) {
  122. for (var path = "", encode = options && options.encode || encodeURIComponent, i = 0; i < tokens.length; i++) {
  123. var token = tokens[i];
  124. if ("string" != typeof token) {
  125. var segment, value = data ? data[token.name] : void 0;
  126. if (Array.isArray(value)) {
  127. if (!token.repeat) throw new TypeError('Expected "' + token.name + '" to not repeat, but got array');
  128. if (0 === value.length) {
  129. if (token.optional) continue;
  130. throw new TypeError('Expected "' + token.name + '" to not be empty');
  131. }
  132. for (var j = 0; j < value.length; j++) {
  133. if (segment = encode(value[j], token), !matches[i].test(segment)) throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '"');
  134. path += (0 === j ? token.prefix : token.delimiter) + segment;
  135. }
  136. } else if ("string" != typeof value && "number" != typeof value && "boolean" != typeof value) {
  137. if (!token.optional) throw new TypeError('Expected "' + token.name + '" to be ' + (token.repeat ? "an array" : "a string"));
  138. token.partial && (path += token.prefix);
  139. } else {
  140. if (segment = encode(String(value), token), !matches[i].test(segment)) throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but got "' + segment + '"');
  141. path += token.prefix + segment;
  142. }
  143. } else path += token;
  144. }
  145. return path;
  146. };
  147. }
  148. function escapeString(str) {
  149. return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, "\\$1");
  150. }
  151. function escapeGroup(group) {
  152. return group.replace(/([=!:$\/()])/g, "\\$1");
  153. }
  154. function flags(options) {
  155. return options && options.sensitive ? "" : "i";
  156. }
  157. function tokensToRegExp(tokens, keys, options) {
  158. for (var strict = (options = options || {}).strict, start = !1 !== options.start, end = !1 !== options.end, delimiter = escapeString(options.delimiter || DEFAULT_DELIMITER), delimiters = options.delimiters || DEFAULT_DELIMITERS, endsWith = [].concat(options.endsWith || []).map(escapeString).concat("$").join("|"), route = start ? "^" : "", isEndDelimited = 0 === tokens.length, i = 0; i < tokens.length; i++) {
  159. var token = tokens[i];
  160. if ("string" == typeof token) route += escapeString(token), isEndDelimited = i === tokens.length - 1 && delimiters.indexOf(token[token.length - 1]) > -1; else {
  161. var capture = token.repeat ? "(?:" + token.pattern + ")(?:" + escapeString(token.delimiter) + "(?:" + token.pattern + "))*" : token.pattern;
  162. keys && keys.push(token), token.optional ? token.partial ? route += escapeString(token.prefix) + "(" + capture + ")?" : route += "(?:" + escapeString(token.prefix) + "(" + capture + "))?" : route += escapeString(token.prefix) + "(" + capture + ")";
  163. }
  164. }
  165. return end ? (strict || (route += "(?:" + delimiter + ")?"), route += "$" === endsWith ? "$" : "(?=" + endsWith + ")") : (strict || (route += "(?:" + delimiter + "(?=" + endsWith + "))?"),
  166. isEndDelimited || (route += "(?=" + delimiter + "|" + endsWith + ")")), new RegExp(route, flags(options));
  167. }
  168. function pathToRegexp(path, keys, options) {
  169. return path instanceof RegExp ? function(path, keys) {
  170. if (!keys) return path;
  171. var groups = path.source.match(/\((?!\?)/g);
  172. if (groups) for (var i = 0; i < groups.length; i++) keys.push({
  173. name: i,
  174. prefix: null,
  175. delimiter: null,
  176. optional: !1,
  177. repeat: !1,
  178. partial: !1,
  179. pattern: null
  180. });
  181. return path;
  182. }(path, keys) : Array.isArray(path) ? function(path, keys, options) {
  183. for (var parts = [], i = 0; i < path.length; i++) parts.push(pathToRegexp(path[i], keys, options).source);
  184. return new RegExp("(?:" + parts.join("|") + ")", flags(options));
  185. }(path, keys, options) : function(path, keys, options) {
  186. return tokensToRegExp(parse(path, options), keys, options);
  187. }(path, keys, options);
  188. }
  189. }, function(module, exports, __webpack_require__) {
  190. const logger = __webpack_require__(4);
  191. module.exports = class {
  192. constructor() {
  193. this._routes = [];
  194. }
  195. push(router) {
  196. this.routes.push(router);
  197. }
  198. get routes() {
  199. return this._routes;
  200. }
  201. load(href) {
  202. logger.debug(this.routes), this.routes.some(route => {
  203. if (route.test(href)) return route.call(route.match(href)), !0;
  204. });
  205. }
  206. };
  207. }, function(module, exports, __webpack_require__) {
  208. const monkey = __webpack_require__(5);
  209. module.exports = {
  210. info: message => {
  211. console.info(`[${monkey.header.name}]`, message);
  212. },
  213. debug: message => {
  214. console.debug(`[${monkey.header.name}]`, message);
  215. },
  216. warn: message => {
  217. console.warn(`[${monkey.header.name}]`, message);
  218. }
  219. };
  220. }, function(module, exports) {
  221. const header = {
  222. name: "RSSHelper",
  223. version: "0.0.4",
  224. description: "A way to add a rss feed button on webpage",
  225. author: "SettingDust",
  226. include: [ "http*://*" ],
  227. license: "MIT",
  228. require: [ "https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js" ],
  229. grant: [ "GM_addStyle" ]
  230. };
  231. module.exports.config = {
  232. entry: "./src/javascript/index.js"
  233. }, module.exports.header = header, module.exports.buildedHeader = (() => {
  234. let headerString = [];
  235. headerString.push("// ==UserScript==");
  236. for (let headerKey in header) if (Array.isArray(header[headerKey])) {
  237. header[headerKey].length > 0 && headerString.push("//");
  238. for (let p in header[headerKey]) headerString.push("// @" + headerKey.padEnd(13) + header[headerKey][p]);
  239. } else headerString.push("// @" + headerKey.padEnd(13) + header[headerKey]);
  240. return headerString.push("// ==/UserScript=="), headerString.push(""), headerString.join("\n");
  241. });
  242. }, function(module, exports, __webpack_require__) {
  243. const Route = __webpack_require__(1), router = new (__webpack_require__(3))();
  244. router.push(new Route(/tags=(?:(.+))?/, __webpack_require__(7))), router.push(new Route(/post/, __webpack_require__(12))),
  245. module.exports = (async args => {
  246. router.load(args), GM_addStyle(__webpack_require__(13).toString()), console.debug("[RSSHelper]", __webpack_require__(13).toString());
  247. });
  248. }, function(module, exports, __webpack_require__) {
  249. const rssElem = $("<a/>"), config = __webpack_require__(8);
  250. rssElem.attr("id", "feed"), rssElem.attr("title", config.language.feed), rssElem.attr("target", "_blank"),
  251. rssElem.text(config.language.feed), module.exports = (async args => {
  252. rssElem.attr("href", `https://yande.re/post/piclens?tags=${args[1]}`), $("#post-list > div.sidebar > div:nth-child(1) > form > div").append(rssElem);
  253. });
  254. }, function(module, exports, __webpack_require__) {
  255. __webpack_require__(4).debug(__webpack_require__(9)("./en_US")), module.exports = {
  256. language: __webpack_require__(9)("./en_US"),
  257. rsshub: "https://rsshub.app"
  258. };
  259. }, function(module, exports, __webpack_require__) {
  260. var map = {
  261. "./config": 8,
  262. "./config.js": 8,
  263. "./en_US": 10,
  264. "./en_US.json": 10,
  265. "./zh_CN": 11,
  266. "./zh_CN.json": 11
  267. };
  268. function webpackContext(req) {
  269. var id = webpackContextResolve(req);
  270. return __webpack_require__(id);
  271. }
  272. function webpackContextResolve(req) {
  273. var id = map[req];
  274. if (!(id + 1)) {
  275. var e = new Error("Cannot find module '" + req + "'");
  276. throw e.code = "MODULE_NOT_FOUND", e;
  277. }
  278. return id;
  279. }
  280. webpackContext.keys = function() {
  281. return Object.keys(map);
  282. }, webpackContext.resolve = webpackContextResolve, module.exports = webpackContext,
  283. webpackContext.id = 9;
  284. }, function(module) {
  285. module.exports = {
  286. feed: "RSS Feed"
  287. };
  288. }, function(module) {
  289. module.exports = {
  290. feed: "RSS订阅"
  291. };
  292. }, function(module, exports, __webpack_require__) {
  293. const rssElem = $("<a/>"), config = __webpack_require__(8);
  294. rssElem.attr("id", "feed"), rssElem.attr("title", config.language.feed), rssElem.attr("target", "_blank"),
  295. rssElem.text(config.language.feed), module.exports = (async () => {
  296. rssElem.attr("href", "https://yande.re/post/piclens"), $("#post-list > div.sidebar > div:nth-child(1) > form > div").append(rssElem);
  297. });
  298. }, function(module, exports, __webpack_require__) {
  299. (module.exports = __webpack_require__(14)(!1)).push([ module.i, "#post-list>div.sidebar>div:first-child>form>div{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;line-height:20px}#post-list>div.sidebar>div:first-child>form>div #feed{margin-left:4px}", "" ]);
  300. }, function(module, exports) {
  301. module.exports = function(useSourceMap) {
  302. var list = [];
  303. return list.toString = function() {
  304. return this.map(function(item) {
  305. var content = function(item, useSourceMap) {
  306. var content = item[1] || "", cssMapping = item[3];
  307. if (!cssMapping) return content;
  308. if (useSourceMap && "function" == typeof btoa) {
  309. var sourceMapping = (sourceMap = cssMapping, "/*# sourceMappingURL=data:application/json;charset=utf-8;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */"), sourceURLs = cssMapping.sources.map(function(source) {
  310. return "/*# sourceURL=" + cssMapping.sourceRoot + source + " */";
  311. });
  312. return [ content ].concat(sourceURLs).concat([ sourceMapping ]).join("\n");
  313. }
  314. var sourceMap;
  315. return [ content ].join("\n");
  316. }(item, useSourceMap);
  317. return item[2] ? "@media " + item[2] + "{" + content + "}" : content;
  318. }).join("");
  319. }, list.i = function(modules, mediaQuery) {
  320. "string" == typeof modules && (modules = [ [ null, modules, "" ] ]);
  321. for (var alreadyImportedModules = {}, i = 0; i < this.length; i++) {
  322. var id = this[i][0];
  323. "number" == typeof id && (alreadyImportedModules[id] = !0);
  324. }
  325. for (i = 0; i < modules.length; i++) {
  326. var item = modules[i];
  327. "number" == typeof item[0] && alreadyImportedModules[item[0]] || (mediaQuery && !item[2] ? item[2] = mediaQuery : mediaQuery && (item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"),
  328. list.push(item));
  329. }
  330. }, list;
  331. };
  332. }, function(module, exports, __webpack_require__) {
  333. const Route = __webpack_require__(1), router = new (__webpack_require__(3))();
  334. router.push(new Route(/video\/av\d+/, __webpack_require__(16))), router.push(new Route(/space\.bilibili\.com\/(\d+)/, __webpack_require__(17))),
  335. router.push(new Route(/live\.bilibili\.com\/(\d+)/, __webpack_require__(18))), module.exports = (async args => {
  336. router.load(args), GM_addStyle(__webpack_require__(19).toString()), console.debug("[RSSHelper]", __webpack_require__(19).toString());
  337. });
  338. }, function(module, exports, __webpack_require__) {
  339. const config = __webpack_require__(8), rssPrefix = `${config.rsshub}/bilibili/user/video/`, rssElem = $("<a/>");
  340. rssElem.addClass("btn"), rssElem.addClass("bi-btn"), rssElem.attr("title", config.language.feed),
  341. rssElem.attr("id", "feed"), rssElem.attr("target", "_blank"), rssElem.text(config.language.feed),
  342. module.exports = (async () => {
  343. let mid = $("#v_upinfo .u-face>a").attr("href").match(/\d+/)[0];
  344. rssElem.attr("href", `${rssPrefix}${mid}`);
  345. let task = setInterval(() => {
  346. $(".more-ops-list").length && ($("#v_upinfo .btn").prepend(rssElem), clearInterval(task));
  347. }, 500);
  348. });
  349. }, function(module, exports, __webpack_require__) {
  350. const config = __webpack_require__(8), rssPrefix = `${config.rsshub}/bilibili/user/dynamic/`, rssElem = $("<a/>");
  351. rssElem.addClass("h-f-btn"), rssElem.attr("title", config.language.feed), rssElem.attr("id", "feed"),
  352. rssElem.attr("target", "_blank"), rssElem.text(config.language.feed), module.exports = (async args => {
  353. rssElem.attr("href", `${rssPrefix}${args[1]}`);
  354. let task = setInterval(() => {
  355. let elem = $(".h-action .h-message");
  356. elem.length && (elem.after(rssElem), clearInterval(task));
  357. }, 500);
  358. });
  359. }, function(module, exports, __webpack_require__) {
  360. const config = __webpack_require__(8), rssPrefix = `${config.rsshub}/bilibili/live/room/`, rssElem = $("<a/>");
  361. rssElem.addClass("p-absolute"), rssElem.attr("title", config.language.feed), rssElem.attr("id", "feed"),
  362. rssElem.attr("target", "_blank"), rssElem.text(config.language.feed), module.exports = (async args => {
  363. rssElem.attr("href", `${rssPrefix}${args[1]}`);
  364. let task = setInterval(() => {
  365. let elem = $(".room-info-down-row .attention-btn-ctnr");
  366. elem.length && (elem.after(rssElem), clearInterval(task));
  367. }, 500);
  368. });
  369. }, function(module, exports, __webpack_require__) {
  370. (module.exports = __webpack_require__(14)(!1)).push([ module.i, "#v_upinfo #feed{padding-left:16px;padding-right:16px;margin-left:12px;margin-top:0}.room-info-down-row #feed{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 #feed:hover{background-color:#23b9f1}", "" ]);
  371. }, function(module, exports, __webpack_require__) {
  372. const Route = __webpack_require__(1), router = new (__webpack_require__(3))();
  373. router.push(new Route(/\/(?!\d+\/)\d+/, __webpack_require__(21))), module.exports = (async args => {
  374. router.load(args);
  375. });
  376. }, function(module, exports, __webpack_require__) {
  377. __webpack_require__(4);
  378. const rssElem = $("<a/>"), config = __webpack_require__(8), rssPrefix = `${config.rsshub}/weibo/user/`;
  379. rssElem.addClass("W_btn_d"), rssElem.addClass("btn_34px"), rssElem.attr("title", config.language.feed),
  380. rssElem.addClass("W_btn_d"), rssElem.attr("target", "_blank"), rssElem.text(config.language.feed),
  381. module.exports = (async () => {
  382. rssElem.attr("href", rssPrefix + $CONFIG.oid);
  383. let task = setInterval(() => {
  384. let elem = $("div.pf_opt > .opt_box");
  385. elem.length && (elem.append(rssElem), clearInterval(task));
  386. }, 500);
  387. });
  388. }, function(module, exports, __webpack_require__) {
  389. const Route = __webpack_require__(1), router = new (__webpack_require__(3))();
  390. router.push(new Route(/member\.php\?id=\d+/, __webpack_require__(23))), router.push(new Route(/member_illust\.php\?.*illust_id=\d+/, __webpack_require__(24))),
  391. module.exports = (async args => {
  392. router.load(args), GM_addStyle(__webpack_require__(25).toString()), console.debug("[RSSHelper]", __webpack_require__(25).toString());
  393. });
  394. }, function(module, exports, __webpack_require__) {
  395. const rssElem = $("<a/>"), config = __webpack_require__(8), rssPrefix = `${config.rsshub}/pixiv/user/`;
  396. rssElem.addClass("YryPnZn _30SjOFD"), rssElem.attr("title", config.language.feed),
  397. rssElem.attr("id", "feed"), rssElem.attr("target", "_blank"), rssElem.text(config.language.feed),
  398. module.exports = (async () => {
  399. rssElem.attr("href", rssPrefix + Object.keys(globalInitData.preload.user)[0]);
  400. let task = setInterval(() => {
  401. let elem = $("div._3yalhqB");
  402. elem.length && (elem.append(rssElem), clearInterval(task));
  403. }, 500);
  404. });
  405. }, function(module, exports, __webpack_require__) {
  406. const rssElem = $("<a/>"), config = __webpack_require__(8), rssPrefix = `${config.rsshub}/pixiv/user/`;
  407. rssElem.addClass("YryPnZn"), rssElem.attr("title", config.language.feed), rssElem.attr("id", "feed"),
  408. rssElem.attr("target", "_blank"), rssElem.text(config.language.feed), module.exports = (async () => {
  409. rssElem.attr("href", rssPrefix + Object.keys(globalInitData.preload.user)[0]);
  410. let task = setInterval(() => {
  411. let elem = $(".sc-dRCTWM.cRuxjo");
  412. elem.length && (elem.append(rssElem), clearInterval(task));
  413. }, 500);
  414. });
  415. }, function(module, exports, __webpack_require__) {
  416. (module.exports = __webpack_require__(14)(!1)).push([ module.i, "#feed{text-decoration:none}._3yalhqB{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;width:auto}._3yalhqB #feed{margin-left:12px}.sc-dRCTWM.cRuxjo #feed{margin-top:12px}", "" ]);
  417. }, function(module, exports, __webpack_require__) {
  418. const config = __webpack_require__(8), logger = __webpack_require__(4), rssElem = $("<a>");
  419. rssElem.attr("id", "user-feed"), rssElem.attr("target", "_blank"), 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>');
  420. const rssElemText = $("<span>");
  421. rssElemText.text(config.language.feed), rssElem.append(rssElemText), module.exports = (async () => {
  422. const types = [ "application/rss+xml", "application/atom+xml", "application/rdf+xml", "application/rss", "application/atom", "application/rdf", "text/rss+xml", "text/atom+xml", "text/rdf+xml", "text/rss", "text/atom", "text/rdf" ];
  423. let feeds = [];
  424. $(() => {
  425. $("link[type]").each(function() {
  426. if (types.includes($(this).attr("type"))) {
  427. let feed = {
  428. href: $(this).attr("href"),
  429. name: $(this).attr("title")
  430. };
  431. feeds.push(feed);
  432. }
  433. }), logger.debug(feeds), rssElem.attr("href", feeds[0].href), rssElemText.text(feeds[0].name),
  434. $("body").append(rssElem), rssElem.mouseenter(() => {
  435. rssElem.css("width", rssElemText.width() + 24 + 8);
  436. }), rssElem.mouseleave(() => {
  437. rssElem.css("width", 24);
  438. });
  439. }), GM_addStyle(__webpack_require__(27).toString());
  440. });
  441. }, function(module, exports, __webpack_require__) {
  442. (module.exports = __webpack_require__(14)(!1)).push([ module.i, "#user-feed{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;position:fixed;top:24px;right:0;font-size:14px;border-bottom-left-radius:4px;border-top-left-radius:4px;background-color:#f8f8f8;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;color:#212121!important;overflow:hidden;line-height:24px;width:24px}#user-feed svg{min-width:24px}#user-feed span{margin-left:4px;white-space:nowrap;opacity:0;-webkit-transition:125ms ease-in-out;transition:125ms ease-in-out}#user-feed: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)}#user-feed:hover span{opacity:1}", "" ]);
  443. } ]);