Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HW 2 HIV remix #89

Open
wants to merge 198 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
198 commits
Select commit Hold shift + click to select a range
2a99cc2
Fleshing out materials for first section.
blprnt Jan 26, 2014
fbe0fcf
Merge branch 'master' of github.com:blprnt/dataart
blprnt Jan 26, 2014
04a02df
Added NYTimes Article Search v2 example to Code directory.
blprnt Jan 26, 2014
237a49a
Added NYTimes Article Search v2 example to Code directory.
blprnt Jan 26, 2014
7ef5a67
Bigger year range, bar graph.
blprnt Jan 26, 2014
8e33b94
Update README.md
blprnt Jan 26, 2014
de41c6e
Update README.md
blprnt Jan 26, 2014
abfa1b1
Adding survey data
blprnt Jan 27, 2014
3e23189
Merge branch 'master' of github.com:blprnt/dataart
blprnt Jan 27, 2014
c9a54a5
Adding survey demo file
blprnt Jan 27, 2014
e53c4c5
Adding new NYT in class examples.
blprnt Jan 27, 2014
c38fd06
Final class example - nytimes graphs
blprnt Jan 27, 2014
937170a
Added delay & try/catch to query by year.
blprnt Jan 27, 2014
f5b7fe4
Added data folder at the top of the repo
blprnt Jan 27, 2014
6a90fdf
Added oneTab link to section 1 helpful things'
blprnt Jan 27, 2014
1491af0
shiffman showing how to add and commit
Jan 31, 2014
337e8d7
Merge pull request #1 from michellechandra/master
blprnt Jan 31, 2014
7d67064
su homework week1
sukim Feb 3, 2014
70d9e09
sukim homework week1
sukim Feb 3, 2014
b10bc75
Merge pull request #2 from sukim/master
blprnt Feb 3, 2014
4bbd996
Adding HW Files Assignment 1
Kadee80 Feb 7, 2014
5d6f7d1
Michelle and Diana adding first assignment
michellechandra Feb 8, 2014
a0ab61f
Merge pull request #3 from michellechandra/master
blprnt Feb 9, 2014
7b219d6
Michelle Cortese dataart week 1 commit
michellecortese Feb 9, 2014
8fd02bb
Merge pull request #4 from michellecortese/master
blprnt Feb 9, 2014
e1b45e6
this is my commit for homework
ckn220 Feb 10, 2014
aad25a2
John Farrell Aesthetic HW
jefarrell Feb 10, 2014
221e228
Adding PNG file
jefarrell Feb 10, 2014
554d117
Merge pull request #5 from ckn220/master
blprnt Feb 10, 2014
5127983
Merge pull request #6 from jefarrell/master
blprnt Feb 10, 2014
8a7aa43
Assignment 1 for Ju Park
juyoungp Feb 10, 2014
526a79b
rodrigo's first assignment
rdrg Feb 10, 2014
56b1676
do not change original code
rdrg Feb 10, 2014
cb543e4
Merge pull request #7 from rdrg/master
blprnt Feb 10, 2014
e16475f
Finalized HW Images and Code
Kadee80 Feb 10, 2014
b84fd43
Merge pull request #8 from Kadee80/Katie
blprnt Feb 10, 2014
7e7c39a
Updated code
jefarrell Feb 10, 2014
4cbe156
Merge pull request #9 from jefarrell/master
blprnt Feb 10, 2014
51e10b7
Catching up.
blprnt Feb 10, 2014
9e7c7f2
Merge branch 'master' of github.com:blprnt/dataart
blprnt Feb 10, 2014
60cae02
First commit hey
rafagrossbrown Feb 10, 2014
81de6be
Merge pull request #10 from rafagrossbrown/master
blprnt Feb 10, 2014
5415880
assignment 1, data and aesthetic, exploration of xkcd API data --KW
karlward Feb 10, 2014
ea71a3d
cleanup of some cruft --KW
karlward Feb 10, 2014
9b5ffea
Merge pull request #11 from karlward/master
blprnt Feb 10, 2014
58247cb
Create danigrant-assignment1
danigrant Feb 10, 2014
c86a169
Merge pull request #12 from danigrant/patch-1
blprnt Feb 10, 2014
7e5c684
Commit
katevisuth Feb 10, 2014
da66c88
Merge pull request #13 from katevisuth/master
blprnt Feb 10, 2014
360d1ef
First assignment.
wuchinhsuan Feb 10, 2014
02396d0
Merge pull request #14 from wuchinhsuan/master
blprnt Feb 10, 2014
9e84fd9
Salem's assignment
yessalem Feb 10, 2014
68df894
Merge pull request #15 from juyoungp/master
blprnt Feb 10, 2014
f8783d6
Merge branch 'master' of github.com:blprnt/dataart
blprnt Feb 10, 2014
d32a92a
Update NYT_ArticleSearch_InClass.pde
ckn220 Feb 10, 2014
0076183
first assignment
Feb 10, 2014
3ecaa17
homework1
jairwin06 Feb 11, 2014
f44ed46
Adding Ellery's data file.
blprnt Feb 11, 2014
2c1946b
More Aesthetics
michellecortese Feb 11, 2014
22c707f
Merge pull request #18 from michellecortese/master
blprnt Feb 11, 2014
840de55
Merge pull request #17 from jairwin06/master
blprnt Feb 11, 2014
1c677fb
Merge pull request #16 from ckn220/patch-1
blprnt Feb 11, 2014
68539de
added hw1
billyddaanngg Feb 13, 2014
470e8e2
vanessa submission
vjoho Feb 18, 2014
2ae9ac4
Merge pull request #21 from yessalem/master
blprnt Feb 18, 2014
20a948b
Merge pull request #20 from vjoho/master
blprnt Feb 18, 2014
57c6e50
Merge pull request #19 from billyddaanngg/master
blprnt Feb 18, 2014
8415a8f
this is my alternate HW for assignment 1
ckn220 Feb 23, 2014
38992e9
Diana adding part 2 of assignment 1
Feb 23, 2014
a2f3c5a
adding part two of assignment one
michellechandra Feb 23, 2014
5a53b6a
Merge pull request #23 from dfnews/master
blprnt Feb 23, 2014
b0ecdcc
Merge pull request #24 from michellechandra/master
blprnt Feb 23, 2014
dcae4b0
Merge pull request #22 from ckn220/master
blprnt Feb 23, 2014
2b64d95
HW 2
jefarrell Feb 23, 2014
80cf12c
rodrigo: merge of kate's digital solar systems with my first text dri…
rdrg Feb 24, 2014
d295021
Merge branch 'master' of https://github.com/blprnt/dataart
rdrg Feb 24, 2014
4c2eb6f
Updated JPG
jefarrell Feb 24, 2014
1013572
updated assignments 1 and 2
jairwin06 Feb 24, 2014
4cd459c
recommitting assignment1
jairwin06 Feb 24, 2014
5b13882
Added 2/24 Assignments
Kadee80 Feb 24, 2014
33b81ad
Removed Extra Files
Kadee80 Feb 24, 2014
ade1bba
Merge pull request #27 from Kadee80/master
blprnt Feb 24, 2014
e815a33
Merge pull request #26 from rdrg/master
blprnt Feb 24, 2014
afb750c
Merge pull request #25 from jefarrell/master
blprnt Feb 24, 2014
5e258ce
Adding phase 2 notes, etc.
blprnt Feb 24, 2014
d3dac74
Merge branch 'Katie'
Kadee80 Feb 24, 2014
621dce3
Merge branch 'master' of github.com:blprnt/dataart
blprnt Feb 24, 2014
e11c797
Cleaning up, adding some sample text files.
blprnt Feb 24, 2014
a6cc509
Cleaning up, adding some sample text files.
blprnt Feb 24, 2014
2414dd7
First Assignment Part Two
katevisuth Feb 24, 2014
70f1a7f
Adding stop list.
blprnt Feb 24, 2014
d2aaab7
Merge pull request #29 from katevisuth/master
blprnt Feb 24, 2014
e9bca0f
Merge pull request #28 from jairwin06/master
blprnt Feb 24, 2014
9542d96
Added Markov chain example.
blprnt Feb 24, 2014
cf58857
second assignmnent, using data from colin assignment 1
Feb 24, 2014
817f61a
commTer
rafagrossbrown Feb 24, 2014
5629013
commterr2
rafagrossbrown Feb 24, 2014
b83461e
adding additional assignments
vjoho Feb 24, 2014
fc66166
Merge pull request #32 from vjoho/master
blprnt Feb 24, 2014
5636bf7
Merge pull request #31 from rafagrossbrown/master
blprnt Feb 24, 2014
f35412e
Merge pull request #30 from danigrant/master
blprnt Feb 24, 2014
0366a22
Adding class work.
blprnt Feb 27, 2014
63c9e5e
Merge branch 'master' of github.com:blprnt/dataart
blprnt Feb 27, 2014
ff8a679
Adding new examples for Text & Archive.
blprnt Mar 3, 2014
4eb5bcd
Adding Twitter Pull example.
blprnt Mar 3, 2014
f86cdc9
added feminine mystique
paroza Mar 3, 2014
64cac8c
Adding network exampes.
blprnt Mar 3, 2014
eeaff4b
Shakespeare sheep.
blprnt Mar 3, 2014
032e5f1
Removing keys
blprnt Mar 6, 2014
ba28bb5
Project 2 added.
michellecortese Mar 6, 2014
834a3bb
Last examples.
blprnt Mar 9, 2014
73e20bf
fixed so that stoplist not sensitive to punctuation
Mar 9, 2014
f352b2a
michelle and diana adding text assignment
michellechandra Mar 10, 2014
ae38a2c
Evan Wu 2nd assignment
wuchinhsuan Mar 10, 2014
c8c6fb5
Adding assignment and assignment folder
Mar 10, 2014
9f7ecda
invisible cities work in progress
rdrg Mar 10, 2014
6c39a4f
Data art hw2
juyoungp Mar 10, 2014
5296699
Data art hw2
juyoungp Mar 10, 2014
1732fb8
Fixed Search, Springs still not connecting
Mar 10, 2014
b0c6af7
Adding folders.
blprnt Mar 12, 2014
35cdfe5
Merge pull request #33 from paroza/master
blprnt Mar 12, 2014
fab1c90
Merge pull request #34 from michellecortese/master
blprnt Mar 12, 2014
69df041
Merge pull request #35 from michellechandra/master
blprnt Mar 12, 2014
e1c8122
Merge pull request #36 from wuchinhsuan/master
blprnt Mar 12, 2014
3f3153f
Merge pull request #37 from rdrg/master
blprnt Mar 12, 2014
5082627
Merge pull request #38 from juyoungp/master
blprnt Mar 12, 2014
96b5cd3
Merge pull request #39 from Kadee80/master
blprnt Mar 12, 2014
31522fc
Cleaning up folders.
blprnt Mar 12, 2014
1a6007a
Cleaning up folders.
blprnt Mar 12, 2014
338276e
added text assignment
rafagrossbrown Mar 12, 2014
c9d98d2
pushing homework3
vjoho Mar 14, 2014
6141946
hw 2
jefarrell Mar 18, 2014
ab1496c
Adding section 3 helpful things.
blprnt Mar 22, 2014
07a1949
assignment 2 --KW
karlward Mar 23, 2014
6a84e0c
Commit
katevisuth Mar 24, 2014
ce5a47a
Merge pull request #42 from jefarrell/master
blprnt Mar 24, 2014
fae2a5f
Merge pull request #40 from rafagrossbrown/master
blprnt Mar 24, 2014
11a6c8f
Merge pull request #41 from vjoho/master
blprnt Mar 24, 2014
b670e69
Merge pull request #43 from karlward/master
blprnt Mar 24, 2014
d05311c
Adding data for sectio3, updating helpful things.
blprnt Mar 24, 2014
89b6d31
Merge branch 'master' of github.com:blprnt/dataart
blprnt Mar 24, 2014
c04f8c8
Adding data files.
blprnt Mar 24, 2014
ae9cce0
Adding bounding box tool to helpful things.
blprnt Mar 24, 2014
d6fcde2
Class examples for section 3! Airportsgit add *)
blprnt Mar 24, 2014
e5d7041
food deserts in NY State
paroza Mar 28, 2014
3841c74
food desert data of just NYC
paroza Mar 30, 2014
7bc34cd
Adding OpenPaths examples to section 3.
blprnt Mar 31, 2014
8450853
Adding OpenPaths examples to section 3.
blprnt Mar 31, 2014
3ea8ea7
Adding OpenPaths examples to section 3.
blprnt Mar 31, 2014
e86e83f
Added Leaflet.js example, notes on starting a local web server to the…
blprnt Mar 31, 2014
3969204
Added Leaflet.js example, notes on starting a local web server to the…
blprnt Mar 31, 2014
b1d24fd
this is it
paroza Mar 31, 2014
23fee0f
added files
paroza Mar 31, 2014
f3df303
not much
Mar 31, 2014
d3296d3
Merge remote-tracking branch 'upstream/master'
Mar 31, 2014
fe07f92
Class examples, etc. for 3/2.
blprnt Mar 31, 2014
c3126db
Class examples, etc. for 3/2.
blprnt Mar 31, 2014
75b8104
added more data
paroza Apr 9, 2014
edc9a3e
calculates the closest fresh market to each food desert in NYC
paroza Apr 9, 2014
1d0ecd2
added headline
paroza Apr 9, 2014
65f1307
added http request
paroza Apr 10, 2014
e6e4fe4
completed the desert class with dist, time + market
paroza Apr 11, 2014
a7e71ef
prints data out into a CSV file
paroza Apr 11, 2014
6cfd6bb
3rd assignment
ckn220 Apr 14, 2014
d0b38c0
Report App Version Used on Canoe Trip
Apr 14, 2014
795bdc3
Added Description
Apr 14, 2014
47f9fbf
Fixed Read Me
Apr 14, 2014
5b81bfc
Fixed Read Me
Apr 14, 2014
e1b8655
Merge pull request #44 from danigrant/master
blprnt Apr 14, 2014
fe95603
Merge pull request #45 from katevisuth/master
blprnt Apr 14, 2014
41020e3
Merge pull request #47 from ckn220/master
blprnt Apr 14, 2014
2383f1f
Merge pull request #48 from Kadee80/master
blprnt Apr 14, 2014
2434768
Catching up.
blprnt Apr 14, 2014
267f662
Merge branch 'master' of github.com:blprnt/dataart
blprnt Apr 14, 2014
b1c2c01
Merging.
blprnt Apr 14, 2014
4d7e886
processing code
Apr 14, 2014
2b672ba
Project 3
michellecortese Apr 14, 2014
4d58796
Adding citibike example.
blprnt Apr 14, 2014
589e250
nyc food deserts matched to their closest market, with time and dist …
paroza Apr 15, 2014
e82efa1
added the rest
paroza Apr 15, 2014
a620042
assignment
jefarrell Apr 16, 2014
665133d
Adding new readings.
blprnt Apr 18, 2014
c290733
Adding new readings.
blprnt Apr 18, 2014
2458cb2
Adding sonification examples.
blprnt Apr 21, 2014
61e5756
Added Citibike Hash Map Exercises
Apr 21, 2014
23b1352
Merge pull request #53 from Kadee80/master
blprnt Apr 21, 2014
27fdfbc
Merge pull request #52 from jefarrell/master
blprnt Apr 21, 2014
ae1eee7
Merge pull request #51 from paroza/master
blprnt Apr 21, 2014
323cbc5
Merge pull request #50 from michellecortese/master
blprnt Apr 21, 2014
97ca48f
Merge branch 'master' of https://github.com/danigrant/dataart into da…
blprnt Apr 21, 2014
1a1e604
Merge branch 'master' of github.com:blprnt/dataart
blprnt Apr 21, 2014
98d003c
Fixes.
blprnt Apr 23, 2014
216f872
Adding Threading demo.
blprnt Apr 28, 2014
d0216a1
Adding Threading demo.
blprnt Apr 28, 2014
4bbfafb
Last class
blprnt May 5, 2014
ca9fb0c
New semester! Fall, 2014
blprnt Sep 8, 2014
c864326
1_Data_and_Aesthetic/Assignments/SheriManson
Sep 22, 2014
7f842f3
hi sheri
Oct 2, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added .DS_Store
Binary file not shown.
85 changes: 85 additions & 0 deletions 1_Data_and_Aesthetic/Code/NYT_ArticleSearch_v2/NYT_ASearch.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
int queryDelay = 1200;

