crawlberg 1.11.0-x64-mingw-ucrt
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +168 -0
- data/Steepfile +14 -0
- data/ext/crawlberg_rb/native/Cargo.lock +3706 -0
- data/ext/crawlberg_rb/native/Cargo.toml +42 -0
- data/ext/crawlberg_rb/native/extconf.rb +19 -0
- data/ext/crawlberg_rb/src/lib.rs +10607 -0
- data/lib/crawlberg/native.rb +649 -0
- data/lib/crawlberg/version.rb +10 -0
- data/lib/crawlberg.rb +21 -0
- data/lib/crawlberg_rb/3.3.0/crawlberg_rb.so +4 -0
- data/sig/types.rbs +563 -0
- metadata +96 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 1107c3e83bb855a1bdd6da0fc1013dce362da8bb6565fb9e924276d42a00e589
|
|
4
|
+
data.tar.gz: dab4e22b01e8acd169a82d646cff5bce9386c908905b79d7c90a76a575234ac9
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: ee2d4ab45212e3fb11255bcda94aff79e3a06548398b8f08300e8d78945fff1f222582eb45a3fd841f04535a5dcca7ba68186035f0ccef02c846c0c0016471b4
|
|
7
|
+
data.tar.gz: 2be3ad290b9ab640e81c7413a9bb698943633ddd07424ec731263d323b749024281072f6cd8e496a1f9a89c258af0d3b5d6c24950193ba2ed17c4c60131f973c
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Kreuzberg, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
<!-- This file is auto-generated by alef — DO NOT EDIT. -->
|
|
2
|
+
<!-- alef:hash:fcb23a304253e2719260285609af11e93960b21fb56072d6816533f452223e9c -->
|
|
3
|
+
<!-- To regenerate: alef readme -->
|
|
4
|
+
<!-- To verify freshness: alef verify -->
|
|
5
|
+
|
|
6
|
+
<p align="center">
|
|
7
|
+
<picture>
|
|
8
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/xberg-io/assets@v1/banner/readme-banner-dark.svg">
|
|
9
|
+
<img alt="Xberg" width="420" src="https://cdn.jsdelivr.net/gh/xberg-io/assets@v1/banner/readme-banner-light.svg">
|
|
10
|
+
</picture>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
# crawlberg
|
|
14
|
+
|
|
15
|
+
<div align="center" style="display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 20px 0;">
|
|
16
|
+
<a href="https://github.com/xberg-io/alef">
|
|
17
|
+
<img src="https://img.shields.io/badge/built%20with-alef%20%D7%90-007ec6" alt="Built with alef">
|
|
18
|
+
</a>
|
|
19
|
+
<!-- Language Bindings -->
|
|
20
|
+
<a href="https://crates.io/crates/crawlberg">
|
|
21
|
+
<img src="https://img.shields.io/crates/v/crawlberg?label=Rust&color=007ec6" alt="Rust">
|
|
22
|
+
</a>
|
|
23
|
+
<a href="https://pypi.org/project/crawlberg/">
|
|
24
|
+
<img src="https://img.shields.io/pypi/v/crawlberg?label=Python&color=007ec6" alt="Python">
|
|
25
|
+
</a>
|
|
26
|
+
<a href="https://www.npmjs.com/package/@xberg-io/crawlberg">
|
|
27
|
+
<img src="https://img.shields.io/npm/v/@xberg-io/crawlberg?label=Node.js&color=007ec6" alt="Node.js">
|
|
28
|
+
</a>
|
|
29
|
+
<a href="https://www.npmjs.com/package/@xberg-io/crawlberg-wasm">
|
|
30
|
+
<img src="https://img.shields.io/npm/v/@xberg-io/crawlberg-wasm?label=WASM&color=007ec6" alt="WASM">
|
|
31
|
+
</a>
|
|
32
|
+
<a href="https://central.sonatype.com/artifact/io.xberg.crawlberg/crawlberg">
|
|
33
|
+
<img src="https://img.shields.io/maven-central/v/io.xberg.crawlberg/crawlberg?label=Java&color=007ec6" alt="Java">
|
|
34
|
+
</a>
|
|
35
|
+
<a href="https://pkg.go.dev/github.com/xberg-io/crawlberg/packages/go">
|
|
36
|
+
<img src="https://img.shields.io/github/v/tag/xberg-io/crawlberg?label=Go&color=007ec6" alt="Go">
|
|
37
|
+
</a>
|
|
38
|
+
<a href="https://www.nuget.org/packages/XbergIo.Crawlberg/">
|
|
39
|
+
<img src="https://img.shields.io/nuget/v/XbergIo.Crawlberg?label=C%23&color=007ec6" alt="C#">
|
|
40
|
+
</a>
|
|
41
|
+
<a href="https://packagist.org/packages/xberg-io/crawlberg">
|
|
42
|
+
<img src="https://img.shields.io/packagist/v/xberg-io/crawlberg?label=PHP&color=007ec6" alt="PHP">
|
|
43
|
+
</a>
|
|
44
|
+
<a href="https://rubygems.org/gems/crawlberg">
|
|
45
|
+
<img src="https://img.shields.io/gem/v/crawlberg?label=Ruby&color=007ec6" alt="Ruby">
|
|
46
|
+
</a>
|
|
47
|
+
<a href="https://hex.pm/packages/crawlberg">
|
|
48
|
+
<img src="https://img.shields.io/hexpm/v/crawlberg?label=Elixir&color=007ec6" alt="Elixir">
|
|
49
|
+
</a>
|
|
50
|
+
<a href="https://pub.dev/packages/crawlberg">
|
|
51
|
+
<img src="https://img.shields.io/pub/v/crawlberg?label=Dart&color=007ec6" alt="Dart">
|
|
52
|
+
</a>
|
|
53
|
+
<a href="https://central.sonatype.com/artifact/io.xberg.crawlberg.android/crawlberg-android">
|
|
54
|
+
<img src="https://img.shields.io/maven-central/v/io.xberg.crawlberg.android/crawlberg-android?label=Kotlin&color=007ec6" alt="Kotlin">
|
|
55
|
+
</a>
|
|
56
|
+
<a href="https://github.com/xberg-io/crawlberg/tree/main/packages/swift">
|
|
57
|
+
<img src="https://img.shields.io/badge/Swift-SPM-007ec6" alt="Swift">
|
|
58
|
+
</a>
|
|
59
|
+
<a href="https://github.com/xberg-io/crawlberg/tree/main/packages/zig">
|
|
60
|
+
<img src="https://img.shields.io/badge/Zig-package-007ec6" alt="Zig">
|
|
61
|
+
</a>
|
|
62
|
+
<a href="https://github.com/xberg-io/crawlberg/releases">
|
|
63
|
+
<img src="https://img.shields.io/badge/C-FFI-007ec6" alt="C FFI">
|
|
64
|
+
</a>
|
|
65
|
+
<a href="https://github.com/xberg-io/crawlberg/pkgs/container/crawlberg">
|
|
66
|
+
<img src="https://img.shields.io/badge/Docker-ghcr.io-007ec6?logo=docker&logoColor=white" alt="Docker">
|
|
67
|
+
</a>
|
|
68
|
+
|
|
69
|
+
<!-- Project Info -->
|
|
70
|
+
<a href="https://github.com/xberg-io/crawlberg/blob/main/LICENSE">
|
|
71
|
+
<img src="https://img.shields.io/badge/License-MIT-007ec6" alt="License">
|
|
72
|
+
</a>
|
|
73
|
+
<a href="https://docs.crawlberg.xberg.io">
|
|
74
|
+
<img src="https://img.shields.io/badge/Docs-crawlberg-007ec6" alt="Documentation">
|
|
75
|
+
</a>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<div align="center" style="display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 28px 0 24px;">
|
|
79
|
+
<a href="https://discord.gg/xt9WY3GnKR">
|
|
80
|
+
<img height="22" src="https://img.shields.io/badge/Discord-Chat-007ec6?logo=discord&logoColor=white" alt="Join Discord">
|
|
81
|
+
</a>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
Ruby bindings for **crawlberg** — a high-performance Rust web crawling engine. Powered by
|
|
85
|
+
Magnus with native Ruby objects, full metadata extraction, and Markdown conversion.
|
|
86
|
+
|
|
87
|
+
## What This Package Provides
|
|
88
|
+
|
|
89
|
+
- **Same crawler as every binding** — one Rust engine behind Python, Node.js, Ruby, Go, Java, .NET, PHP, Elixir, Dart, Kotlin Android, Swift, Zig, WASM, and C FFI.
|
|
90
|
+
- **Structured scrape output** — HTML, Markdown, metadata, links, assets, response headers, and extraction warnings with consistent field names.
|
|
91
|
+
- **Crawl controls** — depth, page limits, concurrency, URL filters, robots/sitemap handling, rate limits, and partial failure reporting.
|
|
92
|
+
- **Rendering path** — optional browser rendering for JavaScript-heavy pages; direct HTTP path for fast static pages.
|
|
93
|
+
- **Ruby package** — Magnus-backed native extension with Ruby objects for crawl results.
|
|
94
|
+
|
|
95
|
+
## Installation
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
gem install crawlberg
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Agent plugin
|
|
102
|
+
|
|
103
|
+
The `crawlberg` plugin is available via the `xberg-io/crawlberg` marketplace.
|
|
104
|
+
|
|
105
|
+
```text
|
|
106
|
+
/plugin marketplace add xberg-io/crawlberg
|
|
107
|
+
/plugin install crawlberg@crawlberg
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
See [the plugin guide](https://github.com/xberg-io/crawlberg/blob/main/plugin/README.md) for all supported runtimes, CLI prerequisites and standalone public skills.
|
|
111
|
+
|
|
112
|
+
## Quick Start
|
|
113
|
+
|
|
114
|
+
```ruby title="Ruby"
|
|
115
|
+
require "crawlberg"
|
|
116
|
+
|
|
117
|
+
# Simplest case: scrape a single page with default settings.
|
|
118
|
+
engine = Crawlberg.create_engine
|
|
119
|
+
result = Crawlberg.scrape(engine, "https://example.com/")
|
|
120
|
+
puts "Title: #{result.metadata.title}"
|
|
121
|
+
puts "Status: #{result.status_code}"
|
|
122
|
+
puts "Links found: #{result.links.length}"
|
|
123
|
+
|
|
124
|
+
# Crawl from a seed URL, limited to one hop and a handful of pages.
|
|
125
|
+
config = Crawlberg::CrawlConfig.new(max_depth: 1, max_pages: 5)
|
|
126
|
+
crawl_engine = Crawlberg.create_engine(config)
|
|
127
|
+
crawl_result = Crawlberg.crawl(crawl_engine, "https://en.wikipedia.org/wiki/Web_scraping")
|
|
128
|
+
puts "Pages crawled: #{crawl_result.pages.length}"
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## API Reference
|
|
132
|
+
|
|
133
|
+
Full API documentation is available at [docs.crawlberg.xberg.io](https://docs.crawlberg.xberg.io).
|
|
134
|
+
|
|
135
|
+
Key functions:
|
|
136
|
+
|
|
137
|
+
- `create_engine(config?)` — Create a crawl engine with optional configuration
|
|
138
|
+
- `scrape(engine, url)` — Scrape a single URL
|
|
139
|
+
- `crawl(engine, url)` — Crawl a website following links
|
|
140
|
+
- `map_urls(engine, url)` — Discover all pages on a site
|
|
141
|
+
- `batch_scrape(engine, urls)` — Scrape multiple URLs concurrently
|
|
142
|
+
- `batch_crawl(engine, urls)` — Crawl multiple seed URLs concurrently
|
|
143
|
+
|
|
144
|
+
## Contributing
|
|
145
|
+
|
|
146
|
+
Contributions are welcome! Please see our [Contributing Guide](https://github.com/xberg-io/crawlberg/blob/main/CONTRIBUTING.md) for details.
|
|
147
|
+
|
|
148
|
+
## Part of Xberg.io
|
|
149
|
+
|
|
150
|
+
- [Xberg](https://github.com/xberg-io/xberg) — the open-source content-intelligence engine: text, tables, and metadata from 101 formats (115 file extensions), with OCR, transcription, and code intelligence. MIT.
|
|
151
|
+
- [Xberg Pro](https://xberg.io) — a complete self-hosted content-intelligence backend in a single container. Commercial.
|
|
152
|
+
- [Xberg Enterprise](https://xberg.io) — the distributed, governed content-intelligence platform, scaled on Kubernetes with team governance and support. Commercial.
|
|
153
|
+
- [crawlberg](https://github.com/xberg-io/crawlberg) — web crawling and scraping with HTML→Markdown and headless-Chrome fallback.
|
|
154
|
+
- [html-to-markdown](https://github.com/xberg-io/html-to-markdown) — fast, lossless HTML→Markdown engine.
|
|
155
|
+
- [liter-llm](https://github.com/xberg-io/liter-llm) — universal LLM API client with native bindings for 14 languages and 165 providers.
|
|
156
|
+
- [tree-sitter-language-pack](https://github.com/xberg-io/tree-sitter-language-pack) — tree-sitter grammars and code-intelligence primitives.
|
|
157
|
+
- [alef](https://github.com/xberg-io/alef) — the polyglot binding generator that produces every per-language binding across the 5 polyglot repos.
|
|
158
|
+
- [Discord](https://discord.gg/xt9WY3GnKR) — community, roadmap, announcements.
|
|
159
|
+
|
|
160
|
+
## License
|
|
161
|
+
|
|
162
|
+
This project is licensed under [MIT License](https://github.com/xberg-io/crawlberg/blob/main/LICENSE).
|
|
163
|
+
|
|
164
|
+
## Links
|
|
165
|
+
|
|
166
|
+
- [Documentation](https://docs.crawlberg.xberg.io)
|
|
167
|
+
- [GitHub Repository](https://github.com/xberg-io/crawlberg)
|
|
168
|
+
- [Issue Tracker](https://github.com/xberg-io/crawlberg/issues)
|
data/Steepfile
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
target :lib do
|
|
4
|
+
signature "sig"
|
|
5
|
+
check "lib"
|
|
6
|
+
# The generated `lib/crawlberg/native.rb` carries inline Sorbet
|
|
7
|
+
# `sig { ... }` blocks on tagged-enum variant Data classes. Sorbet's runtime
|
|
8
|
+
# provides those via `extend T::Sig`, but Steep does not understand the
|
|
9
|
+
# extension (it relies on RBS, not Sorbet sigs) and reports
|
|
10
|
+
# `Type `self` does not have method `sig`` on every block. RBS coverage
|
|
11
|
+
# for the same surface lives in `sig/types.rbs`, so we steer Steep to the
|
|
12
|
+
# RBS file by ignoring the .rb.
|
|
13
|
+
ignore "lib/crawlberg/native.rb"
|
|
14
|
+
end
|