This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import nltk | |
nltk.download("subjectivity") | |
nltk.download("punkt") | |
nltk.download("vader_lexicon") | |
from nltk.classify import NaiveBayesClassifier | |
from nltk.corpus import subjectivity | |
from nltk.sentiment import SentimentAnalyzer | |
from nltk.sentiment.util import * | |
from nltk.sentiment.vader import SentimentIntensityAnalyzer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body onload="z=c.getContext`2d`;c.width=W=400,c.height=H=600,Y=E=200,Q=z.fillRect.bind(z),M=S=p=0;N=M=>z.fillStyle=M;c.onclick=_=>M=9;R=_=>{M=S=p=0,Y=E};setInterval(_=>{p=p||[W,Math.random()*W],N`red`,Q(0,0,W,H),Y-=M-=.5,X=p[0]-=8,N`black`,Q(X,0,V=50,Z=p[1]),Q(X,Z+E,V,H),(Y<Z||Y>Z+E)&&X<B&&R(),X<-V&&(p=0,S++),Y>H&&R(),Q(0,Y-9,B,B),z.fillText(S,9,B)},B=24)"><canvas id=c> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json, math | |
def main(): | |
data = json.loads(open("filteredposts.txt", "r").read()) | |
subs = {} | |
word_counts = {} | |
allowed_subs = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
def main(): | |
days = {} | |
countries = ["United States", "India", "Brazil", "Russia", "Peru"] | |
with open("owid-covid-data.csv") as f: | |
reader = csv.reader(f) | |
for line in reader: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, praw, time, math | |
def main(): | |
N = 350 | |
LINE TO DEFINE REDDIT WITH MY PASSWORD GOES HERE | |
sub = reddit.subreddit("u_iwillgetitalia") | |
target = base36decode(sys.argv[1]) | |
for post in reddit.subreddit("all").stream.submissions(): | |
print(abs(base36decode(post.id) - target + N), post.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import praw, sys, json | |
login_details = json.loads(open("login.json", "r").read()) | |
reddit = praw.Reddit(client_id=login_details["client_id"], \ | |
client_secret=login_details["client_secret"], \ | |
user_agent=login_details["user_agent"], \ | |
username=login_details["username"], \ | |
password=login_details["password"]) | |
scores = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
</head> | |
<body> | |
<canvas id="canvas"></canvas><br> | |
<button onclick="pause()">Start / Pause</button> | |
<p id="status">Status: Paused</p> | |
<script> |