Glanceway Glanceway
Все источники

日本最大の開発者向け技術記事プラットフォーム Qiita の人気記事

@codytseng #qiita #japanese #tech #articles

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.

Configuration checklist

  • TAG — Optional. タグでフィルター(例:Python, JavaScript, React)。空欄の場合は全タグの人気記事を表示します。 Add each value as a separate list item.

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.

Настройки

Название Ключ Тип Обязательно По умолчанию Описание
タグ TAG list Нет — タグでフィルター(例:Python, JavaScript, React)。空欄の場合は全タグの人気記事を表示します。

Исходный код

id: codytseng/qiita
version: 1.0.0
name: Qiita
description: 日本最大の開発者向け技術記事プラットフォーム Qiita の人気記事
author: codytseng
author_url: https://github.com/codytseng
category: Developer
tags:
  - qiita
  - japanese
  - tech
  - articles

config:
  - key: TAG
    name: タグ
    type: list
    required: false
    description: タグでフィルター(例:Python, JavaScript, React)。空欄の場合は全タグの人気記事を表示します。
module.exports = async (api) => {
  const tags = api.config.get("TAG") ?? [];

  async function fetchData() {
    const toItems = (articles) =>
      articles.map((article) => ({
        id: article.id,
        title: article.title,
        subtitle:
          article.body?.slice(0, 120)?.replace(/\n/g, " ") ||
          `${article.likes_count} いいね · @${article.user.id}`,
        url: article.url,
        timestamp: article.created_at,
      }));

    if (tags.length > 0) {
      const perPage = Math.min(100, Math.floor(500 / tags.length));
      await Promise.allSettled(
        tags.map(async (tag) => {
          const res = await api.fetch(
            `https://qiita.com/api/v2/tags/${encodeURIComponent(tag)}/items?per_page=${perPage}&page=1`,
          );
          if (res.ok && res.json) {
            api.emit(toItems(res.json));
          }
        }),
      );
    } else {
      const res = await api.fetch(
        "https://qiita.com/api/v2/items?per_page=100&page=1",
      );
      if (!res.ok || !res.json) {
        throw new Error(`Failed to fetch Qiita articles (HTTP ${res.status})`);
      }
      api.emit(toItems(res.json));
    }
  }

  await fetchData();

  return {
    refresh: fetchData,
  };
};

Похожие источники