File size: 2,920 Bytes
bf4f857
b70f413
bf4f857
 
 
 
34a4a57
 
 
bf4f857
 
 
 
 
 
 
 
 
 
 
34a4a57
 
 
 
 
 
 
 
bf4f857
 
 
 
 
 
 
34a4a57
d1fa8b0
 
 
 
 
 
b70f413
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34a4a57
 
 
e1ce9ca
d1fa8b0
 
 
 
 
 
 
 
 
 
e56eed8
 
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
import os
import asyncpraw
from dotenv import load_dotenv

load_dotenv()

# load the ENVIRONMENT
environment = os.getenv('ENVIRONMENT')

# Gemini Api keys
api_key = os.getenv('GEMINI_1')
api_key2 = os.getenv('GEMINI_2')
api_key3 = os.getenv('GEMINI_3')
api_key4 = os.getenv('GEMINI_4')
api_key5 = os.getenv('GEMINI_5')
api_key6 = os.getenv('GEMINI_6')
api_key7 = os.getenv('GEMINI_7')
api_key8 = os.getenv('GEMINI_8')
api_key9 = os.getenv('GEMINI_9')
api_key10 = os.getenv('GEMINI_10')
api_key11 = os.getenv('GEMINI_11')

# gemini spare api keys
spare_api_key1 = os.getenv('GEMINI_SPARE_KEY_1')
spare_api_key2 = os.getenv('GEMINI_SPARE_KEY_2')
spare_api_key3 = os.getenv('GEMINI_SPARE_KEY_3')
spare_api_key4 = os.getenv('GEMINI_SPARE_KEY_4')
spare_api_key5 = os.getenv('GEMINI_SPARE_KEY_5')

# Reddit credentials
reddit_client_id = os.getenv('REDDIT_CLIENT_ID')
reddit_client_secret = os.getenv('REDDIT_CLIENT_SECRET')
reddit_user_agent = os.getenv('REDDIT_USER_AGENT')
reddit_password = os.getenv('REDDIT_PASSWORD')
reddit_username = os.getenv('REDDIT_USERNAME')

reddit_client_id_2 = os.getenv('REDDIT_CLIENT_ID_2')
reddit_client_secret_2 = os.getenv('REDDIT_CLIENT_SECRET_2')
reddit_user_agent_2 = os.getenv('REDDIT_USER_AGENT_2')
reddit_password_2 = os.getenv('REDDIT_PASSWORD_2')
reddit_username_2 = os.getenv('REDDIT_USERNAME_2')

reddit_client_id_3 = os.getenv('REDDIT_CLIENT_ID_3')
reddit_client_secret_3 = os.getenv('REDDIT_CLIENT_SECRET_3')
reddit_user_agent_3 = os.getenv('REDDIT_USER_AGENT_3')
reddit_password_3 = os.getenv('REDDIT_PASSWORD_3')
reddit_username_3 = os.getenv('REDDIT_USERNAME_3')

reddit_clients = [
    asyncpraw.Reddit(
            client_id=reddit_client_id,
            client_secret=reddit_client_secret,
            password=reddit_password,
            username=reddit_username,
            user_agent=reddit_user_agent,
        ),
        asyncpraw.Reddit(
            client_id=reddit_client_id_2,
            client_secret=reddit_client_secret_2,
            password=reddit_password_2,
            username=reddit_username_2,
            user_agent=reddit_user_agent_2,
        ),
        asyncpraw.Reddit(
            client_id=reddit_client_id_3,
            client_secret=reddit_client_secret_3,
            password=reddit_password_3,
            username=reddit_username_3,
            user_agent=reddit_user_agent_3,
        )
]

# ScraperANT
scraper_ant_api_key = os.getenv('SCRAPERANT_APIKEY')
scraper_ant_api_key2 = os.getenv('SCRAPERANT_APIKEY2')
scraper_ant_api_key3 = os.getenv('SCRAPERANT_APIKEY3')
scraper_ant_api_key4= os.getenv('SCRAPERANT_APIKEY4')
scraper_ant_keys=[
    scraper_ant_api_key,
    scraper_ant_api_key2,
    scraper_ant_api_key3,
    scraper_ant_api_key4
]

# load the BUGSNAG_TOKEN
bugsnag_token = os.getenv('BUGSNAG_TOKEN')

scraping_url = 'https://nextanalyticsscraping.onrender.com' if environment == 'DEVELOPMENT' else os.getenv('SCRAPING_URL')