EricR401S commited on
Commit
92c8b6a
1 Parent(s): a456cb4

adding files

Browse files
Files changed (5) hide show
  1. README.md +187 -0
  2. oldREADME.md +278 -0
  3. reddit_posts_fm.csv +0 -0
  4. reddit_scraping_nb.ipynb +0 -0
  5. redditscraper.py +89 -0
README.md CHANGED
@@ -1,3 +1,190 @@
1
  ---
2
  license: cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: cc
3
+ language:
4
+ - en # Example: fr
5
+ tags:
6
+ - natural-language-understanding # Example: audio
7
+ - ideology classification #
8
+ - text classification #
9
+ annotations_creators:
10
+ - crowdsourced # Example: crowdsourced, found, expert-generated, machine-generated
11
+ language_creators:
12
+ - crowdsourced # Example: crowdsourced, ...
13
+ # language_details:
14
+ # - en-US # Example: fr-FR
15
+ pretty_name: PiLls # Example: SQuAD
16
+ size_categories:
17
+ - n<2K # Example: n<1K, 100K<n<1M, …
18
+ source_datasets:
19
+ - reddit # Example: wikipedia
20
+ task_categories: # Full list at https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/pipelines.ts
21
+ - text-classification # Example: question-answering
22
+ task_ids:
23
+ - multi-class-classification # Example: extractive-qa
24
  ---
