ebay-snipe-server

An eBay auction sniping service managed by a RESTful API

  • 所有者: ruippeixotog/ebay-snipe-server
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

eBay Snipe Server

A simple eBay auction sniping service that provides a RESTful API for managing scheduled snipes.

It is written in Scala and makes use of the scala-scraper library for parsing content and interacting with eBay. Some concepts and ideas are inspired in JBidwatcher.

Quick Start

The quickest way to get the service up is to use Docker. An image is available on Docker Hub and can be started with the following command:

docker run -d -p 3647:3647 \
  -e 'EBAY_USERNAME=<your_username>' -e 'EBAY_PASSWORD=<your_password>' \
  ruippeixotog/ebay-snipe-server:0.2.2

The web service will be available on port 3647. You can also optionally mount the volumes /opt/docker/appdata containing persistent application state and /opt/docker/logs containing application logs:

docker run -d -p 3647:3647 \
  -e 'EBAY_USERNAME=<your_username>' -e 'EBAY_PASSWORD=<your_password>' \
  -v '<path_to_appdata_in_host>:/opt/docker/appdata' \
  -v '<path_to_logs_in_host>:/opt/docker/logs' \
  ruippeixotog/ebay-snipe-server:0.2.2

If you need to change the default configurations or fiddle with the source code, keep reading for instructions on how to build the project.

Building

The server has SBT as a build dependency. If you do not have it installed yet and you are using a Unix-based OS, I recommend using the sbt-extras script.

The server must be given the eBay credentials to be used for bidding on auctions. Create a src/main/resources/application.conf file with the following content:

ebay {
  username = "<your_username>"
  password = "<your_password>"
}

You can look at src/main/resources/reference.conf to check for additional server settings you can override.

You can start the server directly with SBT by running the SnipeServer main class. Alternatively, you can also create a self-contained package by running:

sbt universal:packageBin

A zip file will be created in target/universal. It can then be sent to any computer and run by extracting the archive and executing the extracted bin/ebay-snipe-server script. Only a JVM installation is required in the production machine.

API

All the successful responses returned by the server, as well as the entities accepted in POST and PUT requests, are JSON documents. POST and PUT requests must include a proper Content-Type: application/json header.

The server currently supports the following HTTP endpoints:

  • GET /auction/{auctionId}

Retrieves information about an auction from eBay.

  • GET /auction/{auctionId}/snipe

Returns information about the snipe currently scheduled for an auction.

  • POST /auction/{auctionId}/snipe

Submits information for a snipe to be scheduled for an auction. For scheduling a bid of 0.5 US dollars (the server's default currency), one can simply submit:

{
    "bid": 0.5
}

The request can also include the currency to use, a description, a specific time for the snipe to take place and the quantity of items to bid for. If a time is not provided, the server will schedule the snipe for a time it sees fit. The default quantity of items to bid for is 1. The full snipe JSON would be:

{
    "bid": "USD 0.5",
    "description": "cheap and awesome item",
    "quantity": 1,
    "snipeTime": "2014-08-05T02:29:06.690"
}
  • DELETE /auction/{auctionId}/snipe

Cancels a previously scheduled snipe for an auction.

  • GET /snipes

Returns all the currently scheduled snipes.

Copyright (c) 2014 Rui Gonçalves. See LICENSE for details.

主要指標

概覽
名稱與所有者ruippeixotog/ebay-snipe-server
主編程語言Scala
編程語言Scala (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2014-08-05 23:49:14
推送於2019-04-07 19:59:39
最后一次提交2019-04-07 20:59:35
發布數3
最新版本名稱v0.2.2 (發布於 )
第一版名稱v0.1 (發布於 )
用户参与
星數134
關注者數13
派生數21
提交數104
已啟用問題?
問題數14
打開的問題數4
拉請求數0
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?