Categorygithub.com/sosedoff/go-craigslist
modulepackage
0.0.0-20200522142400-ab823b88321b
Repository: https://github.com/sosedoff/go-craigslist.git
Documentation: pkg.go.dev

# README

go-craigslist

Build Status GoDoc

Craigslist.org wrapper for Go

Install

go get -u github.com/sosedoff/go-craigslist

Usage

package main

import (
  "log"

  "github.com/sosedoff/go-craigslist"
)

func main() {
  opts := craigslist.SearchOptions{
    Category: "cto", // cars+trucks
    Query:    "honda",
    HasImage: true,
    MinPrice: 10000,
    MaxPrice: 20000,
  }

  // Perform a search
  result, err := craigslist.Search("chicago", opts)
  if err != nil {
    log.Fatal(err)
  }

  for _, listing := range result.Listings {
    log.Println(listing.JSON())
  }

  // Fetch listing details
  listing, err := craigslist.GetListing(result.Listings[0].URL)
  if err != nil {
    log.Fatal(err)
  }

  log.Println(listing)
}

Test

make test

License

MIT

# Packages

No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ParseSites extracts all sites from the reader.
No description provided by the author
Sites returns all US-based sites.
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author