Yuanjing Zhu commited on
Commit
f66e0ee
·
1 Parent(s): e1db8f3

reddit keys

Browse files
Files changed (3) hide show
  1. Keys.py +5 -0
  2. app.py +9 -6
  3. scrape_load.ipynb +8 -6
Keys.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ reddit_keys = {'client_id' : "Q1w42RHhLq2fgwljAk_k-Q", # your client id
2
+ 'client_secret': "enUJfFthiZRynGfPQtoK1nCxRer2Dw", # your client secret
3
+ 'usernme' : "xl395", #profile username
4
+ 'password' : "12xiao34quanAria!", #profile password
5
+ 'user_agent' :"706_post"} # your user agent
app.py CHANGED
@@ -1,5 +1,5 @@
1
  '''
2
- Run 'python3 main.py' in terminal
3
  Follow local URL
4
  '''
5
 
@@ -10,12 +10,15 @@ from transformers import pipeline
10
  #from transformers import DistilBertTokenizerFast
11
  import gradio as gr
12
  import numpy as np
 
 
 
13
 
14
- reddit= praw.Reddit(client_id="Q1w42RHhLq2fgwljAk_k-Q", # your client id
15
- client_secret="enUJfFthiZRynGfPQtoK1nCxRer2Dw", # your client secret
16
- usernme = "xl395", #profile username
17
- password = "12xiao34quanAria!", #profile password
18
- user_agent="706_post") # your user agent
19
 
20
 
21
  classifier = pipeline("sentiment-analysis", model="michellejieli/NSFW_text_classifier")
 
1
  '''
2
+ Run 'python3 app.py' in terminal
3
  Follow local URL
4
  '''
5
 
 
10
  #from transformers import DistilBertTokenizerFast
11
  import gradio as gr
12
  import numpy as np
13
+ import praw
14
+ import pandas as pd
15
+ from Keys import reddit_keys
16
 
17
+ reddit= praw.Reddit(client_id=reddit_keys['client_id'], # your client id
18
+ client_secret=reddit_keys['client_secret'], # your client secret
19
+ usernme = reddit_keys['usernme'], #profile username
20
+ password = reddit_keys['password'], #profile password
21
+ user_agent=reddit_keys['user_agent']) # your user agent
22
 
23
 
24
  classifier = pipeline("sentiment-analysis", model="michellejieli/NSFW_text_classifier")
scrape_load.ipynb CHANGED
@@ -8,12 +8,14 @@
8
  "source": [
9
  "import praw\n",
10
  "import pandas as pd\n",
 
11
  "\n",
12
- "reddit= praw.Reddit(client_id=\"Q1w42RHhLq2fgwljAk_k-Q\",\t\t # your client id\n",
13
- "\t\t\t\t\tclient_secret=\"enUJfFthiZRynGfPQtoK1nCxRer2Dw\",\t # your client secret\n",
14
- " usernme = \"xl395\", #profile username\n",
15
- " password = \"12xiao34quanAria!\", #profile password\n",
16
- "\t\t\t\t\tuser_agent=\"706_post\")\t # your user agent"
 
17
  ]
18
  },
19
  {
@@ -448,7 +450,7 @@
448
  "name": "python",
449
  "nbconvert_exporter": "python",
450
  "pygments_lexer": "ipython3",
451
- "version": "3.10.4"
452
  },
453
  "orig_nbformat": 4,
454
  "vscode": {
 
8
  "source": [
9
  "import praw\n",
10
  "import pandas as pd\n",
11
+ "from Keys import reddit_keys\n",
12
  "\n",
13
+ "reddit= praw.Reddit(client_id=reddit_keys['client_id'],\t\t # your client id\n",
14
+ "\t\t\t\t\tclient_secret=reddit_keys['client_secret'],\t # your client secret\n",
15
+ " usernme = reddit_keys['usernme'], #profile username\n",
16
+ " password = reddit_keys['password'], #profile password\n",
17
+ "\t\t\t\t\tuser_agent=reddit_keys['user_agent'])\t # your user agent\n",
18
+ "\n"
19
  ]
20
  },
21
  {
 
450
  "name": "python",
451
  "nbconvert_exporter": "python",
452
  "pygments_lexer": "ipython3",
453
+ "version": "3.10.4 (main, Nov 29 2022, 20:00:25) [GCC 9.4.0]"
454
  },
455
  "orig_nbformat": 4,
456
  "vscode": {