int[] doASearchYears(String q, int startYear, int endYear) {
int[] counts = new int[endYear - startYear];
int i = startYear;
while (i < endYear) {
println(i);
try {
ASResult r = doASearch(q, i + "0101", i + "1231");
println(r.hits);
counts[i - startYear] = r.hits;
delay(queryDelay);
i++;
} catch (Exception e) {
println("FAILED ON " + i + ". IF YOU SEE THIS MESSAGE A BUNCH OF TIMES IN A ROW, TRY AGAIN LATER, OR WITH A DIFFERENT QUERY. \n AND MAKE SURE YOU'VE ENTERED YOUR API KEY!");
}
}
return(counts);
}

ASResult doASearch(String q, String beginDate, String endDate) {
ASResult result = new ASResult();
result.resultJSON = loadJSONObject(getASURL(q, beginDate, endDate));
result.parse();
return(result);
}

String getASURL(String q, String beginDate, String endDate) {
return(baseURL + "q=" + java.net.URLEncoder.encode(q) + "&begin_date=" + beginDate + "&end_date=" + endDate + "&api-key=" + apiKey);
}

class ASResult {
JSONObject resultJSON;
ASDoc[] docs;
int hits;

void parse() {
JSONObject response = resultJSON.getJSONObject("response");
JSONObject meta = response.getJSONObject("meta");
hits = meta.getInt("hits");

JSONArray docArray = response.getJSONArray("docs");
int totalDocs = docArray.size();
docs = new ASDoc[totalDocs];

for (int i = 0; i < totalDocs; i++) {
JSONObject doco = docArray.getJSONObject(i);
ASDoc doc = new ASDoc();
doc.docJSON = doco;

docs[i] = doc;
doc.parse();
}
}
}

