Giter Site home page Giter Site logo

mercari-scanner's Introduction

Mercari Scanner

Image of Mercari

Installation

pip

pip install mercari-scanner
python3 -m mercariscanner "RTX 3080"

Docker

docker pull chadbowman0/mercari-scanner:latest
docker run chadbowman0/mercari-scanner:latest "RTX 3080"

Local (with config.ini)

git clone https://github.com/ChadBowman/mercari-scanner.git ~/mercari-scanner
python3 -m venv ~/mercari-scanner/env && source ~/mercari-scanner/env/bin/activate
python3 -m pip install ~/mercari-scanner
python3 -m mercariscanner "RTX 3080"

Usage

usage: __main__.py [-h] [--min-price MIN_PRICE] [--max-price MAX_PRICE] [--delay DELAY] [--slack-token SLACK_TOKEN]
                   [--slack-channel SLACK_CHANNEL] [--tiers TIERS] [--start-stop-alert | --no-start-stop-alert]
                   keyword

positional arguments:
  keyword               Mercari search keyword

options:
  -h, --help            show this help message and exit
  --min-price MIN_PRICE
                        Amount in dollars to filter out items less than min-price
  --max-price MAX_PRICE
                        Amount in dollars to filter out items more than max-price
  --delay DELAY         Time in seconds to wait before the next scan (default: 60)
  --slack-token SLACK_TOKEN
                        Slack API token
  --slack-channel SLACK_CHANNEL
                        Slack channel to publish alerts to
  --tiers TIERS         Semi-colon-separated key-value pairs that define tier message templates. A template will be used if an item
                        is less than or equal to the amount. Example: "420=Wow! {name} is an amazing deal! Only ${price}; 1000=Hey
                        check out this less cool deal{newline}{url}". Available variables: price, name, url, newline
  --start-stop-alert, --no-start-stop-alert
                        Alert when scanner starts and stops

Alerters

Slack

Pass the --slack-token and --slack-channel arguments:

python3 -m mercariscanner --slack-token xoxb-blah-blah --slack-channel mercari "Beavis and Butt-Head DVD"

or

Modify config.ini to include your Slack API bot token and the channel you want to alert to:

[slack]
token = xoxb-blah-blah
channel = mercari

mercari-scanner's People

Contributors

chadbowman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

opalkmm

mercari-scanner's Issues

GET request does not return anything

Hi!
Sorry to bother you, but I was really intersted in testing this project.
I could run it succesfully until today when i started to get the error with the GET request:

2023-01-18 21:27:57 [scrapy.core.engine] DEBUG: Crawled (200) <GET https://www.mercari.com/v1/api?operationName=searchFacetQuery&variables=%7B%22criteria%22%3A%7B%22offset%22%3A0%2C%22soldItemsOffset%22%3A0%2C%22promotedItemsOffset%22%3A0%2C%22sortBy%22%3A2%2C%22length%22%3A30%2C%22query%22%3A%22stray%20kids%22%2C%22itemConditions%22%3A%5B%5D%2C%22shippingPayerIds%22%3A%5B%5D%2C%22sizeGroupIds%22%3A%5B%5D%2C%22sizeIds%22%3A%5B%5D%2C%22itemStatuses%22%3A%5B1%5D%2C%22customFacets%22%3A%5B%5D%2C%22facets%22%3A%5B1%2C2%2C3%2C5%2C7%2C8%2C9%2C10%2C11%2C13%5D%2C%22authenticities%22%3A%5B%5D%2C%22deliveryType%22%3A%22all%22%2C%22state%22%3Anull%2C%22locale%22%3Anull%2C%22shopPageUri%22%3Anull%2C%22withCouponOnly%22%3Anull%7D%2C%22categoryId%22%3A0%7D&extensions=%7B%22persistedQuery%22%3A%7B%22version%22%3A1%2C%22sha256Hash%22%3A%22a234c160e270e63c7689739e191d207884eea0c46f344b66a17a59bcc7f725fa%22%7D%7D> (referer: None)
2023-01-18 21:27:58 [scrapy.core.scraper] ERROR: Spider error processing <GET https://www.mercari.com/v1/api?operationName=searchFacetQuery&variables=%7B%22criteria%22%3A%7B%22offset%22%3A0%2C%22soldItemsOffset%22%3A0%2C%22promotedItemsOffset%22%3A0%2C%22sortBy%22%3A2%2C%22length%22%3A30%2C%22query%22%3A%22stray%20kids%22%2C%22itemConditions%22%3A%5B%5D%2C%22shippingPayerIds%22%3A%5B%5D%2C%22sizeGroupIds%22%3A%5B%5D%2C%22sizeIds%22%3A%5B%5D%2C%22itemStatuses%22%3A%5B1%5D%2C%22customFacets%22%3A%5B%5D%2C%22facets%22%3A%5B1%2C2%2C3%2C5%2C7%2C8%2C9%2C10%2C11%2C13%5D%2C%22authenticities%22%3A%5B%5D%2C%22deliveryType%22%3A%22all%22%2C%22state%22%3Anull%2C%22locale%22%3Anull%2C%22shopPageUri%22%3Anull%2C%22withCouponOnly%22%3Anull%7D%2C%22categoryId%22%3A0%7D&extensions=%7B%22persistedQuery%22%3A%7B%22version%22%3A1%2C%22sha256Hash%22%3A%22a234c160e270e63c7689739e191d207884eea0c46f344b66a17a59bcc7f725fa%22%7D%7D> (referer: None)

As it returns nothing all further functions fail at parsing the response as supposed.
I tried manually updating scrapy, but it didn't change anything, and I am quite at loss how to investigate further.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.