Files
RSSHub/lib/routes/qoo-app/utils.ts
T
dependabot[bot]andTony 07834413f5 chore(deps-dev): bump eslint-plugin-unicorn from 64.0.0 to 65.0.0 (#22219)
* chore(deps-dev): bump eslint-plugin-unicorn from 64.0.0 to 65.0.0

Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 64.0.0 to 65.0.0.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v64.0.0...v65.0.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-unicorn
  dependency-version: 65.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: no-array-from-fill

* fix: unicorn-js/no-duplicate-set-values

* fix: no-this-outside-of-class

* fix: no-unnecessary-nested-ternary

* fix: prefer-array-last-methods

* fix: prefer-queue-microtask

* fix: prefer-split-limit

* fix: no-array-from-fill

* fix: no-unused-array-method-return

* fix: prefer-single-call

* fix: prefer-includes-over-repeated-comparisons

* fix: consistent-compound-words

* fix: prefer-includes-over-repeated-comparisons

* chore: add eslint-plugin-unicorn v65 recommended preset

* fix: correct duration parsing logic in parseDuration function

* fix: update oxlint-disable

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tony <TonyRL@users.noreply.github.com>
2026-06-09 00:08:15 +08:00

48 lines
1.8 KiB
TypeScript

import { parseDate } from '@/utils/parse-date';
import timezone from '@/utils/timezone';
const appsUrl = 'https://apps.qoo-app.com';
const newsUrl = 'https://news.qoo-app.com';
const notesUrl = 'https://notes.qoo-app.com';
const ssoUrl = 'https://sso.qoo-app.com';
const userUrl = 'https://user.qoo-app.com';
const siteIcon = 'https://o.qoo-img.com/statics.qoo-app.com/cdn/img/QooApp_512.v-0d0fd2.png';
const fixImg = ($) => {
$('img').each((_, img) => {
if (img.attribs['data-orig-file']) {
img.attribs.src = img.attribs['data-orig-file'].replace('i0.wp.com/', '').split('?', 1)[0];
delete img.attribs['data-orig-file'];
delete img.attribs['data-orig-size'];
delete img.attribs['data-image-meta'];
delete img.attribs['data-comments-opened'];
delete img.attribs['data-full-url'];
delete img.attribs['data-medium-file'];
delete img.attribs['data-large-file'];
}
img.attribs.src = img.attribs.src.replace('i0.wp.com/', '').split('?', 1)[0];
delete img.attribs.srcset;
});
};
const extractNotes = ($) =>
$('.qoo-note-wrap')
.toArray()
.map((item) => {
item = $(item);
const title = item.find('.qoo-note-view .content-title').text();
const author = item.find('cite.name').text();
const pubDate = timezone(parseDate(item.find('time').text(), 'YYYY-MM-DD HH:mm'), 8);
item.find('cite.name, time, footer').remove();
return {
title,
description: item.find('.qoo-note-view').html(),
link: item.find('a.link-wrap').attr('href'),
pubDate,
author,
};
});
export { appsUrl, extractNotes, fixImg, newsUrl, notesUrl, siteIcon, ssoUrl, userUrl };