shopify

package module
v0.0.0-...-6fc91e3 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2022 License: MIT Imports: 8 Imported by: 0

README

Shopify reviews crawler

Go Report Card

Buy Me A Coffee

Shopify reviews crawler fetches all reviews of an app from Shopify app store

Installation
$ go get -u github.com/sudoLife/shopify
Example Code
import (
	"encoding/json"
	"os"
	"github.com/sudoLife/shopify"
)

func main() {
	reviews := shopify.Parse("https://apps.shopify.com/YourApp/reviews")
	enc := json.NewEncoder(os.Stdout)
	enc.SetIndent("", " ")
	
	enc.Encode(reviews)
}
Usage

After above code has been saved as something like get-reviews.go, run the following command to scrape the data in JSON:

$ go run get-reviews.go
Third party libraries

Documentation

Index

Constants

View Source
const DateFormat = "January 2, 2006"

DateFormat represents the date format used by shopify

Variables

This section is empty.

Functions

func Parse

func Parse(url string) *[]Review

Parse parses shopify

Types

type Review

type Review struct {
	ID        primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"`
	Username  string             `json:"username,omitempty" bson:"username,omitempty"`
	Rating    int                `json:"rating,omitempty" bson:"rating,omitempty"`
	Date      int64              `json:"time,omitempty" bson:"time,omitempty"`
	Content   string             `json:"content,omitempty" bson:"content,omitempty"`
	Edited    bool               `json:"edited,omitempty" bson:"edited,omitempty"`
	Helpful   int                `json:"helpful,omitempty" bson:"helpful,omitempty"`
	Reply     string             `json:"reply,omitempty" bson:"reply,omitempty"`
	ReplyDate int64              `json:"replydate,omitempty" bson:"replydate,omitempty"`
}

Review represents the structure of a single review on apps.shopify.com; compatible with json and bson

Jump to

Keyboard shortcuts

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