-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdb.js
More file actions
135 lines (133 loc) · 3.8 KB
/
db.js
File metadata and controls
135 lines (133 loc) · 3.8 KB
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
const freedom_forum_url = id => date =>
`https://d2dr22b2lm4tvw.cloudfront.net/${id}/${date.format('YYYY-MM-DD')}/front-page.pdf` // TODO: support .png direct?
module.exports = {
// List of newspapers we support
// and a function for each that given a date returns the url of the pdf of the front page of that newspaper for that date
// The Freedom Forum has a large list of papers: https://frontpages.freedomforum.org/
// e.g. for Wall Street Journal the url is https://d2dr22b2lm4tvw.cloudfront.net/wsj/2026-03-12/front-page.pdf
//
// But, any url as a function of date works e.g. for NYT, this works too (albeit with slight adjustment of the scale param):
// url: date => `https://static01.nyt.com/images/${date.format('YYYY/MM/DD')}/nytfrontpage/scan.pdf`
//
// scale: Gets compiled to transform: scale(x) CSS style to zoom in to remove useless white margins. Use the emulator on homepage to experiment
newspapers: [
{
id: 'LATimes',
name: 'Los Angeles Times',
url: freedom_forum_url('ca_lat'),
scale: 1.02,
},
{
id: 'WaPo',
name: 'Washington Post',
url: freedom_forum_url('dc_wp'),
scale: 1.08,
},
{
id: 'NYT',
name: 'New York Times',
isSelected: true, // isSelected: True (for either newspaper or device) means we show it as default on the server homepage
url: freedom_forum_url('ny_nyt'),
scale: 1.04,
},
{
id: 'WSJ',
name: 'Wall Street Journal',
url: freedom_forum_url('wsj'),
scale: 1.04,
}
],
// Each device has the following attributes:
// id: This is the joan device id e.g. from this url https://portal.getjoan.com/manage/devices/2a002800-0c47-3133-3633-333400000000
// timezone: Your local timezone to display correct local time and make sure we don't display newspapers from "tomorrow"
// showFahrenheit: Which temperature scale to use for the device temperature display in the page footer.
// newspapers: A list of newspapers (from the section above) that will display on your device - in the format:
// id: The id of the newspaper (from the section above).
// displayFor: Configure this (in minutes) to display this paper before moving onto the next one.
devices: [
{
id: '32001d00-0f47-3830-3933-303600000000',
name: "Rick's Newswall",
timezone: 'America/New_York',
showFahrenheit: true,
newspapers: [
{
id: 'NYT',
displayFor: 60
},
{
id: 'WSJ',
displayFor: 30
},
{
id: 'WaPo',
displayFor: 15
}
]
},
{
id: '35003600-1247-3830-3933-303600000000',
name: "Tapas's Newswall",
timezone: 'America/New_York',
showFahrenheit: false,
newspapers: [
{
id: 'NYT',
displayFor: 60
},
{
id: 'WSJ',
displayFor: 30
},
{
id: 'WaPo',
displayFor: 15
},
]
},
{
id: '2a002800-0c47-3133-3633-333400000000',
name: "Alex's Newswall",
timezone: 'America/New_York',
showFahrenheit: false,
newspapers: [
{
id: 'NYT',
displayFor: 60
},
{
id: 'WSJ',
displayFor: 45
},
{
id: 'WaPo',
displayFor: 15
}
]
},
{
id: '45004e00-1950-3151-4133-362000000000',
name: "Linh's Newswall",
timezone: 'America/New_York',
showFahrenheit: false,
newspapers: [
{
id: 'NYT',
displayFor: 60
},
{
id: 'WSJ',
displayFor: 45
},
{
id: 'LATimes',
displayFor: 30
},
{
id: 'WaPo',
displayFor: 15
}
]
}
]
}