ebay

package module
v0.0.0-...-23262e6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2014 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-ebay

An ebay search api client in golang.

Install

You'll need to have golang installed.

$ go get github.com/heatxsink/go-ebay

Example

import (
	"github.com/heatxsink/go-ebay"
)

var (
	ebay_application_id = "your_application_id_here"
)

func main() {
	e := ebay.New(ebay_application_id)
	response, err := e.FindItemsByKeywords(ebay.GLOBAL_ID_EBAY_US, "DJM 900, DJM 850", 10)
	if err != nil {
		fmt.Println("ERROR: ", err)
		os.Exit(1)
	}
	for _, i := range response.Items {
		fmt.Println("Title: ", i.Title)
		fmt.Println("\tListing Url:     ", i.ListingUrl)
		fmt.Println("\tBin Price:       ", i.BinPrice)
		fmt.Println("\tCurrent Price:   ", i.CurrentPrice)
		fmt.Println("\tShipping Price:  ", i.ShippingPrice)
		fmt.Println()
	}
}

Documentation

Index

Constants

View Source
const (
	GLOBAL_ID_EBAY_US = "EBAY-US"
	GLOBAL_ID_EBAY_FR = "EBAY-FR"
	GLOBAL_ID_EBAY_DE = "EBAY-DE"
	GLOBAL_ID_EBAY_IT = "EBAY-IT"
	GLOBAL_ID_EBAY_ES = "EBAY-ES"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EBay

type EBay struct {
	ApplicationId string
	HttpRequest   *httprequest.HttpRequest
}

func New

func New(application_id string) *EBay

func (*EBay) FindItemsByKeywords

func (e *EBay) FindItemsByKeywords(global_id string, keywords string, entries_per_page int) (FindItemsByKeywordResponse, error)

type Error

type Error struct {
	ErrorId   string `xml:"errorId"`
	Domain    string `xml:"domain"`
	Severity  string `xml:"severity"`
	Category  string `xml:"category"`
	Message   string `xml:"message"`
	SubDomain string `xml:"subdomain"`
}

type ErrorMessage

type ErrorMessage struct {
	XmlName xml.Name `xml:"errorMessage"`
	Error   Error    `xml:"error"`
}

type FindItemsByKeywordResponse

type FindItemsByKeywordResponse struct {
	XmlName   xml.Name `xml:"findItemsByKeywordsResponse"`
	Items     []Item   `xml:"searchResult>item"`
	Timestamp string   `xml:"timestamp"`
}

func (*FindItemsByKeywordResponse) Dump

func (r *FindItemsByKeywordResponse) Dump()

type Item

type Item struct {
	ItemId        string   `xml:"itemId"`
	Title         string   `xml:"title"`
	Location      string   `xml:"location"`
	CurrentPrice  float64  `xml:"sellingStatus>currentPrice"`
	ShippingPrice float64  `xml:"shippingInfo>shippingServiceCost"`
	BinPrice      float64  `xml:"listingInfo>buyItNowPrice"`
	ShipsTo       []string `xml:"shippingInfo>shipToLocations"`
	ListingUrl    string   `xml:"viewItemURL"`
	ImageUrl      string   `xml:"galleryURL"`
	Site          string   `xml:"globalId"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址