25
+ ---
26
+
27
+ # Dataset Card for Dataset Name
28
+
29
+ <!-- Provide a quick summary of the dataset. -->
30
+
31
+ This dataset aims to be a tool to help trace linguistic patterns in the reddit posts from members who partake in the internet centric pill ideologies, known as blackpill, red pill, blue pill.
32
+ ## Dataset Details
33
+
34
+ ### Dataset Description
35
+
36
+ A few of the major groups' posts have been coalesced into one dataset, all from different years. There are more than 200 posts per the major pill groups on reddit (red pill rebooted, blue pill, black pill, married red pill, red pill women, and feminism as a counterpoint of reference). The group of feminism was added as a juxtaposition against red pill women, in oder to allow researchers to explore those dichotomies. For researchers, the value will be in identifying or classifying the types of words that make one ideology more prominent than the other.
37
+
38
+ - **Curated by:** [steamcyclone]
39
+ - **Funded by [optional]:** [More Information Needed]
40
+ - **Shared by [optional]:** [steamcyclone]
41
+ - **Language(s) (NLP):** [EN]
42
+ - **License:** [CC]
43
+
44
+ ### Dataset Sources [optional]
45
+
46
+ <!-- Provide the basic links for the dataset. -->
47
+
48
+ - **Repository:** [This is the only source]
49
+
50
+ ## Uses
51
+
52
+ The main usage of this dataset is to study linguistic patterns. Running models and detecting word usage per groups, as well as overlaps across groups is an ideal use for this dataset. With the rise of the loneliness epidemic, any insights that come from this are welcome.
53
+
54
+ ### Direct Use
55
+
56
+ The suitable use cases are to multi-class classification, word clustering or semantic clustering per different groups, summarization modeling, text parsing, and any other natural language processing task.
57
+
58
+ [More Information Needed]
59
+
60
+ ### Out-of-Scope Use
61
+
62
+ This dataset is not meant to be utilized to demonize or mock certain online communities for the trials in life in which individuals find themselves. If the viewer's agenda is to push forward some misandrist or misogynistic agenda, please ignore this dataset.
63
+
64
+
65
+ [More Information Needed]
66
+
67
+ ## Dataset Structure
68
+
69
+ <!-- This section provides a description of the dataset fields, and additional information about the dataset structure such as criteria used to create the splits, relationships between data points, etc. -->
70
+
71
+ Currently, this dataset contains
72
+
73
+ - subreddit of the post : string,
74
+ - postid : string
75
+ - title of the post: string
76
+ - text of the post (where applicable) : string
77
+ - url (if something was embedded) : string\
78
+ - score : int32
79
+ - author : string
80
+ - date : int64
81
+
82
+ [More Information Needed]
83
+
84
+ ## Dataset Creation
85
+
86
+ ### Curation Rationale
87
+
88
+ With the rise of the loneliness epidemic and the radicalization of internet content pitting men and women against each other, it is important to seek understanding of the root of the problem. Depending on whom you ask, you'll get a plethora of answers. Jordan Peterson describes it as some type of post-modernist feminist liberalism problem. The Andrew Tates and other conservative archetypes blame the loss of traditionalism. Others blame dating apps and its selection bias effects. Within each of the major pill ideologies, with the exception of the BlackPill, men blame women, and women blame men.
89
+
90
+ Unfortunately, male spaces, as substantiated by research and media coverage, in recent years have only been able to exist on the internet, and counter-spaces have emerged to challenge the views held in the differing ideologies.
91
+
92
+ In short, according to archetypical definitions
93
+ - the red pill is the emancipation of the masculinity in a feminized age and understanding mating strategies with women.
94
+ - the blue pill is the satire of the red pill, often run by women.
95
+ - the black pill is meant to bridge the gaps across the red, pink, and blue pills in order to land on a ground truth.
96
+ - the pink pill is about improving the female image by augmenting sexual marketplace value.
97
+
98
+ [More Information Needed]
99
+
100
+ ### Source Data
101
+
102
+ Each record contains a reddit post, approximately 200 per group, and has a key title and a post with words to display the intended message by the author.
103
+
104
+ #### Data Collection and Processing
105
+
106
+ <!-- This section describes the data collection and processing process such as data selection criteria, filtering and normalization methods, tools and libraries used, etc. -->
107
+
108
+ In progress.
109
+
110
+ However, the plan is to increase the amount of records and leverage the ChatGpt API to summarize the messages into categories. In addition, the dates have to be cleaned a little, in order to add use for researches. I am also not sure if I can retrieve comments per post, further augmenting the data.
111
+
112
+ [More Information Needed]
113
+
114
+ #### Who are the source data producers?
115
+
116
+ The producers of the data are the various redditors who have participated in these spaces.
117
+
118
+ [More Information Needed]
119
+
120
+ ### Annotations [optional]
121
+
122
+ An annotation that is not part of the collection will be the ChatGPT summarizations (future). The subreddit labels are merely the origins of the posts.
123
+
124
+ #### Annotation process
125
+
126
+ <!-- This section describes the annotation process such as annotation tools used in the process, the amount of data annotated, annotation guidelines provided to the annotators, interannotator statistics, annotation validation, etc. -->
127
+
128
+ The origin of the posts are the labels of the records.
129
+
130
+
131
+ #### Who are the annotators?
132
+
133
+ I and the subreddit origin are the label annotators.
134
+
135
+
136
+ #### Personal and Sensitive Information
137
+
138
+ <!-- State whether the dataset contains data that might be considered personal, sensitive, or private (e.g., data that reveals addresses, uniquely identifiable names or aliases, racial or ethnic origins, sexual orientations, religious beliefs, political opinions, financial or health data, etc.). If efforts were made to anonymize the data, describe the anonymization process. -->
139
+
140
+ This dataset contains no personally identifiable information with the exception of embedded youtube links. Those links may lead to videos where the impact of the content is unknown.
141
+
142
+ ## Bias, Risks, and Limitations
143
+
144
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
145
+
146
+ A major caveat is that the pink pill and original red pill groups are shadow banned, impeding their scraping process. This is a flaw I recognize because the original red pill movement, which started in books by authors, propagated itself through its internet (reddit) variant, and it spawned all the other pills.
147
+
148
+ Another bias point is that there is more red pill content, as a means to compensate for the ban of the original red pill subreddit.
149
+
150
+ As such, I caution researchers to balance their datasets where necessary.
151
+
152
+
153
+ [More Information Needed]
154
+
155
+ ### Recommendations
156
+
157
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
158
+
159
+ Users should be made aware of the risks, biases and limitations of the dataset. Remember that this dataset is not a tool for reckless and hateful political agendas.
160
+
161
+ ## Citation [optional]
162
+
163
+ <!-- If there is a paper or blog post introducing the dataset, the APA and Bibtex information for that should go in this section. -->
164
+
165
+ **BibTeX:**
166
+
167
+ [More Information Needed]
168
+
169
+ **APA:**
170
+
171
+ [More Information Needed]
172
+
173
+ ## Glossary [optional]
174
+
175
+ Pill ideologies :
176
+
177
+ In short, according to archetypical definitions
178
+ - the red pill is the emancipation of the masculinity in a feminized age and understanding mating strategies with women.
179
+ - the blue pill is the satire of the red pill, often run by women.
180
+ - the black pill is meant to bridge the gaps across the red, pink, and blue pills in order to land on a ground truth.
181
+ - the pink pill is about improving the female image by augmenting sexual marketplace value.
182
+
183
+
184
+ ## Dataset Card Authors [optional]
185
+
186
+ steamcyclone, all the redditors from the subreddits in the authors columns.
187
+
188
+ ## Dataset Card Contact
189
+
190
+ - N/A
oldREADME.md ADDED
@@ -0,0 +1,278 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc
3
+ language:
4
+ - en # Example: fr
5
+ tags:
6
+ - natural-language-understanding # Example: audio
7
+ - ideology classification #
8
+ - text classification #
9
+ annotations_creators:
10
+ - crowdsourced # Example: crowdsourced, found, expert-generated, machine-generated
11
+ language_creators:
12
+ - crowdsourced # Example: crowdsourced, ...
13
+ # language_details:
14
+ # - en-US # Example: fr-FR
15
+ pretty_name: PiLls # Example: SQuAD
16
+ size_categories:
17
+ - n<2K # Example: n<1K, 100K<n<1M, …
18
+ source_datasets:
19
+ - reddit # Example: wikipedia
20
+ task_categories: # Full list at https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/pipelines.ts
21
+ - text-classification # Example: question-answering
22
+ task_ids:
23
+ - multi-class-classification # Example: extractive-qa
24
+ #paperswithcode_id: {paperswithcode_id} # Dataset id on PapersWithCode (from the URL). Example for SQuAD: squad
25
+ # configs: # Optional for datasets with multiple configurations like glue.
26
+ # - {config_0} # Example for glue: sst2
27
+ # - {config_1} # Example for glue: cola
28
+
29
+ # Optional. This part can be used to store the feature types and size of the dataset to be used in python. This can be automatically generated using the datasets-cli.
30
+ dataset_info:
31
+ features:
32
+ - name: subreddit # Example: id
33
+ dtype: string # Example: int32
34
+ - name: post_id # Example: text
35
+ dtype: string # Example: string
36
+ - name: title # Example: image
37
+ dtype: string # Example: image
38
+ - name : text
39
+ dtype: string
40
+ - name : url
41
+ dtype: string
42
+ - name : score
43
+ dtype: int32
44
+ - name : text
45
+ dtype: string
46
+ - name : url
47
+ dtype: string
48
+ - name : author
49
+ dtype: string
50
+ - name : date
51
+ dtype: int64
52
+ # Example for SQuAD:
53
+ # - name: id
54
+ # dtype: string
55
+ # - name: title
56
+ # dtype: string
57
+ # - name: context
58
+ # dtype: string
59
+ # - name: question
60
+ # dtype: string
61
+ # - name: answers
62
+ # sequence:
63
+ # - name: text
64
+ # dtype: string
65
+ # - name: answer_start
66
+ # dtype: int32
67
+ # config_name: {config_name} # Example for glue: sst2
68
+ # splits:
69
+ # - name: {split_name_0} # Example: train
70
+ # num_bytes: {split_num_bytes_0} # Example for SQuAD: 79317110
71
+ # num_examples: {split_num_examples_0} # Example for SQuAD: 87599
72
+ # download_size: {dataset_download_size} # Example for SQuAD: 35142551
73
+ # dataset_size: {dataset_size} # Example for SQuAD: 89789763
74
+
75
+ # It can also be a list of multiple configurations:
76
+ # ```yaml
77
+ # dataset_info:
78
+ # - config_name: {config0}
79
+ # features:
80
+ # ...
81
+ # - config_name: {config1}
82
+ # features:
83
+ # ...
84
+ # ```
85
+
86
+ # # Optional. If you want your dataset to be protected behind a gate that users have to accept to access the dataset. More info at https://huggingface.co/docs/hub/datasets-gated
87
+ # extra_gated_fields:
88
+ # - {field_name_0}: {field_type_0} # Example: Name: text
89
+ # - {field_name_1}: {field_type_1} # Example: Affiliation: text
90
+ # - {field_name_2}: {field_type_2} # Example: Email: text
91
+ # - {field_name_3}: {field_type_3} # Example for speech datasets: I agree to not attempt to determine the identity of speakers in this dataset: checkbox
92
+ # extra_gated_prompt: {extra_gated_prompt} # Example for speech datasets: By clicking on “Access repository” below, you also agree to not attempt to determine the identity of speakers in the dataset.
93
+
94
+ # # Optional. Add this if you want to encode a train and evaluation info in a structured way for AutoTrain or Evaluation on the Hub
95
+ # train-eval-index:
96
+ # - config: {config_name} # The dataset config name to use. Example for datasets without configs: default. Example for glue: sst2
97
+ # task: {task_name} # The task category name (same as task_category). Example: question-answering
98
+ # task_id: {task_type} # The AutoTrain task id. Example: extractive_question_answering
99
+ # splits:
100
+ # train_split: train # The split to use for training. Example: train
101
+ # eval_split: validation # The split to use for evaluation. Example: test
102
+ # col_mapping: # The columns mapping needed to configure the task_id.
103
+ # # Example for extractive_question_answering:
104
+ # # question: question
105
+ # # context: context
106
+ # # answers:
107
+ # # text: text
108
+ # # answer_start: answer_start
109
+ # metrics:
110
+ # - type: {metric_type} # The metric id. Example: wer. Use metric id from https://hf.co/metrics
111
+ # name: {metric_name} # Tne metric name to be displayed. Example: Test WER
112
+ ---
113
+ ---
114
+
115
+ # Dataset Card for Dataset Name
116
+
117
+ <!-- Provide a quick summary of the dataset. -->
118
+
119
+ This dataset aims to be a tool to help trace linguistic patterns in the reddit posts from members who partake in the internet centric pill ideologies, known as blackpill, red pill, blue pill.
120
+ ## Dataset Details
121
+
122
+ ### Dataset Description
123
+
124
+ A few of the major groups' posts have been coalesced into one dataset, all from different years. There are more than 200 posts per the major pill groups on reddit (red pill rebooted, blue pill, black pill, married red pill, red pill women, and feminism as a counterpoint of reference). The group of feminism was added as a juxtaposition against red pill women, in oder to allow researchers to explore those dichotomies. For researchers, the value will be in identifying or classifying the types of words that make one ideology more prominent than the other.
125
+
126
+ - **Curated by:** [steamcyclone]
127
+ - **Funded by [optional]:** [More Information Needed]
128
+ - **Shared by [optional]:** [steamcyclone]
129
+ - **Language(s) (NLP):** [EN]
130
+ - **License:** [CC]
131
+
132
+ ### Dataset Sources [optional]
133
+
134
+ <!-- Provide the basic links for the dataset. -->
135
+
136
+ - **Repository:** [This is the only source]
137
+
138
+ ## Uses
139
+
140
+ The main usage of this dataset is to study linguistic patterns. Running models and detecting word usage per groups, as well as overlaps across groups is an ideal use for this dataset. With the rise of the loneliness epidemic, any insights that come from this are welcome.
141
+
142
+ ### Direct Use
143
+
144
+ The suitable use cases are to multi-class classification, word clustering or semantic clustering per different groups, summarization modeling, text parsing, and any other natural language processing task.
145
+
146
+ [More Information Needed]
147
+
148
+ ### Out-of-Scope Use
149
+
150
+ This dataset is not meant to be utilized to demonize or mock certain online communities for the trials in life in which individuals find themselves. If the viewer's agenda is to push forward some misandrist or misogynistic agenda, please ignore this dataset.
151
+
152
+
153
+ [More Information Needed]
154
+
155
+ ## Dataset Structure
156
+
157
+ <!-- This section provides a description of the dataset fields, and additional information about the dataset structure such as criteria used to create the splits, relationships between data points, etc. -->
158
+
159
+ Currently, this dataset contains
160
+
161
+ - subreddit of the post : string,
162
+ - postid : string
163
+ - title of the post: string
164
+ - text of the post (where applicable) : string
165
+ - url (if something was embedded) : string\
166
+ - score : int32
167
+ - author : string
168
+ - date : int64
169
+
170
+ [More Information Needed]
171
+
172
+ ## Dataset Creation
173
+
174
+ ### Curation Rationale
175
+
176
+ With the rise of the loneliness epidemic and the radicalization of internet content pitting men and women against each other, it is important to seek understanding of the root of the problem. Depending on whom you ask, you'll get a plethora of answers. Jordan Peterson describes it as some type of post-modernist feminist liberalism problem. The Andrew Tates and other conservative archetypes blame the loss of traditionalism. Others blame dating apps and its selection bias effects. Within each of the major pill ideologies, with the exception of the BlackPill, men blame women, and women blame men.
177
+
178
+ Unfortunately, male spaces, as substantiated by research and media coverage, in recent years have only been able to exist on the internet, and counter-spaces have emerged to challenge the views held in the differing ideologies.
179
+
180
+ In short, according to archetypical definitions
181
+ - the red pill is the emancipation of the masculinity in a feminized age and understanding mating strategies with women.
182
+ - the blue pill is the satire of the red pill, often run by women.
183
+ - the black pill is meant to bridge the gaps across the red, pink, and blue pills in order to land on a ground truth.
184
+ - the pink pill is about improving the female image by augmenting sexual marketplace value.
185
+
186
+ [More Information Needed]
187
+
188
+ ### Source Data
189
+
190
+ Each record contains a reddit post, approximately 200 per group, and has a key title and a post with words to display the intended message by the author.
191
+
192
+ #### Data Collection and Processing
193
+
194
+ <!-- This section describes the data collection and processing process such as data selection criteria, filtering and normalization methods, tools and libraries used, etc. -->
195
+
196
+ In progress.
197
+
198
+ However, the plan is to increase the amount of records and leverage the ChatGpt API to summarize the messages into categories. In addition, the dates have to be cleaned a little, in order to add use for researches. I am also not sure if I can retrieve comments per post, further augmenting the data.
199
+
200
+ [More Information Needed]
201
+
202
+ #### Who are the source data producers?
203
+
204
+ The producers of the data are the various redditors who have participated in these spaces.
205
+
206
+ [More Information Needed]
207
+
208
+ ### Annotations [optional]
209
+
210
+ An annotation that is not part of the collection will be the ChatGPT summarizations (future). The subreddit labels are merely the origins of the posts.
211
+
212
+ #### Annotation process
213
+
214
+ <!-- This section describes the annotation process such as annotation tools used in the process, the amount of data annotated, annotation guidelines provided to the annotators, interannotator statistics, annotation validation, etc. -->
215
+
216
+ The origin of the posts are the labels of the records.
217
+
218
+
219
+ #### Who are the annotators?
220
+
221
+ I and the subreddit origin are the label annotators.
222
+
223
+
224
+ #### Personal and Sensitive Information
225
+
226
+ <!-- State whether the dataset contains data that might be considered personal, sensitive, or private (e.g., data that reveals addresses, uniquely identifiable names or aliases, racial or ethnic origins, sexual orientations, religious beliefs, political opinions, financial or health data, etc.). If efforts were made to anonymize the data, describe the anonymization process. -->
227
+
228
+ This dataset contains no personally identifiable information with the exception of embedded youtube links. Those links may lead to videos where the impact of the content is unknown.
229
+
230
+ ## Bias, Risks, and Limitations
231
+
232
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
233
+
234
+ A major caveat is that the pink pill and original red pill groups are shadow banned, impeding their scraping process. This is a flaw I recognize because the original red pill movement, which started in books by authors, propagated itself through its internet (reddit) variant, and it spawned all the other pills.
235
+
236
+ Another bias point is that there is more red pill content, as a means to compensate for the ban of the original red pill subreddit.
237
+
238
+ As such, I caution researchers to balance their datasets where necessary.
239
+
240
+
241
+ [More Information Needed]
242
+
243
+ ### Recommendations
244
+
245
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
246
+
247
+ Users should be made aware of the risks, biases and limitations of the dataset. Remember that this dataset is not a tool for reckless and hateful political agendas.
248
+
249
+ ## Citation [optional]
250
+
251
+ <!-- If there is a paper or blog post introducing the dataset, the APA and Bibtex information for that should go in this section. -->
252
+
253
+ **BibTeX:**
254
+
255
+ [More Information Needed]
256
+
257
+ **APA:**
258
+
259
+ [More Information Needed]
260
+
261
+ ## Glossary [optional]
262
+
263
+ Pill ideologies :
264
+
265
+ In short, according to archetypical definitions
266
+ - the red pill is the emancipation of the masculinity in a feminized age and understanding mating strategies with women.
267
+ - the blue pill is the satire of the red pill, often run by women.
268
+ - the black pill is meant to bridge the gaps across the red, pink, and blue pills in order to land on a ground truth.
269
+ - the pink pill is about improving the female image by augmenting sexual marketplace value.
270
+
271
+
272
+ ## Dataset Card Authors [optional]
273
+
274
+ steamcyclone, all the redditors from the subreddits in the authors columns.
275
+
276
+ ## Dataset Card Contact
277
+
278
+ - N/A
reddit_posts_fm.csv ADDED
The diff for this file is too large to render. See raw diff
 
