-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApi.swift
58 lines (50 loc) · 933 Bytes
/
Api.swift
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
//
// Api.swift
// Reader for NYT
//
// Created by Mikhail Bolshakov on 10/7/17.
// Copyright © 2017 Dolphin and Mermaids. All rights reserved.
//
import Foundation
import Siesta
class Api : Service {
static let shared = Api()
static let keyName = "api-key"
static let key = "YOUR_API_CODE_FROM_NYT"
static let categories = [
"home",
"opinion",
"world",
"national",
"politics",
"upshot",
"nyregion",
"business",
"technology",
"science",
"health",
"sports",
"arts",
"books",
"movies",
"theater",
"sundayreview",
"fashion",
"tmagazine",
"food",
"travel",
"magazine",
"realestate",
"automobiles",
"obituaries",
"insider"
]
init() {
super.init(baseURL: "https://api.nytimes.com/svc")
}
static let dateFormatter: DateFormatter = {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ"
return dateFormatter
}()
}