/
env.php.example
35 lines (32 loc) · 1.82 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
<?php
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');
// API keys
@putenv('PHP_ADSABSAPIKEY=xxxxx'); // https://ui.adsabs.harvard.edu/help/api/
// Uncomment 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.
// @putenv('PHP_ADSABSAPILIMITACTION=sleep');
@putenv('PHP_S2APIKEY=xxxxx'); // Doing lots of requests to semanticscholar.org without a key gets you blocked
@putenv('NLM_APIKEY=xxxxx'); // API key for *nlm.nih.gov, can be obtained at https://account.ncbi.nlm.nih.gov/settings/
@putenv('NLM_EMAIL=xxxxx'); // Email address for *nlm.nih.gov
@putenv('GITHUB_PAT=xxxxx'); // This is for doing gitpull, etc. But not running bot
}
catch (Throwable $e) {
echo 'Error in env.php';
}
}