gojib

package module
v0.0.0-...-98a0e7f Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2018 License: MIT Imports: 3 Imported by: 0

README

Build Status Go Report Card GoDoc license

gojib

A simple package to scrape and get price data from Iranjib website.

Installation

go get github.com/mamal72/gojib
# or use dep, vgo, glide or anything else

Usage

package main

import (
	"log"

	"github.com/mamal72/gojib"
)

func main() {
	iranianCarsPrices, _ := gojib.GetIranianCarsPrices() // returns []CarPrice, error
	log.Println("Iranian Cars:")
	for _, car := range iranianCarsPrices {
		log.Printf("%+v", car)
	}

	foreignCarsPrices, _ := gojib.GetForeignCarsPrices() // returns []CarPrice, error
	log.Println("Foreign Cars:")
	for _, car := range foreignCarsPrices {
		log.Printf("%+v", car)
	}
}

Ideas || Issues

Just create an issue and describe it. I'll check it ASAP!

Contribution

You can fork the repository, improve or fix some part of it and then send the pull requests back (with some tests ofc) if you want to see them here. I really appreciate that. ❤️

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CarPrice

type CarPrice struct {
	Manufacturer string
	Name         string
	BazaarPrice  int
	CompanyPrice int
}

CarPrice holds name and price of a car

func GetForeignCarsPrices

func GetForeignCarsPrices() ([]CarPrice, error)

GetForeignCarsPrices return a slice of car prices for foreign cars

func GetIranianCarsPrices

func GetIranianCarsPrices() ([]CarPrice, error)

GetIranianCarsPrices return a slice of car prices for Iranian cars

Jump to

Keyboard shortcuts

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