forked from ms609/citation-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
env.php.example
41 lines (41 loc) · 2.36 KB
/
env.php.example
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
<?php
if (get_included_files()[0] === __FILE__) {
exit; // Only need this code if web-server does not block this file
}
/** Suppress all errors to avoid accidently printing something of value */
if (!getenv('PHP_OAUTH_CONSUMER_TOKEN')) {
try {
// Bot OAuth authentication - this so that the bot can login and do things such as edit pages as itself.
// These are needed even when running on the command line
// https://www.mediawiki.org/wiki/OAuth/Owner-only_consumers#OAuth_1
// OAuth 1 is what we use. That is why there are four variables.
@putenv('PHP_OAUTH_CONSUMER_TOKEN=xxxxx');
@putenv('PHP_OAUTH_CONSUMER_SECRET=xxxxx');
@putenv('PHP_OAUTH_ACCESS_TOKEN=xxxxx');
@putenv('PHP_OAUTH_ACCESS_SECRET=xxxxx');
// OAuth authentication as Wikipedia user - these are so that the bot can verify that a user has authorized an "Access Grant".
// This can also can be used to actually edit using the users account.
// https://www.mediawiki.org/wiki/OAuth/For_Developers (use OAuth version 1)
// These are not needed when running on the command line
@putenv('PHP_WP_OAUTH_CONSUMER=xxxxx');
@putenv('PHP_WP_OAUTH_SECRET=xxxxx');
// AdsAbs key - https://ui.adsabs.harvard.edu/help/api/
@putenv('PHP_ADSABSAPIKEY=xxxxx');
// Change this line if you wish the bot, when limit of AdsAbs API calls reached, to sleep until the limit resets;
// in this case the value of PHP_ADSABSAPILIMITACTION, i.e. the limit action should be "sleep" (without quotes);
// available actions are: sleep, exit, ignore. ignore is the default if not set.
@putenv('PHP_ADSABSAPILIMITACTION=ignore');
// Doing lots of requests to semanticscholar.org without a key gets you blocked
@putenv('PHP_S2APIKEY=xxxxx');
// API key and email address for *nlm.nih.gov, can be obtained at https://account.ncbi.nlm.nih.gov/settings/
@putenv('NLM_APIKEY=xxxxx');
@putenv('NLM_EMAIL=xxxxx');
// This is for doing git pull. Not needed for bot itself
@putenv('GITHUB_PAT=xxxxx');
// This is for doing authenticated queries to Google Books API - this API is not very good and still rate limited, so not used anymore
@putenv('PHP_GOOGLEKEY=xxxxx');
} catch (Throwable $e) {
echo 'Error in env.php';
}
}
?>