scrapebadger-cli 0.31.0__tar.gz → 0.31.1__tar.gz
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.
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/PKG-INFO +1 -1
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/pyproject.toml +1 -1
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/facebook.py +8 -0
- scrapebadger_cli-0.31.1/tests/test_marketplace_monitor.py +58 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/.gitignore +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/CHANGELOG.md +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/README.md +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/__init__.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/availability.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/client.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/__init__.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/agent.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/airbnb.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/aliexpress.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/amazon.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/apartments.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/app_store.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/asos.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/auth.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/autoscout24.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/baidu.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/bestbuy.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/bing.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/booking.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/brave.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/chatgpt.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/copilot.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/depop.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/duckduckgo.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/ebay.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/etsy.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/gemini.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/github.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/google.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/google_play.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/gumtree.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/idealista.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/immobiliare.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/init.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/instagram.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/leboncoin.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/linkedin.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/loopnet.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/naver.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/onboarding.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/perplexity.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/realtor.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/reddit.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/redfin.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/stream.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/target.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/tiktok.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/twitter.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/vinted.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/wallapop.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/walmart.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/web.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/yahoo.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/yandex.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/yelp.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/youtube.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/zillow.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/config.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/main.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/output.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/results.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/views.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/tests/conftest.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/tests/test_agent_features.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/tests/test_autoscout24_commands.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/tests/test_brave.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/tests/test_cli_availability.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/tests/test_copilot_commands.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/tests/test_github.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/tests/test_google_light_search.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/tests/test_naver.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/tests/test_perplexity_strict_country.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/tests/test_tiktok_pagination.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/tests/test_vinted_image_search.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/tests/test_yelp_commands.py +0 -0
- {scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/uv.lock +0 -0
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/facebook.py
RENAMED
|
@@ -39,6 +39,12 @@ def marketplace_search(
|
|
|
39
39
|
radius: int | None = typer.Option(
|
|
40
40
|
None, "--radius", help="Search radius around the location (km, or miles in the US)"
|
|
41
41
|
),
|
|
42
|
+
strict_filters: bool = typer.Option(
|
|
43
|
+
False, "--strict-filters", help="Enforce radius (km) and age; partial public coverage"
|
|
44
|
+
),
|
|
45
|
+
include_details: bool = typer.Option(
|
|
46
|
+
False, "--include-details", help="Include descriptions and all public photos"
|
|
47
|
+
),
|
|
42
48
|
after: str | None = AFTER,
|
|
43
49
|
fmt: str = FMT,
|
|
44
50
|
fields: str | None = FIELDS,
|
|
@@ -57,6 +63,8 @@ def marketplace_search(
|
|
|
57
63
|
"delivery_method": delivery_method,
|
|
58
64
|
"radius": radius,
|
|
59
65
|
"after": after,
|
|
66
|
+
"strict_filters": strict_filters,
|
|
67
|
+
"include_details": include_details,
|
|
60
68
|
},
|
|
61
69
|
)
|
|
62
70
|
render(data, fmt, fields)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"""Monitoring must survive empty filtered pages and never lose undelivered IDs."""
|
|
2
|
+
|
|
3
|
+
import importlib.util
|
|
4
|
+
import json
|
|
5
|
+
import sqlite3
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
import pytest
|
|
9
|
+
|
|
10
|
+
_spec = importlib.util.spec_from_file_location(
|
|
11
|
+
"marketplace_monitor", Path(__file__).parents[3] / "examples/facebook_marketplace_monitor.py"
|
|
12
|
+
)
|
|
13
|
+
assert _spec and _spec.loader
|
|
14
|
+
monitor = importlib.util.module_from_spec(_spec)
|
|
15
|
+
_spec.loader.exec_module(monitor)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def test_empty_filtered_page_does_not_stop_and_locations_are_deduplicated(monkeypatch):
|
|
19
|
+
calls = []
|
|
20
|
+
|
|
21
|
+
def fetch(params, key):
|
|
22
|
+
calls.append(params)
|
|
23
|
+
if params["location"] == "london" and params["after"] is None:
|
|
24
|
+
return {
|
|
25
|
+
"listings": [],
|
|
26
|
+
"search_info": {},
|
|
27
|
+
"has_next_page": True,
|
|
28
|
+
"end_cursor": "sbmp1_next",
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
"listings": [
|
|
32
|
+
{"id": "same", "creation_time_utc": 2},
|
|
33
|
+
{"id": "old", "creation_time_utc": 1},
|
|
34
|
+
],
|
|
35
|
+
"search_info": {},
|
|
36
|
+
"has_next_page": False,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
monkeypatch.setattr(monitor, "fetch_page", fetch)
|
|
40
|
+
rows, _ = monitor.collect("bike", ["london", "newcastleupontyne"], 20, 3, "test")
|
|
41
|
+
assert len(calls) == 3
|
|
42
|
+
assert calls[1]["after"] == "sbmp1_next"
|
|
43
|
+
assert all(call["strict_filters"] and call["days_since_listed"] == 2 for call in calls)
|
|
44
|
+
assert [row["id"] for row in rows] == ["same", "old"]
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def test_seen_ids_commit_after_durable_output_and_failed_write_can_retry(tmp_path):
|
|
48
|
+
rows = [{"id": "new", "creation_time_utc": 2}]
|
|
49
|
+
with sqlite3.connect(tmp_path / "state.sqlite3") as db:
|
|
50
|
+
bad = tmp_path / "not-a-folder"
|
|
51
|
+
bad.write_text("file")
|
|
52
|
+
with pytest.raises(OSError):
|
|
53
|
+
monitor.save_new(db, "query", rows, [], bad / "result.json")
|
|
54
|
+
good = tmp_path / "first.json"
|
|
55
|
+
assert monitor.save_new(db, "query", rows, [], good) == 1
|
|
56
|
+
assert json.loads(good.read_text())["new_listings"] == rows
|
|
57
|
+
assert monitor.save_new(db, "query", rows, [], tmp_path / "second.json") == 0
|
|
58
|
+
assert monitor.save_new(db, "different-query", rows, [], tmp_path / "third.json") == 1
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/aliexpress.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/apartments.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/app_store.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/autoscout24.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/bestbuy.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/booking.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/chatgpt.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/copilot.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/duckduckgo.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/google_play.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/gumtree.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/idealista.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/immobiliare.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/instagram.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/leboncoin.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/linkedin.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/loopnet.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/onboarding.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/perplexity.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/realtor.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/twitter.py
RENAMED
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/wallapop.py
RENAMED
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/walmart.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scrapebadger_cli-0.31.0 → scrapebadger_cli-0.31.1}/src/scrapebadger_cli/commands/youtube.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|