Spaces:
Runtime error
Runtime error
Yuanjing Zhu
commited on
Commit
·
f66e0ee
1
Parent(s):
e1db8f3
reddit keys
Browse files- Keys.py +5 -0
- app.py +9 -6
- 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
|
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=
|
15 |
-
client_secret=
|
16 |
-
usernme =
|
17 |
-
password =
|
18 |
-
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
|
13 |
-
"\t\t\t\t\tclient_secret
|
14 |
-
" usernme =
|
15 |
-
" password =
|
16 |
-
"\t\t\t\t\tuser_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": {
|