class ASDoc {
JSONObject docJSON;

//** Note - all other fields of the documents can be fished out manually from the docJSON object. ie. docJSON.getString("web_url");
// I've just built in these three for convenience sake
String headline;
int page;
String snippet;


void parse() {
headline = docJSON.getJSONObject("headline").getString("main");
try {
page = int(docJSON.getString("print_page"));
}
catch(Exception e) {
//Sometimes pages are null. In this case, we'll set it to -1
page = -1;
}

try {
snippet = docJSON.getString("snippet");
}
catch (Exception e) {
//Sometimes the snippets are null. In this case we'll set it to "";
snippet = "";
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*

ITP Data Art
NYTimes Article Search v2 Simple Example

**Note - you must put your API key in the first field for this to work!

Article Search v2 docs: http://developer.nytimes.com/docs/read/article_search_api_v2

*/

String apiKey = "YOUR_API_KEY_GOES_HERE";
String baseURL = "http://api.nytimes.com/svc/search/v2/articlesearch.json?";

void setup() {
size(1280, 720, P3D);
smooth(8);
background(255);

//This function returns a list of integers, counting a search term per year
int[] monkeyCounts = doASearchYears("data", 2011, 2015);

//Which we can draw a bar chart from:
for (int i = 0; i < monkeyCounts.length; i++) {
fill(0,150);
float x = map(i,0, monkeyCounts.length,100, width - 100);
float y = height - 100;
float w = (width - 200)/monkeyCounts.length;
float h = -map(monkeyCounts[i], 0, max(monkeyCounts), 0, height - 200);
rect(x, y, w, h);
fill(255);
pushMatrix();
translate(x,y);
rotate(PI/2);
textSize(10);
text(i + 1901, 0, 8);
popMatrix();
}

//It's often useful to save data like this (so we don't have to call the API every time once we're visualizing)
PrintWriter writer = createWriter("data/monkeyData.csv");
for (int i:monkeyCounts) writer.println(i);
writer.flush();
writer.close();

/*
//There is really a lot more we can do with this.
//Here, a search for 'bin laden' on the day he was killed
ASResult osama = doASearch("bin laden", "20110502", "20110502");
//Find out how many articles
println(osama.hits);
//Get the headline of the fourth one
println(osama.docs[3].headline);
//And a snippet from the second one
println(osama.docs[2].snippet);
//We can get access to any of the fields that are returned (see API docs). For example the URL to the first story:
println(osama.docs[0].docJSON.getString("web_url"));
//Or, a JSON list of the keywords associated with the story
JSONArray keyWords = osama.docs[0].docJSON.getJSONArray("keywords");
for(int i =0; i < keyWords.size(); i++) {
JSONObject keyWord = keyWords.getJSONObject(i);
println(keyWord.getString("name"), keyWord.getString("value"));
}
*/

}

void draw() {
}



Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
7581
11565
13898
11572
File renamed without changes.
Loading