-
Notifications
You must be signed in to change notification settings - Fork 0
/
amz-down.go
executable file
·249 lines (242 loc) · 12.6 KB
/
amz-down.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
package main
import (
"fmt"
"io"
"net/http"
"os"
)
var files = []string{
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/AdditionalProductInformation.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Amazon.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/amzn-base.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/amzn-envelope.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/amzn-header.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/Arts.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/AttributeGroups.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/AutoAccessory.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/Baby.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Beauty.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/Books.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/CameraPhoto.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/CatPIL.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/CE.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/ClothingAccessories.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/Coins.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Collectibles.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Computers.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Customer.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/CustomerAddress.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/EducationSupplies.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/EntertainmentCollectibles.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/EUCompliance.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/FBA.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/FoodAndBeverages.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/FoodServiceAndJanSan.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/FulfillmentCenter.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/FulfillmentOrderCancellationRequest.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/FulfillmentOrderRequest.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Furniture.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/GiftCards.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Gourmet.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Health.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Home.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/HomeImprovement.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Image.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Industrial.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Inventory.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Item.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Jewelry.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/LabSupplies.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/LargeAppliances.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Lighting.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/LightMotor.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Listings.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/ListingSummary.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Loyalty.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/Luggage.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/LuxuryBeauty.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/MaterialHandling.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/MechanicalFasteners.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Miscellaneous.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Miscellaneous.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/Motorcycles.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/MultiChannelOrderReport.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Music.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/MusicalInstruments.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/NavigationReport.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Offer.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Office.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/OrderAcknowledgement.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/OrderAdjustment.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/OrderFulfillment.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/OrderNotificationReport.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/OrderReport.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/Outdoors.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Override.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/PaymentMethod.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/PetSupplies.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/PowerTransmission.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Price.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/ProcessingReport.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Product.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/ProductAttributes.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/ProductClothing.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/ProductImage.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/ProfessionalHealthCare.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/RawMaterials.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Relationship.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/ReverseFeed.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/SettlementReport.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/Shoes.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Sports.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/SportsMemorabilia.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Store.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/SWVG.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_7/TestOrderRequest.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/ThreeDPrinting.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/TiresAndWheels.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Tools.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Toys.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/ToysBaby.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/TypeDefinitions.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Video.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/WebstoreItem.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/WineAndAlcohol.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/Wireless.xsd",
"https://www.w3.org/TR/xmlenc-core/xenc-schema.xsd",
"https://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd",
"https://images-na.ssl-images-amazon.com/images/G/01/mwsportal/doc/en_US/Reports/XSDs/BrowseTreeReport.xsd",
}
var files_name = []string{
"AdditionalProductInformation.xsd",
"Amazon.xsd",
"amzn-base.xsd",
"amzn-envelope.xsd",
"amzn-header.xsd",
"Arts.xsd",
"AttributeGroups.xsd",
"AutoAccessory.xsd",
"Baby.xsd",
"Beauty.xsd",
"Books.xsd",
"CameraPhoto.xsd",
"CatPIL.xsd",
"CE.xsd",
"ClothingAccessories.xsd",
"Coins.xsd",
"Collectibles.xsd",
"Computers.xsd",
"Customer.xsd",
"CustomerAddress.xsd",
"EducationSupplies.xsd",
"EntertainmentCollectibles.xsd",
"EUCompliance.xsd",
"FBA.xsd",
"FoodAndBeverages.xsd",
"FoodServiceAndJanSan.xsd",
"FulfillmentCenter.xsd",
"FulfillmentOrderCancellationRequest.xsd",
"FulfillmentOrderRequest.xsd",
"Furniture.xsd",
"GiftCards.xsd",
"Gourmet.xsd",
"Health.xsd",
"Home.xsd",
"HomeImprovement.xsd",
"Image.xsd",
"Industrial.xsd",
"Inventory.xsd",
"Item.xsd",
"Jewelry.xsd",
"LabSupplies.xsd",
"LargeAppliances.xsd",
"Lighting.xsd",
"LightMotor.xsd",
"Listings.xsd",
"ListingSummary.xsd",
"Loyalty.xsd",
"Luggage.xsd",
"LuxuryBeauty.xsd",
"MaterialHandling.xsd",
"MechanicalFasteners.xsd",
"Miscellaneous.xsd",
"Miscellaneous.xsd",
"Motorcycles.xsd",
"MultiChannelOrderReport.xsd",
"Music.xsd",
"MusicalInstruments.xsd",
"NavigationReport.xsd",
"Offer.xsd",
"Office.xsd",
"OrderAcknowledgement.xsd",
"OrderAdjustment.xsd",
"OrderFulfillment.xsd",
"OrderNotificationReport.xsd",
"OrderReport.xsd",
"Outdoors.xsd",
"Override.xsd",
"PaymentMethod.xsd",
"PetSupplies.xsd",
"PowerTransmission.xsd",
"Price.xsd",
"ProcessingReport.xsd",
"Product.xsd",
"ProductAttributes.xsd",
"ProductClothing.xsd",
"ProductImage.xsd",
"ProfessionalHealthCare.xsd",
"RawMaterials.xsd",
"Relationship.xsd",
"ReverseFeed.xsd",
"SettlementReport.xsd",
"Shoes.xsd",
"Sports.xsd",
"SportsMemorabilia.xsd",
"Store.xsd",
"SWVG.xsd",
"TestOrderRequest.xsd",
"ThreeDPrinting.xsd",
"TiresAndWheels.xsd",
"Tools.xsd",
"Toys.xsd",
"ToysBaby.xsd",
"TypeDefinitions.xsd",
"Video.xsd",
"WebstoreItem.xsd",
"WineAndAlcohol.xsd",
"Wireless.xsd",
"xenc-schema.xsd",
"xmldsig-core-schema.xsd",
"BrowseTreeReport.xsd",
}
func main() {
err := os.MkdirAll("./amz-xsd", os.ModePerm)
if err != nil {
panic(err)
}
for i, url := range files {
err := DownloadFile("./amz-xsd/"+files_name[i], url)
if err != nil {
panic(err)
} else {
fmt.Println(url)
}
}
}
func DownloadFile(filepath string, url string) error {
// Get the data
resp, err := http.Get(url)
if err != nil {
return err
}
defer resp.Body.Close()
// Create the file
out, err := os.Create(filepath)
if err != nil {
return err
}
defer out.Close()
// Write the body to file
_, err = io.Copy(out, resp.Body)
return err
}