<jupyter_start><jupyter_text>Data Collection by PrawCollecting texts on the vaccine from who express concerns about vaccines via Prawr/VaccineMythsr/AntiVaxxersr/vaxxhappenedr/TrueAntiVaccinationr/DebateVaccines<jupyter_code>import numpy as np
import pandas as pd
import praw
import pprint
import json
reddit = praw.Reddit(
    client_id="",
    client_secret="",
    user_agent="",
)
print(reddit.read_only)<jupyter_output><empty_output><jupyter_text>For VaccineMyths<jupyter_code>reddit_id,title,body =[],[],[]
for submission in reddit.subreddit("VaccineMyths").hot():
    reddit_id.append(submission.id)
    title.append(submission.title)
    if submission.selftext != "None":
        body.append(submission.selftext)
    for comment in submission.comments.list():
        try:
            reddit_id.append(str(comment))
            title.append("Comment")
            body.append(comment.body)
        except:
            continue
data = pd.DataFrame([reddit_id,title,body]).T
data.columns=['id','title','text']
vaccine_myth=data.dropna()
vaccine_myth<jupyter_output><empty_output><jupyter_text>For AntiVaxxers<jupyter_code>reddit_id,title,body =[],[],[]
for submission in reddit.subreddit("AntiVaxxers").hot():
    reddit_id.append(submission.id)
    title.append(submission.title)
    if submission.selftext != "None":
        body.append(submission.selftext)
    for comment in submission.comments.list():
        try:
            reddit_id.append(str(comment))
            title.append("Comment")
            body.append(comment.body)
        except:
            continue

data = pd.DataFrame([reddit_id,title,body]).T
data.columns=['id','title','text']
anti_vaxxers=data.dropna()<jupyter_output><empty_output><jupyter_text>For /vaxxhappened<jupyter_code>reddit_id,title,body =[],[],[]
for submission in reddit.subreddit("vaxxhappened").hot():
    reddit_id.append(submission.id)
    title.append(submission.title)
    if submission.selftext != "None":
        body.append(submission.selftext)
    for comment in submission.comments.list():
        try:
            reddit_id.append(str(comment))
            title.append("Comment")
            body.append(comment.body)
        except:
            continue


data = pd.DataFrame([reddit_id,title,body]).T
data.columns=['id','title','text']
vaxx_happened=data.dropna()
vaxx_happened<jupyter_output><empty_output><jupyter_text>r/TrueAntiVaccination<jupyter_code>reddit_id,title,body =[],[],[]
for submission in reddit.subreddit("TrueAntiVaccination").hot():
    reddit_id.append(submission.id)
    title.append(submission.title)
    if submission.selftext != "None":
        body.append(submission.selftext)
    for comment in submission.comments.list():
        try:
            reddit_id.append(str(comment))
            title.append("Comment")
            body.append(comment.body)
        except:
            continue


data = pd.DataFrame([reddit_id,title,body]).T
data.columns=['id','title','text']
true_anti_vax=data.dropna()
true_anti_vax<jupyter_output><empty_output><jupyter_text>r/DebateVaccines<jupyter_code>reddit_id,title,body =[],[],[]
for submission in reddit.subreddit("DebateVaccines").hot():
    reddit_id.append(submission.id)
    title.append(submission.title)
    if submission.selftext != "None":
        body.append(submission.selftext)
    for comment in submission.comments.list():
        try:
            reddit_id.append(str(comment))
            title.append("Comment")
            body.append(comment.body)
        except:
            continue


data = pd.DataFrame([reddit_id,title,body]).T
data.columns=['id','title','text']
debate_vaccines=data.dropna()
debate_vaccines<jupyter_output><empty_output><jupyter_text>Combining All!<jupyter_code>debate_vaccines['community']='debate_vaccines'
true_anti_vax['community']='true_anti_vax'
vaxx_happened['community']='vaxx_happened'
vaccine_myth['community']='vaccine_myth'
anti_vaxxers['community']='anti_vaxxers'
result=debate_vaccines.append([true_anti_vax,vaxx_happened,vaccine_myth,anti_vaxxers], sort=False)

result.to_csv('data/vax_reddit.csv',index=False)
result.head()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13626479826044938, 'fraction_numerical': 0.0, 'mean_word_length': 4.461741424802111, 'pattern_counts': {'":': 5, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '125950', 'license': 'MIT', 'n_tokens_mistral': 1420, 'n_tokens_neox': 1412, 'n_words': 171, 'path': 'reddit_data_collection.ipynb', 'repo_name': 'sk981102/HooHacks2021', 'size': '4139'}