Added href parsing

This commit is contained in:
Artyom Belousov 2019-05-11 19:00:58 +03:00
parent 738142f27f
commit c0f781fc7a
6 changed files with 78 additions and 7 deletions

15
cardsinfo/format.go Normal file
View file

@ -0,0 +1,15 @@
package cardsinfo
import (
"fmt"
)
func FormatCardPrices(name string, prices []CardPrice) string {
message := fmt.Sprintf("Оригинальное название: %v\n", name)
message += fmt.Sprintf("Результатов: %v\n", len(prices))
for i, v := range prices {
message += fmt.Sprintf("%v. %v: $%v\n", i+1, v.Edition, v.Price)
message += fmt.Sprintf("%v\n", v.Link)
}
return message
}