-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.htm
196 lines (156 loc) · 8.09 KB
/
index.htm
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<!DOCTYPE html>
<!-- saved from url=(0060)http://getbootstrap.com/2.3.2/examples/starter-template.html -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>Welcome!</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css" rel="stylesheet">
<style>
body {
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
}
</style>
<link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap-responsive.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="../assets/js/html5shiv.js"></script>
<![endif]-->
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://getbootstrap.com/2.3.2/assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://getbootstrap.com/2.3.2/assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://getbootstrap.com/2.3.2/assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="http://getbootstrap.com/2.3.2/assets/ico/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="http://getbootstrap.com/2.3.2/assets/ico/favicon.png">
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<style type="text/css"></style></head>
<body>
<!-- ClickTale Top part -->
<script type="text/javascript">
var WRInitTime=(new Date()).getTime();
</script>
<!-- ClickTale end of Top part -->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand" href="#">Andrew's Website</a>
<!-- <a class="brand" href="http://getbootstrap.com/2.3.2/examples/starter-template.html#">Andrew's Website</a> -->
<div class="nav-collapse collapse">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#question">The Question</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container">
<div class="span3">
<h1>Hello, World!</h1>
<p>This site is undergoing construction.<br> Feel free to check back for updates!</p>
<script>
</script>
<script type="text/javascript">
function setLinkDisplay () {
var link = document.getElementById("link");
var vidId = youtube_parser(link.value);
if (vidId) {
//link.value = "";
var fieldID = document.getElementById("extractedId");
fieldID.value = vidId;
}
return vidId;
}
function youtube_parser(url){
var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
var match = url.match(regExp);
if (match&&match[7].length==11){
return match[7];
}else{
alert("Url incorrect");
}
}
var openLink = function() {
var id = setLinkDisplay();
var link = document.getElementById('linktest');
if (id) {
link.href="https://www.youtube.com/annotations_invideo?features=1&legacy=1&video_id="+id;
window.open("view-source:https://www.youtube.com/annotations_invideo?features=1&legacy=1&video_id="+id);
}
}
var getAnnotations = function() {
var id = setLinkDisplay();
if (id) {
var yahooApiUrl = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%3D%22https%3A%2F%2Fwww.youtube.com%2Fannotations_invideo%3Ffeatures%3D1%26legacy%3D1%26video_id%3D"+id+"%22&format=json&diagnostics=true&callback=" ;
$.ajax({
type: "GET",
url: yahooApiUrl,
dataType: "json",
success: jsonParser
});
function jsonParser(data) {
annoData_JSON = data.query.results.document.annotations.annotation;
document.getElementById('extractedAnnotations').value = JSON.stringify(annoData_JSON);
document.getElementById('extractedAnnotations').value += "\n \n" + JSON.stringify(annoData_JSON[0]);
alert(annoData_JSON.length);
}
}
}
</script>
<br>
<br>
<br>
<p> YouTube video ID extractor</p>
<input type='text' id='link' placeholder="Enter YouTube URL here.." value="youtube.com/watch?v=dE87HHxnz4Q&feature=youtu.be" />
<input type='button' onclick='setLinkDisplay()' value='Extract ID' />
<input type='button' onclick='openLink()' value='View Annotations' />
<input type='button' onclick='getAnnotations()' value='Get Annotations' />
<a id="linktest" href="#" >testlink</a>
<br>
<br>
<input type='text' id='extractedId' placeholder="Extracted ID" readonly="true" />
<textarea id='extractedAnnotations' placeholder="Extracted Annotations" ></textarea>
</div>
<div class="span6">
<img style="height:auto; width:auto; max-width:500px; max-height:500px;" src="http://img10.imageshack.us/img10/189/constructionhamsterauto.png" height="100">
</div>
</div> <!-- /container -->
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="./Bootstrap basic from Twitter_files/jquery.js"></script>
<script src="./Bootstrap basic from Twitter_files/bootstrap-transition.js"></script>
<script src="./Bootstrap basic from Twitter_files/bootstrap-alert.js"></script>
<script src="./Bootstrap basic from Twitter_files/bootstrap-modal.js"></script>
<script src="./Bootstrap basic from Twitter_files/bootstrap-dropdown.js"></script>
<script src="./Bootstrap basic from Twitter_files/bootstrap-scrollspy.js"></script>
<script src="./Bootstrap basic from Twitter_files/bootstrap-tab.js"></script>
<script src="./Bootstrap basic from Twitter_files/bootstrap-tooltip.js"></script>
<script src="./Bootstrap basic from Twitter_files/bootstrap-popover.js"></script>
<script src="./Bootstrap basic from Twitter_files/bootstrap-button.js"></script>
<script src="./Bootstrap basic from Twitter_files/bootstrap-collapse.js"></script>
<script src="./Bootstrap basic from Twitter_files/bootstrap-carousel.js"></script>
<script src="./Bootstrap basic from Twitter_files/bootstrap-typeahead.js"></script>
<!-- ClickTale Bottom part -->
<script type='text/javascript'>
// The ClickTale Balkan Tracking Code may be programmatically customized using hooks:
//
// function ClickTalePreRecordingHook() { /* place your customized code here */ }
//
// For details about ClickTale hooks, please consult the wiki page http://wiki.clicktale.com/Article/Customizing_code_version_2
document.write(unescape("%3Cscript%20src='"+
(document.location.protocol=='https:'?
"https://clicktalecdn.sslcs.cdngc.net/www07/ptc/7d269a05-6adc-4064-a8d4-f8459393e0d6.js":
"http://cdn.clicktale.net/www07/ptc/7d269a05-6adc-4064-a8d4-f8459393e0d6.js")+"'%20type='text/javascript'%3E%3C/script%3E"));
</script>
<!-- ClickTale end of Bottom part -->
</body></html>