package scoresaber

import (
	"fmt"

	"git.lxtend.com/qqbot/util"
)

func GetSSPicture(qqId string) (outputImgName string) {
	ssId, err := getSSID(qqId)
	if err != nil {
		return ""
	}
	url := fmt.Sprintf("https://scoresaber.com/u/%s", ssId)
	// url := fmt.Sprintf("https://scoresaber.com/rankings")
	outputImgPath := fmt.Sprintf("./tmp/scoresaber_%s.png", ssId)
	outputImgName = fmt.Sprintf("scoresaber_%s.png", ssId)
	if err := util.ScreenshotURL(url, outputImgPath, 1620, 3080, 60, 0, 300, 300, "ranking songs"); err != nil {
		fmt.Println(err)
		return ""
	}

	return outputImgName
}
