Awesome
dgkala
This is a simple Go package to interact with Digikala website.
Installation
go get github.com/mamal72/dgkala
Usage
package main
import (
"fmt"
"github.com/mamal72/dgkala"
)
func main() {
// Get incredible offers
offers, err := dgkala.IncredibleOffers() // []IncredibleOffer, error
fmt.Printf("%+v\n", offers)
// Search for a product by a string keyword
searchResult, err := dgkala.Search("case-logic-dlbp") // SearchResult, error
fmt.Printf("%+v\n", searchResult)
// Get details of a product by ID
productByID, err := dgkala.GetProductByID(6071) // ProductByID, error
fmt.Printf("%+v\n", productByID)
}
Tests
go test
Ideas || Issues
Just fill 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 if you want to see them here. I really appreciate that. :heart:
Remember to write a few tests for your code before sending pull requests.
License
Licensed under the MIT License.