Skip to content

Instantly share code, notes, and snippets.

///////////////////////////////////
// By: Kat Sullivan
///////////////////////////////////
class Circle {
PVector pos;
Circle(PVector tempPos) {
pos = tempPos;
// Daniel Shiffman (with edits from Kat Sullivan)
// http://www.learningprocessing.com
// A Polar coordinate, radius now starts at 0 to spiral outwards
float r = 0;
float theta = 0;
void setup() {
size(400,400);
@katsully
katsully / Twitter
Created October 31, 2014 16:50
Twitter
import twitter4j.Trends;
import twitter4j.Location;
import twitter4j.ResponseList;
import twitter4j.Trend;
import java.util.List;
import twitter4j.User;
import twitter4j.Status;
/////////////////////////////////////////
// By: Kat Sullivan
/////////////////////////////////////////
@katsully
katsully / Twitter
Created November 8, 2014 01:07
Using the Twitter API to query different keywords
/////////////////////////////////////////
// By: Kat Sullivan
/////////////////////////////////////////
import java.util.Map;
import java.util.Set;
import java.util.HashSet;
import java.util.Iterator;
import twitter4j.Status;
import twitter4j.TwitterException;
import twitter4j.QueryResult;
############################################
## By: Kat Sullivan
############################################
from random import randint
import sys
prev_line = ""
poem = ""
#
# RWET Programming Exercise B
#
# This worksheet is also a Python program. Your task is to read the
# task descriptions below and then write one or more Python statements to
# carry out the tasks. There's a Python "print" statement before each
# task that will display the expected output for that task; you can use
# this to ensure that your statements are correct.
#
############################
## By: Kat Sullivan
############################
import facebook
import json
# take in the ceratin comment as a list of words, and the index where the queried word occurs in a list
# return the phrase
def add_to_list(words, index):
#
# Worksheet #3
#
# This worksheet is also a Python program. Your task is to read the
# task descriptions below and then write one or more Python statements to
# carry out the tasks. There's a Python "print" statement before each
# task that will display the expected output for that task; you can use
# this to ensure that your statements are correct.
#
# In this worksheet, some of the tasks will throw an error that causes
import requests
from random import randint
counter = 0
term = "Right-Wing"
while counter < 20:
r = requests.get('http://api.nytimes.com/svc/search/v2/articlesearch.json?fq=headline:(' + term + ')&api-key=8507eaad79faa9ac49204db270a8e0e3:13:70195569')
if r.ok == False:
break
#
# Worksheet #4
#
# This worksheet is also a Python program. Your task is to read the
# task descriptions below and then write one or more Python statements to
# carry out the tasks. There's a Python "print" statement before each
# task that will display the expected output for that task; you can use
# this to ensure that your statements are correct.
#
# In this worksheet, some of the tasks will throw an error that causes