Skip to content

Commit

Permalink
chore(format): add xml return format
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Oct 11, 2024
1 parent dba2213 commit 990324f
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 31 deletions.
4 changes: 2 additions & 2 deletions cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spider-cloud-cli"
version = "0.1.4"
version = "0.1.5"
edition = "2021"
authors = [ "j-mendez <[email protected]>"]
description = "The Spider Cloud CLI for web crawling and scraping"
Expand Down
4 changes: 2 additions & 2 deletions javascript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion javascript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-cloud/spider-client",
"version": "0.0.71",
"version": "0.0.72",
"description": "Isomorphic Javascript SDK for Spider Cloud services",
"scripts": {
"test": "node --import tsx --test __tests__/*test.ts",
Expand Down
1 change: 1 addition & 0 deletions javascript/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export type ReturnFormat =
| "text"
| "html2text"
| "bytes"
| "xml"
| "empty";

// Map automation scripts for paths or urls.
Expand Down
4 changes: 2 additions & 2 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ def read_file(fname):

setup(
name="spider-client",
version="0.0.71",
version="0.0.72",
url="https://github.com/spider-rs/spider-clients/tree/main/python",
author="Spider",
author_email="jeff@a11ywatch.com",
author_email="jeff@spider.cloud",
description="Python SDK for Spider Cloud API",
packages=find_packages(),
install_requires=["requests"],
Expand Down
2 changes: 1 addition & 1 deletion python/spider/async_spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def _prepare_headers(
return {
"Content-Type": content_type,
"Authorization": f"Bearer {self.api_key}",
"User-Agent": "AsyncSpider-Client/0.0.71",
"User-Agent": "AsyncSpider-Client/0.0.72",
}

async def _handle_error(self, response: ClientResponse, action: str) -> None:
Expand Down
2 changes: 1 addition & 1 deletion python/spider/spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def _prepare_headers(self, content_type: str = "application/json"):
return {
"Content-Type": content_type,
"Authorization": f"Bearer {self.api_key}",
"User-Agent": f"Spider-Client/0.0.71",
"User-Agent": f"Spider-Client/0.0.72",
}

def _post_request(self, url: str, data, headers, stream=False):
Expand Down
2 changes: 1 addition & 1 deletion python/spider/spider_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class CSSSelector(TypedDict):
# - Values are lists of CSSSelector items
CSSExtractionMap = Dict[str, List[CSSSelector]]

ReturnFormat = Literal["raw", "markdown", "commonmark", "html2text", "text", "bytes"];
ReturnFormat = Literal["raw", "markdown", "commonmark", "html2text", "text", "xml", "bytes"];

class RequestParamsDict(TypedDict, total=False):
# The URL to be crawled.
Expand Down
38 changes: 19 additions & 19 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spider-client"
version = "0.1.20"
version = "0.1.21"
edition = "2021"
authors = [ "j-mendez <[email protected]>"]
description = "Spider Cloud client"
Expand Down
2 changes: 2 additions & 0 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,8 @@ pub enum ReturnFormat {
Html2text,
/// Return the response as Text.
Text,
/// Return the response as XML.
Xml,
/// Return the response as Bytes.
Bytes,
}
Expand Down

0 comments on commit 990324f

Please sign in to comment.