This is a simple Go package to interact with Digikala website.
go get github.com/mamal72/dgkala
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)
}
go test
Just fill an issue and describe it. I'll check it ASAP!
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. ❤️
Remember to write a few tests for your code before sending pull requests.
Licensed under the MIT License.