-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathspreadsheet.html
More file actions
60 lines (49 loc) · 1.73 KB
/
spreadsheet.html
File metadata and controls
60 lines (49 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html>
<head>
<title>Google Spreadsheet JSON Example</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
//Step 1: Share your google spreadsheet as a public document
//Step 2: Publish your spreadsheet
// File -> Publish to the web
// Start publishing
//Step 3: Copy key from url
// Full url: https://docs.google.com/spreadsheet/pub?key=0AuRlIp074IL7dFBDNnFacFdTQVlrc0JUcFI1MG1DVHc&output=html
// Relevant part: 0AuRlIp074IL7dFBDNnFacFdTQVlrc0JUcFI1MG1DVHc
//Step 4: Paste below in 'spreadsheetKey' variable
var spreadsheetKey = '0AuRlIp074IL7dFQtbm9mNUZIeVU4Vy1NbHRvS2ViVmc';
var url = 'https://spreadsheets.google.com/feeds/cells/'+spreadsheetKey+'/1/public/basic?alt=json-in-script';
$.ajax({
type: 'GET',
dataType: 'jsonp',
url: url,
success: function(response){
$.each(response.feed.entry, function(index, row){
//ignore timestamps that begin with '11'
if(row.title.$t.substring(0,1) != "A") {
var text = row.content.$t;
var title = row.title.$t;
if(title != "B1") {
console.log(row.content.$t);
var url = 'http://cooper-union-search-proxy.herokuapp.com/twitter/search/'+row.content.$t;
$.get(url, function (response){
//response.statuses contains all of the tweets
//response.search_metadata contains information about the search
console.log(response);
$.each(response.statuses, function(index, status){
console.log(status);
});
});
}
}
});
}
});
});
</script>
</head>
<body>
</body>
</html>