-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathalgolia.ts
28 lines (28 loc) · 912 Bytes
/
algolia.ts
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
export const ALGOLIA = {
threads: {
threadsBaseUrl: 'https://hn.algolia.com/api/v1/search_by_date?tags=story,author_whoishiring',
hasHiringRegex: /hiring/i,
hitsPerPageMax: 1000,
/** included in db */
oldestUsefulMonth: '2015-06',
},
comments: {
// https://hn.algolia.com/api/v1/search_by_date?tags=comment,story_42017580
threadBaseUrl: 'https://hn.algolia.com/api/v1/search_by_date?tags=comment,story_',
companyNameRegex: /^([^|]+)\|/,
removeLinkOrBracesRegex: /^(.*?)\s*(?:\([^)]*\)|https?:\/\/\S+)/,
hitsPerPageMax: 1000,
},
axios: {
// axios instance
timeout: 10 * 1000,
/**
* axios-rate-limit
*
* https://hn.algolia.com/api
* We are limiting the number of API requests from a single IP to 10,000 per hour.
* 166 per minute, 2.77 per second, each 0.36 seconds
*/
delayBetweenRequests: 3 * 1000,
},
} as const;