Spaces:
Sleeping
Sleeping
Download apps/ruby-sdk/lib/firecrawl/models/batch_scrape_job.rb from s-eto-hub/firecrawl-api: direct link, hf CLI and curl.
- Browser
- Download file 833 Bytes
-
https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/ruby-sdk/lib/firecrawl/models/batch_scrape_job.rb
- Command line
-
hf download hf://spaces/s-eto-hub/firecrawl-api/apps/ruby-sdk/lib/firecrawl/models/batch_scrape_job.rb
-
curl -L -o batch_scrape_job.rb https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/ruby-sdk/lib/firecrawl/models/batch_scrape_job.rb
833 Bytes
| # frozen_string_literal: true | |
| module Firecrawl | |
| module Models | |
| # Status and results of a batch scrape job. | |
| class BatchScrapeJob | |
| attr_reader :id, :status, :total, :completed, :credits_used, | |
| :expires_at, :next_url | |
| attr_accessor :data | |
| def initialize(raw) | |
| @id = raw["id"] | |
| @status = raw["status"] | |
| @total = raw["total"].to_i | |
| @completed = raw["completed"].to_i | |
| @credits_used = raw["creditsUsed"] | |
| @expires_at = raw["expiresAt"] | |
| @next_url = raw["next"] | |
| @data = (raw["data"] || []).map { |d| Document.new(d) } | |
| end | |
| def done? | |
| %w[completed failed cancelled].include?(status) | |
| end | |
| def to_s | |
| "BatchScrapeJob{id=#{id}, status=#{status}, completed=#{completed}/#{total}}" | |
| end | |
| end | |
| end | |
| end | |