Glanceway Glanceway
جميع المصادر

金十数据

المالية v1.0.0

金十数据快讯

@codytseng #finance #news #chinese #market

Install and configure this source

  1. Install Glanceway and open it on your Mac before using the install link above.
  2. Choose Install in Glanceway. If the browser cannot open the app, download the .gwsrc file and import it through source management.
  3. Complete the required fields below, save, and choose a refresh interval. Check the source after its first successful fetch.

This version does not require configuration fields. Install it and allow the initial fetch to complete.

If items are missing

  • Verify the field names, list entries, and credentials against the current version’s configuration table. Sample values below are examples, not active credentials.
  • Check network access and upstream service availability. Authentication failures and rate limits can prevent a refresh; use a slower interval when the provider limits requests.
  • An empty result can also mean there are no matching items. Fetched content and update timing depend on the provider and source implementation.

الشيفرة المصدرية

id: codytseng/jin10
version: 1.0.0
name: 金十数据
description: 金十数据快讯
author: codytseng
author_url: https://github.com/codytseng
category: Finance
tags:
  - finance
  - news
  - chinese
  - market
function stripHtml(html) {
  return html.replace(/<[^>]*>/g, "").trim();
}

module.exports = async (api) => {
  async function fetchData() {
    const response = await api.fetch(
      "https://flash-api.jin10.com/get_flash_list?channel=-8200&vip=1",
      {
        headers: {
          "x-app-id": "bVBF4FyRTn5NJF5n",
          "x-version": "1.0.0",
        },
      },
    );

    if (!response.ok || !response.json) {
      throw new Error(`Failed to fetch Jin10 flash news (HTTP ${response.status})`);
    }

    const items = [];

    for (const item of response.json.data) {
      if (item.type === 1) {
        continue;
      }

      let title;
      let url;

      if (item.type === 2) {
        title = item.data.title ?? "";
        url = item.data.link;
      } else {
        const content = stripHtml(item.data.content ?? "");
        const match = content.match(/【(.+?)】/);
        title = match ? match[1] : content;
        url = "https://www.jin10.com/flash";
      }

      if (!title) {
        continue;
      }

      items.push({
        id: item.id,
        title,
        subtitle: stripHtml(item.data.content ?? ""),
        url,
        timestamp: item.time,
      });
    }

    api.emit(items);
  }

  await fetchData();

  return {
    refresh: fetchData,
  };
};

مصادر ذات صلة