reddit_scraping_nb.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
redditscraper.py ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+ import time
3
+ import random
4
+
5
+ """This script is used to get many posts from the desired subreddit(s)"""
6
+
7
+ subreddit_list = [
8
+ "theredpillrebooted",
9
+ "RedPillWomen",
10
+ "Feminism",
11
+ "marriedredpill",
12
+ "TheBluePill",
13
+ "PurplePillDebate",
14
+ "RedPillWives",
15
+ ]
16
+ # url = f'https://www.reddit.com/r/{subreddit}/.json?t=all&limit=100'
17
+ url_template = "https://www.reddit.com/r/{}/.json?t=all{}"
18
+
19
+ # headers = {
20
+ # 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'
21
+ # }
22
+
23
+ headers = {"User-Agent": "Testing Bot Gundam Wing"}
24
+
25
+ # response = requests.get(url, headers=headers)
26
+
27
+ params = ""
28
+
29
+ original_counter = 100
30
+ counter = original_counter
31
+ post_list = []
32
+
33
+ for subreddit in subreddit_list:
34
+ while counter > 0:
35
+ print(f"Getting posts with params: {params}")
36
+ print("\n\n\n\n")
37
+ url = url_template.format(subreddit, params)
38
+ response = requests.get(url, headers=headers)
39
+
40
+ if response.ok:
41
+ data = response.json()
42
+ # save data to file
43
+ # with open(f"reddit_{subreddit}_{counter}.json", "w") as f:
44
+ # f.write(response.text)
45
+ posts = data["data"]["children"]
46
+ print(f"Got {len(posts)} posts")
47
+ for post in posts:
48
+ # print(post["data"]["title"])
49
+ pdata = post["data"]
50
+ post_id = pdata["id"]
51
+ title = pdata["title"]
52
+ # url = pdata["url"]
53
+ text = pdata.get("selftext")
54
+ score = pdata["score"]
55
+ author = pdata["author"]
56
+ date = pdata["created_utc"]
57
+ url = pdata.get("url_overridden_by_dest")
58
+ print(f"{post_id}: {title} - {url}")
59
+ # print("Keys are ", pdata.keys())
60
+ # post_list.append(
61
+ # {
62
+ # "id": post_id,
63
+ # "title": title,
64
+ # "text": text,
65
+ # "url": url,
66
+ # "score": score,
67
+ # "author": author,
68
+ # "date": date,
69
+ # "pdata": pdata,
70
+ # }
71
+ # )
72
+ post_list.append(
73
+ [subreddit, post_id, title, text, url, score, author, date, pdata]
74
+ )
75
+ print(f"Got {len(posts)} posts")
76
+ # params = f"?after={data['data']['after']}"
77
+ try:
78
+ params = "&after=" + data["data"]["after"]
79
+ except:
80
+ print(
81
+ "No more posts, broke on ", subreddit, "with counter at ", counter
82
+ )
83
+ break
84
+ counter -= 1
85
+ time.sleep(random.randint(1, 30))
86
+ else:
87
+ print(f"Error: {response.status_code}")
88
+ counter = original_counter
89
+ params = ""