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

Lobsters

Разработка v1.0.0

Hottest stories from Lobsters

@codytseng #news #tech #programming

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. Filter by tag (e.g. programming, security, linux). Leave empty for all tags. 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 TAG list Нет — Filter by tag (e.g. programming, security, linux). Leave empty for all tags.

Исходный код

id: codytseng/lobsters
version: 1.0.0
name: Lobsters
description: Hottest stories from Lobsters
author: codytseng
author_url: https://github.com/codytseng
category: Developer
tags:
  - news
  - tech
  - programming

config:
  - key: TAG
    name: Tag
    type: list
    required: false
    description: Filter by tag (e.g. programming, security, linux). Leave empty for all tags.
module.exports = async (api) => {
  const tags = api.config.get("TAG");

  async function fetchData() {
    const url =
      tags && tags.length > 0
        ? `https://lobste.rs/t/${tags.join(",")}.json`
        : "https://lobste.rs/hottest.json";

    const response = await api.fetch(url);

    if (!response.ok || !response.json) {
      throw new Error(
        `Failed to fetch Lobsters stories (HTTP ${response.status})`,
      );
    }

    api.emit(
      response.json.map((story) => ({
        id: story.short_id,
        title: story.title,
        subtitle:
          story.description_plain ||
          `${story.score} points · ${story.comment_count} comments · ${story.tags.join(", ")}`,
        url: story.url || story.comments_url,
        timestamp: story.created_at,
      })),
    );
  }

  await fetchData();

  return {
    refresh: fetchData,
  };
};

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