# 450 summary of url contents appropriate for mastodon posting

**URL:** <https://www.twit.community/t/450-summary-of-url-contents-appropriate-for-mastodon-posting/20092>\
**Category:** Software\
**Created:** [June 4, 2026, 11:33pm UTC](https://www.twit.community/t/450-summary-of-url-contents-appropriate-for-mastodon-posting/20092 "2026-06-04T23:33:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mainmeister](https://sea2.discourse-cdn.com/flex020/user_avatar/www.twit.community/mainmeister/32/875_2.png) [@mainmeister](https://www.twit.community/u/mainmeister)\
**Post date:** [June 4, 2026, 11:33pm UTC](https://www.twit.community/t/450-summary-of-url-contents-appropriate-for-mastodon-posting/20092/1 "2026-06-04T23:33:27Z")

</div>

[https://github.com/mainmeister/urlsum](https://ai-driven%20450-character%20hard%20limit%20summary%20of%20the%20contents%20of%20a%20url.)

# **urlsum**

AI-driven 450-character hard limit summary of the contents of a URL.

## **Features**

- Summarizes webpages into a single, concise paragraph.
- Enforces a strict 450-character limit with complete sentences.
- Supports Google Gemini API (default).
- Supports local Ollama models.
- Automatically copies the summary to the clipboard (supports Wayland and X11).
- Can output scraped text in a clean human-readable form.

## **Installation**

### **Prerequisites**

- Python 3.x
- `requests`
- `crawlee[beautifulsoup]`
- (Optional) `wl-copy`, `xclip`, or `xsel` for clipboard support.

### **Setup**

1. Clone the repository:

2. Install dependencies:

3. (Optional) Make the script executable and add it to your PATH.

## **Usage**

```auto
usage: urlsum [-h] [--set-key SET_KEY] [-d] [-m MODEL] [-o [OLLAMA]] [-t TIMEOUT] [-v] [--no-clipboard] [url]

AI-driven 450-character hard limit summary of the contents of a URL.

positional arguments:
  url The URL of the webpage to summarize.

options:
  -h, --help show this help message and exit
  --set-key SET_KEY Save your Gemini API key to the config file.
  -d, --default Set the default Ollama model.
  -m MODEL, --model MODEL
                        Gemini model to use (default: gemini-2.5-flash).
  -o [OLLAMA], --ollama [OLLAMA]
                        Use local Ollama service instead of Gemini. Optional: model name (default: llama3).
  -t TIMEOUT, --timeout TIMEOUT
                        Timeout for Ollama service (e.g., 300 or 5:00). Default: 600s.
  -v, --verbose Output the scraped text in a clean human-readable form.
  --no-clipboard Do not copy the summary to the clipboard.

```

### **Examples**

#### **Using Gemini (Default)**

First, set your API key:

```auto
urlsum --set-key YOUR_GEMINI_API_KEY

```

Summarize a URL:

```auto
urlsum https://example.com

```

#### **Using Ollama**

Set a default Ollama model:

```auto
urlsum -d

```

Summarize using Ollama:

```auto
urlsum -o https://example.com

```

Specify a different model for a single run:

```auto
urlsum -o llama3.2 https://example.com

```

## **Configuration**

Settings are stored in `~/.config/urlsum/config.json`.

## **License**

MIT
