1
0
Fork 0

it works, now displays results

master
Ambrose Chua 2012-11-26 07:54:53 +08:00
parent 3a94aed993
commit 5508cb31f1
8 changed files with 959 additions and 19 deletions

View File

@ -2,8 +2,17 @@
<html>
<head>
<!-- <meta http-equiv="refresh" content="5" /> -->
<link href='http://fonts.googleapis.com/css?family=Ubuntu:300,400,700' rel='stylesheet' type='text/css' />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="keywords" content="ambc, eyesoff, youtube, speech, voice" />
<meta name="application-name" content="EyesOff" />
<meta name="author" content="Ambrose Chua Chi Meng (AmbC)" />
<title>EyesOff</title>
<link href='http://fonts.googleapis.com/css?family=Ubuntu:300,400,700' rel='stylesheet' type='text/css' />
<style>
::-moz-selection {
background-color: rgba(200, 100, 0, 0.7);
@ -25,6 +34,7 @@ font-size: 25px;
font-family: "Ubuntu Light", Ubuntu, Arial;
color: #fff;
background-color: #000;
opacity: 0.99;
}
#appa, #appb, #intro {
padding: 40px;
@ -78,10 +88,10 @@ width: 90px;
#intro {
display: block;
}
#appa {
#appa, #appb {
display: none;
}
#searchbox {
#searchbox, #toolsabox {
color: #aaa;
}
.headsup {
@ -89,35 +99,119 @@ font-size: 15px;
}
#showmewhy {
cursor: pointer;
}
#brightness {
width: 70px;
font-size: 12px;
position: fixed;
bottom: 10px;
right: 10px;
margin: 0;
}
#playerframe {/*
width: 1px;
height: 1px;*/
min-height: 0;
min-width: 0;
background-color: #000;
display: none;
}
.result {
}
</style>
</head>
<body>
<div id="intro">
<h1>Project EyesOff</h1>
<p>Inspired by <b>'No screen at night! '</b>, we give you <b>Project EyesOff</b>! It is a service that allows you to surf YouTube and listen to music via voice recognition and speech. Powered by <b>Google Voice Recognition</b> and <b>text to voice</b>, you can ensure it will give you the best possible results. </p>
<div class="coolbox nextpg">Go on...</div>
<h1>Project EyesOff - Purely client-side! </h1>
<p>Inspired by <b>'No screen at night! '</b>, we give you <b>Project EyesOff</b>! It is a service that allows you to surf YouTube and listen to music via voice recognition and speech. Powered by <b>Google Chrome's buit-in voice input</b> and <b>Google Translate's text to speech</b>, you can ensure it will give you the best possible results. It only works on Google Chrome. <a href="http://wp.me/p2q22L-2x">On my blog</a>. </p>
<div class="coolbox nextpg">Go on...</div><br /><br />
</div>
<div id="appa">
<h1 id="searchhead">Type <del id="showmewhy">or say</del> your search query</h1>
<form action="#" id="search">
<input type="text" id="searchbox" class="coolbox" value="Search..." x-webkit-speech="x-webkit-speech" />
<input type="text" id="searchbox" class="coolbox" value="Search..." x-webkit-speech="x-webkit-speech" onwebkitspeechchange='$("#search").submit();' />
<input type="submit" class="coolbox" value="Search" />
</form>
</div>
<div id="appb">
<h1 id="searchhead">Here are your results</h1>
<form action="#" id="toolsa">
<input type="text" id="toolsabox" class="coolbox" value="Command..." x-webkit-speech="x-webkit-speech" onwebkitspeechchange='$("#toolsa").submit();' />
<input type="submit" class="coolbox" value="Do" />
</form>
<div id="results">
</div>
</div>
<div id="brightness" class="coolbox">Turn down brightness</div>
<!--
<audio id="player">
<source src="" type="audio/mp3">
</audio> -->
<iframe id="playerframe" src="" title="This is the player"></iframe>
<script type="text/javascript" src="jquery.min.js"></script>
<!-- <script type="text/javascript" src="jquery.xmlns.js"></script> -->
<!-- <script type="text/javascript" src="http://raw.github.com/kvz/phpjs/master/functions/var/var_dump.js"></script> -->
<!-- <script type="text/javascript" src="http://raw.github.com/hiddentao/google-tts/master/google-tts.min.js"></script> -->
<script type="text/javascript">
$(document).ready(function() {
ifspeech=document.createElement("input").webkitSpeech;
// var tts = new GoogleTTS('en-GB');
function playnow(ttsstr) { // HOW TO USE: PUT playnow(fileid);
/*
$.ajax({
type: 'GET',
url: 'tts.php?q='+ttsstr,
success: ttsdone
});
function ttsdone(data, status){
$("#player source").attr("src", data);
var audio = $("#player")[0];
audio.play();
}
*/
//tts.play(ttsstr);
$("#playerframe").attr("src", "http://translate.google.com/translate_tts?tl=en&q="+ttsstr);
}/*
function getXmlDOMFromString(xmlStr){
if (window.ActiveXObject && window.GetObject) {
var dom = new ActiveXObject('Microsoft.XMLDOM');
dom.loadXML(xmlStr);
return dom;
}
if (window.DOMParser){
return new DOMParser().parseFromString(xmlStr,'text/xml');
}
throw new Error( 'No XML parser available' );
}*/
if (ifspeech != undefined) {
// $("#searchhead").html('Type <sup class="headsup">(Voice search is not supported in your browser, we recommend <a target="_blank" href="http://chrome.google.com/">Google Chrome</a>)</sup> your search query');
$("#searchhead").html('Type or say your search query <sup class="headsup">(Yay! Your browser supports speech input! )</sup>');
}
$("#brightness").click(function() {
if ($(this).html()=="Turn down brightness") {
$("body").css("opacity", "0.3");
$(this).html("Turn up brightness");
} else {
$("body").css("opacity", "1");
$(this).html("Turn down brightness");
}
});
$(".nextpg").click(function() {
$("#intro").fadeOut("slow").css("display", "none");
$("#appa").fadeIn("slow").css("display", "block");
if (ifspeech == undefined) {
playnow("please type your search query");
} else {
playnow("please type or say your search query");
}
});
$("#searchbox").focus(function() {
if ($(this).val() == "Search...") {
$("#searchbox, #toolsabox").focus(function() {
if ($(this).val() == "Search..." || $(this).val() == "Command...") {
$(this).val("");
$(this).css("color", "#fff");
}
@ -132,24 +226,40 @@ $(document).ready(function() {
// ask youtube.com
// http://gdata.youtube.com/feeds/api/videos?q=skateboarding+dog&start-index=0&max-results=10&v=2&key=AI39si6YeaDRSECPlD-FPnLV2r1T8rt6GHxYePHc94KTWRKgu3PnVMPmOaM0bISMORXolzcHLR7sCzCcN5K38carFyUTCH8jSg
// api: AI39si6YeaDRSECPlD-FPnLV2r1T8rt6GHxYePHc94KTWRKgu3PnVMPmOaM0bISMORXolzcHLR7sCzCcN5K38carFyUTCH8jSg
$("#searchhead").fadeIn("slow").html("Search not available yet! Sorry for party rockng! ");
if (document.createElement("input").webkitSpeech != undefined) {
setTimeout('$("#searchhead").fadeIn("slow").html("Type or say your search query <sup class=\\"headsup\\">(Yay! Your browser supports speech input! )</sup>");', 2000);
} else {
setTimeout('$("#searchhead").fadeIn("slow").html("Type <del id=\\"showmewhy\\">or say</del> your search query");', 2000);
playnow("serching youtube for "+$("#searchbox").val());
$.ajax({
type: 'GET',
url: 'http://gdata.youtube.com/feeds/api/videos?q='+$("#searchbox").val()+'&start-index=1&max-results=20&v=2&key=AI39si6YeaDRSECPlD-FPnLV2r1T8rt6GHxYePHc94KTWRKgu3PnVMPmOaM0bISMORXolzcHLR7sCzCcN5K38carFyUTCH8jSg',
dataType: "xml",
success: exception
});
function exception(data, status){
// datadb = data;
// alert(data+" - lol");
// xml = $.parseXML(data);
// var xmlData = getXmlDOMFromString(data);
// alert($(doc).find("entry"));
//alert($(data).find("entry"));// .find("title").text());
// $.xmlns.media = "media:";
$("#results").html("<div style='text-align: center;' id='loadingimg'><img src='loading.gif' /></div>");
$("#appa").fadeOut("slow").css("display", "none");
$("#appb").fadeIn("slow").css("display", "block");
$(data).find("entry").each(function(index, domele) {
var appstr='<a href="'+$(this).find("player:first").attr("url")+'">#'+(index+1)+' : <div class="result"><img src="'+$(this).find("thumbnail:eq(1)").attr("url")+'" /><h1>'+$(this).find("title:first").text()+'</h1><span>'+$(this).find("description:first").text()+'</span></div></a>';
$("#results").append(appstr);
});
$("#loadingimg").html("");
playnow("here are your results");
}
return false;
});
$("#searchbox").bind("onwebkitspeechchange", function() {
$("#searchbox").bind("onwebkitspeechchange", function() { // doesn't work, on doesn't work
$("#search").submit();
alert("s");
});
$("#showmewhy").click(function() {
$("#searchhead").html('Type <del id="showmewhy">or say</del> your search query <sup class="headsup">(Speech input is not supported in your browser, we recommend <a target="_blank" href="http://chrome.google.com/">Google Chrome</a>)</sup>');
});
if (document.createElement("input").webkitSpeech != undefined) {
// $("#searchhead").html('Type <sup class="headsup">(Voice search is not supported in your browser, we recommend <a target="_blank" href="http://chrome.google.com/">Google Chrome</a>)</sup> your search query');
$("#searchhead").html('Type or say your search query <sup class="headsup">(Yay! Your browser supports speech input! )</sup>');
}
});
</script>

BIN
iyq-ns.mp3 Normal file

Binary file not shown.

BIN
iyq.mp3 Normal file

Binary file not shown.

411
jquery.xmlns.js Normal file
View File

@ -0,0 +1,411 @@
//
// jquery.xmlns.js: xml-namespace selector support for jQuery
//
// This plugin modifies the jQuery tag and attribute selectors to
// support optional namespace specifiers as defined in CSS 3:
//
// $("elem") - matches 'elem' nodes in the default namespace
// $("|elem") - matches 'elem' nodes that don't have a namespace
// $("NS|elem") - matches 'elem' nodes in declared namespace 'NS'
// $("*|elem") - matches 'elem' nodes in any namespace
// $("NS|*") - matches any nodes in declared namespace 'NS'
//
// A similar synax is also supported for attribute selectors, but note
// that the default namespace does *not* apply to attributes - a missing
// or empty namespace selector selects only attributes with no namespace.
//
// In a slight break from the W3C standards, and with a nod to ease of
// implementation, the empty namespace URI is treated as equivalent to
// an unspecified namespace. Plenty of browsers seem to make the same
// assumption...
//
// Namespace declarations live in the $.xmlns object, which is a simple
// mapping from namespace ids to namespace URIs. The default namespace
// is determined by the value associated with the empty string.
//
// $.xmlns.D = "DAV:"
// $.xmlns.FOO = "http://www.foo.com/xmlns/foobar"
// $.xmlns[""] = "http://www.example.com/new/default/namespace/"
//
// Unfortunately this is a global setting - I can't find a way to do
// query-object-specific namespaces since the jQuery selector machinery
// is stateless. However, you can use the 'xmlns' function to push and
// pop namespace delcarations with ease:
//
// $().xmlns({D:"DAV:"}) // pushes the DAV: namespace
// $().xmlns("DAV:") // makes DAV: the default namespace
// $().xmlns(false) // pops the namespace we just pushed
// $().xmlns(false) // pops again, returning to defaults
//
// To execute this as a kind of "transaction", pass a function as the
// second argument. It will be executed in the context of the current
// jQuery object:
//
// $().xmlns("DAV:",function() {
// // The default namespace is DAV: within this function,
// // but it is reset to the previous value on exit.
// return this.find("response").each(...);
// }).find("div")
//
// If you pass a string as a function, it will be executed against the
// current jQuery object using find(); i.e. the following will find all
// "href" elements in the "DAV:" namespace:
//
// $().xmlns("DAV:","href")
//
//
// And finally, the legal stuff:
//
// Copyright (c) 2009, Ryan Kelly.
// TAG and ATTR functions derived from jQuery's selector.js.
// Dual licensed under the MIT and GPL licenses.
// http://docs.jquery.com/License
//
(function($) {
// Some common default namespaces, that are treated specially by browsers.
//
var default_xmlns = {
"xml": "http://www.w3.org/XML/1998/namespace",
"xmlns": "http://www.w3.org/2000/xmlns/",
"html": "http://www.w3.org/1999/xhtml/"
};
// A reverse mapping for common namespace prefixes.
//
var default_xmlns_rev = {}
for(var k in default_xmlns) {
default_xmlns_rev[default_xmlns[k]] = k;
}
// $.xmlns is a mapping from namespace identifiers to namespace URIs.
// The default default-namespace is "*", and we provide some additional
// defaults that are specified in the XML Namespaces standard.
//
$.extend({xmlns: $.extend({},default_xmlns,{"":"*"})});
// jQuery method to push/pop namespace declarations.
//
// If a single argument is specified:
// * if it's a mapping, push those namespaces onto the stack
// * if it's a string, push that as the default namespace
// * if it evaluates to false, pop the latest namespace
//
// If two arguments are specified, the second is executed "transactionally"
// using the namespace declarations found in the first. It can be either a
// a selector string (in which case it is passed to this.find()) or a function
// (in which case it is called in the context of the current jQuery object).
// The given namespace mapping is automatically pushed before executing and
// popped afterwards.
//
var xmlns_stack = [];
$.fn.extend({xmlns: function(nsmap,func) {
if(typeof nsmap == "string") {
nsmap = {"":nsmap};
}
if(nsmap) {
xmlns_stack.push($.xmlns);
$.xmlns = $.extend({},$.xmlns,nsmap);
if(func !== undefined) {
if(typeof func == "string") {
return this.find(func).xmlns(undefined)
} else {
var self = this;
try {
self = func.call(this);
if(!self) {
self = this;
}
} finally {
self.xmlns(undefined);
}
return self
}
} else {
return this;
}
} else {
$.xmlns = (xmlns_stack ? xmlns_stack.pop() : {});
return this;
}
}});
// Convert a namespace prefix into a namespace URI, based
// on the delcarations made in $.xmlns.
//
var getNamespaceURI = function(id) {
// No namespace id, use the default.
if(!id) {
return $.xmlns[""];
}
// Strip the pipe character from the specifier
id = id.substr(0,id.length-1);
// Certain special namespaces aren't mapped to a URI
if(id == "" || id == "*") {
return id;
}
var ns = $.xmlns[id];
if(typeof(ns) == "undefined") {
throw "Syntax error, undefined namespace prefix '" + id + "'";
}
return ns;
};
// Update the regex used by $.expr to parse selector components for a
// particular type of selector (e.g. "TAG" or "ATTR").
//
// This logic is taken straight from the jQuery/Sizzle sources.
//
var setExprMatchRegex = function(type,regex) {
$.expr.match[type] = new RegExp(regex.source + /(?![^\[]*\])(?![^\(]*\))/.source);
if($.expr.leftMatch) {
$.expr.leftMatch[type] = new RegExp(/(^(?:.|\r|\n)*?)/.source + $.expr.match[type].source.replace(/\\(\d+)/g, function(all, num){
return "\\" + (num - 0 + 1);
}));
}
}
// Modify the TAG match regexp to include optional namespace selector.
// This is basically (namespace|)?(tagname).
//
setExprMatchRegex("TAG",/^((?:((?:[\w\u00c0-\uFFFF\*_-]*\|)?)((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)))/);
// Perform some capability-testing.
//
var div = document.createElement("div");
// Sometimes getElementsByTagName("*") will return comment nodes,
// which we will have to remove from the results.
//
var gebtn_yields_comments = false;
div.appendChild(document.createComment(""));
if(div.getElementsByTagName("*").length > 0) {
gebtn_yields_comments = true;
}
// Some browsers return node.localName in upper case, some in lower case.
//
var localname_is_uppercase = true;
if(div.localName && div.localName == "div") {
localname_is_uppercase = false;
}
// Allow the testing div to be garbage-collected.
//
div = null;
// Modify the TAG find function to account for a namespace selector.
//
$.expr.find.TAG = function(match,context,isXML) {
var ns = getNamespaceURI(match[2]);
var ln = match[3];
var res;
if(typeof context.getElementsByTagNameNS != "undefined") {
// Easy case - we have getElementsByTagNameNS
res = context.getElementsByTagNameNS(ns,ln);
} else if(typeof context.selectNodes != "undefined") {
// Use xpath if possible (not available on HTML DOM nodes in IE)
if(context.ownerDocument) {
context.ownerDocument.setProperty("SelectionLanguage","XPath");
} else {
context.setProperty("SelectionLanguage","XPath");
}
var predicate = "";
if(ns != "*") {
if(ln != "*") {
predicate="namespace-uri()='"+ns+"' and local-name()='"+ln+"'";
} else {
predicate="namespace-uri()='"+ns+"'";
}
} else {
if(ln != "*") {
predicate="local-name()='"+ln+"'";
}
}
if(predicate) {
res = context.selectNodes("descendant-or-self::*["+predicate+"]");
} else {
res = context.selectNodes("descendant-or-self::*");
}
} else {
// Otherwise, we need to simulate using getElementsByTagName
res = context.getElementsByTagName(ln);
if(gebtn_yields_comments && ln == "*") {
var tmp = [];
for(var i=0; res[i]; i++) {
if(res[i].nodeType == 1) {
tmp.push(res[i]);
}
}
res = tmp;
}
if(res && ns != "*") {
var tmp = [];
for(var i=0; res[i]; i++) {
if(res[i].namespaceURI == ns || res[i].tagUrn == ns) {
tmp.push(res[i]);
}
}
res = tmp;
}
}
return res;
};
// Check whether a node is part of an XML document.
// Copied verbatim from jQuery sources, needed in TAG preFilter below.
//
var isXML = function(elem){
return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
!!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML";
};
// Modify the TAG preFilter function to work with modified match regexp.
// This normalises case of the tag name if we're in a HTML document.
//
$.expr.preFilter.TAG = function(match, curLoop, inplace, result, not, isXML) {
var ln = match[3];
if(!isXML) {
if(localname_is_uppercase) {
ln = ln.toUpperCase();
} else {
ln = ln.toLowerCase();
}
}
return [match[0],getNamespaceURI(match[2]),ln];
};
// Modify the TAG filter function to account for a namespace selector.
//
$.expr.filter.TAG = function(elem,match) {
var ns = match[1];
var ln = match[2];
var e_ns = elem.namespaceURI ? elem.namespaceURI : elem.tagUrn;
var e_ln = elem.localName ? elem.localName : elem.tagName;
if(ns == "*" || e_ns == ns || (ns == "" && !e_ns)) {
return ((ln == "*" && elem.nodeType == 1) || e_ln == ln);
}
return false;
};
// Modify the ATTR match regexp to extract a namespace selector.
// This is basically ([namespace|])(attrname)(op)(quote)(pattern)(quote)
//
setExprMatchRegex("ATTR",/\[\s*((?:((?:[\w\u00c0-\uFFFF\*_-]*\|)?)((?:[\w\u00c0-\uFFFF_-]|\\.)+)))\s*(?:(\S?=)\s*(['"]*)(.*?)\5|)\s*\]/);
// Modify the ATTR preFilter function to account for new regexp match groups,
// and normalise the namespace URI.
//
$.expr.preFilter.ATTR = function(match, curLoop, inplace, result, not, isXML) {
var name = match[3].replace(/\\/g, "");
if(!isXML && $.expr.attrMap[name]) {
match[3] = $.expr.attrMap[name];
}
if( match[4] == "~=" ) {
match[6] = " " + match[6] + " ";
}
if(!match[2] || match[2] == "|") {
match[2] = "";
} else {
match[2] = getNamespaceURI(match[2]);
}
return match;
};
// Modify the ATTR filter function to account for namespace selector.
// Unfortunately this means factoring out the attribute-checking code
// into a separate function, since it might be called multiple times.
//
var filter_attr = function(result,type,check) {
var value = result + "";
return result == null ?
type === "!=" :
type === "=" ?
value === check :
type === "*=" ?
value.indexOf(check) >= 0 :
type === "~=" ?
(" " + value + " ").indexOf(check) >= 0 :
!check ?
value && result !== false :
type === "!=" ?
value != check :
type === "^=" ?
value.indexOf(check) === 0 :
type === "$=" ?
value.substr(value.length - check.length) === check :
type === "|=" ?
value === check || value.substr(0,check.length+1)===check+"-" :
false;
}
$.expr.filter.ATTR = function(elem, match) {
var ns = match[2];
var name = match[3];
var type = match[4];
var check = match[6];
var result;
// No namespace, just use ordinary attribute lookup.
if(ns == "") {
result = $.expr.attrHandle[name] ?
$.expr.attrHandle[name](elem) :
elem[name] != null ?
elem[name] :
elem.getAttribute(name);
return filter_attr(result,type,check);
}
// Directly use getAttributeNS if applicable and available
if(ns != "*" && typeof elem.getAttributeNS != "undefined") {
return filter_attr(elem.getAttributeNS(ns,name),type,check);
}
// Need to iterate over all attributes, either because we couldn't
// look it up or because we need to match all namespaces.
var attrs = elem.attributes;
for(var i=0; attrs[i]; i++) {
var ln = attrs[i].localName;
if(!ln) {
ln = attrs[i].nodeName
var idx = ln.indexOf(":");
if(idx >= 0) {
ln = ln.substr(idx+1);
}
}
if(ln == name) {
result = attrs[i].nodeValue;
if(ns == "*" || attrs[i].namespaceURI == ns) {
if(filter_attr(result,type,check)) {
return true;
}
}
if(attrs[i].namespaceURI === "" && attrs[i].prefix) {
if(attrs[i].prefix == default_xmlns_rev[ns]) {
if(filter_attr(result,type,check)) {
return true;
}
}
}
}
}
return false;
};
})(jQuery);

BIN
loading.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
pwwwsyt.mp3 Normal file

Binary file not shown.

408
sample.xml Normal file
View File

@ -0,0 +1,408 @@
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:media="http://search.yahoo.com/mrss/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:gd="http://schemas.google.com/g/2005" xmlns:yt="http://gdata.youtube.com/schemas/2007" gd:etag="W/"CE8CRXwzeyp7I2A9WhNQGEk."">
<id>
tag:youtube.com,2008:videos
</id>
<updated>
2012-11-25T11:27:44.283Z
</updated>
<category scheme="http://schemas.google.com/g/2005#kind" term="http://gdata.youtube.com/schemas/2007#video">
<title>
Videos matching: lmfao
</title>
<logo>
http://www.youtube.com/img/pic_youtubelogo_123x63.gif
</logo>
<link rel="alternate" type="text/html" href="http://www.youtube.com"/>
<link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos?v=2"/>
<link rel="http://schemas.google.com/g/2005#batch" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/batch?v=2"/>
<link rel="self" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos?q=lmfao&start-index=1&max-results=3&v=2"/>
<link rel="service" type="application/atomsvc+xml" href="http://gdata.youtube.com/feeds/api/videos?alt=atom-service&v=2"/>
<link rel="next" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos?q=lmfao&start-index=4&max-results=3&v=2"/>
<author>
<name>
YouTube
</name>
<uri>
http://www.youtube.com/
</uri>
</author>
<generator version="2.1" uri="http://gdata.youtube.com">
YouTube data API
</generator>
<opensearch:totalresults>
148223
</opensearch:totalresults>
<opensearch:startindex>
1
</opensearch:startindex>
<opensearch:itemsperpage>
3
</opensearch:itemsperpage>
<entry gd:etag="W/"A0cMRH47eCp7I2A9WhNQGE4."">
<id>
tag:youtube.com,2008:video:KQ6zr6kCPj8
</id>
<published>
2011-03-09T05:30:54.000Z
</published>
<updated>
2012-11-25T10:24:45.000Z
</updated>
<app:control>
<yt:state name="restricted" reasoncode="limitedSyndication">
Syndication of this video was restricted.
</yt:state>
</app:control>
<category scheme="http://schemas.google.com/g/2005#kind" term="http://gdata.youtube.com/schemas/2007#video">
<category scheme="http://gdata.youtube.com/schemas/2007/categories.cat" term="Music" label="Music">
<title>
LMFAO - Party Rock Anthem ft. Lauren Bennett, GoonRock
</title>
<content type="application/x-shockwave-flash" src="http://www.youtube.com/v/KQ6zr6kCPj8?version=3&f=videos&d=ATyYogbqwqxa4DPqNslKUiAO88HsQjpE1a8d1GxQnGDm&app=youtube_gdata">
<link rel="alternate" type="text/html" href="http://www.youtube.com/watch?v=KQ6zr6kCPj8&feature=youtube_gdata"/>
<link rel="http://gdata.youtube.com/schemas/2007#video.responses" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/KQ6zr6kCPj8/responses?v=2"/>
<link rel="http://gdata.youtube.com/schemas/2007#video.ratings" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/KQ6zr6kCPj8/ratings?v=2"/>
<link rel="http://gdata.youtube.com/schemas/2007#video.complaints" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/KQ6zr6kCPj8/complaints?v=2"/>
<link rel="http://gdata.youtube.com/schemas/2007#video.related" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/KQ6zr6kCPj8/related?v=2"/>
<link rel="http://gdata.youtube.com/schemas/2007#uploader" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/users/k78ZcA6kflEvBR0UrGDH0Q?v=2"/>
<link rel="self" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/KQ6zr6kCPj8?v=2"/>
<author>
<name>
LMFAOVEVO
</name>
<uri>
http://gdata.youtube.com/feeds/api/users/LMFAOVEVO
</uri>
<yt:userid>
k78ZcA6kflEvBR0UrGDH0Q
</yt:userid>
</author>
<yt:accesscontrol action="comment" permission="allowed">
<yt:accesscontrol action="commentVote" permission="allowed">
<yt:accesscontrol action="videoRespond" permission="allowed">
<yt:accesscontrol action="rate" permission="allowed">
<yt:accesscontrol action="embed" permission="allowed">
<yt:accesscontrol action="list" permission="allowed">
<yt:accesscontrol action="autoPlay" permission="allowed">
<yt:accesscontrol action="syndicate" permission="allowed">
<gd:comments>
<gd:feedlink rel="http://gdata.youtube.com/schemas/2007#comments" href="http://gdata.youtube.com/feeds/api/videos/KQ6zr6kCPj8/comments?v=2" counthint="718711"/>
</gd:comments>
<yt:hd>
<media:group>
<media:category label="Music" scheme="http://gdata.youtube.com/schemas/2007/categories.cat">
Music
</media:category>
<media:content url="http://www.youtube.com/v/KQ6zr6kCPj8?version=3&f=videos&d=ATyYogbqwqxa4DPqNslKUiAO88HsQjpE1a8d1GxQnGDm&app=youtube_gdata" type="application/x-shockwave-flash" medium="video" isdefault="true" expression="full" duration="376" yt:format="5">
<media:credit role="uploader" scheme="urn:youtube" yt:display="LMFAOVEVO" yt:type="partner">
lmfaovevo
</media:credit>
<media:description type="plain">
Buy now glnk.it Music video by LMFAO performing Party Rock Anthem featuring Lauren Bennett and GoonRock. (c) 2011 Interscope #VEVOCertified on July 1, 2011. www.vevo.com www.youtube.com
</media:description>
<media:keywords>
<media:license type="text/html" href="http://www.youtube.com/t/terms">
youtube
</media:license>
<media:player url="http://www.youtube.com/watch?v=KQ6zr6kCPj8&feature=youtube_gdata_player">
<media:restriction type="country" relationship="deny">
DE
</media:restriction>
<media:thumbnail url="http://i.ytimg.com/vi/KQ6zr6kCPj8/default.jpg" height="90" width="120" time="00:03:08" yt:name="default">
<media:thumbnail url="http://i.ytimg.com/vi/KQ6zr6kCPj8/mqdefault.jpg" height="180" width="320" yt:name="mqdefault">
<media:thumbnail url="http://i.ytimg.com/vi/KQ6zr6kCPj8/hqdefault.jpg" height="360" width="480" yt:name="hqdefault">
<media:thumbnail url="http://i.ytimg.com/vi/KQ6zr6kCPj8/1.jpg" height="90" width="120" time="00:01:34" yt:name="start">
<media:thumbnail url="http://i.ytimg.com/vi/KQ6zr6kCPj8/2.jpg" height="90" width="120" time="00:03:08" yt:name="middle">
<media:thumbnail url="http://i.ytimg.com/vi/KQ6zr6kCPj8/3.jpg" height="90" width="120" time="00:04:42" yt:name="end">
<media:title type="plain">
LMFAO - Party Rock Anthem ft. Lauren Bennett, GoonRock
</media:title>
<yt:aspectratio>
widescreen
</yt:aspectratio>
<yt:duration seconds="376">
<yt:uploaded>
2011-03-09T05:30:54.000Z
</yt:uploaded>
<yt:uploaderid>
UCk78ZcA6kflEvBR0UrGDH0Q
</yt:uploaderid>
<yt:videoid>
KQ6zr6kCPj8
</yt:videoid>
</yt:duration>
</media:thumbnail>
</media:thumbnail>
</media:thumbnail>
</media:thumbnail>
</media:thumbnail>
</media:thumbnail>
</media:player>
</media:keywords>
</media:content>
</media:group>
<gd:rating average="4.850559" max="5" min="1" numraters="1700060" rel="http://schemas.google.com/g/2005#overall">
<yt:statistics favoritecount="0" viewcount="503150654">
<yt:rating numdislikes="63515" numlikes="1636545"/>
</yt:statistics>
</gd:rating>
</yt:hd>
</yt:accesscontrol>
</yt:accesscontrol>
</yt:accesscontrol>
</yt:accesscontrol>
</yt:accesscontrol>
</yt:accesscontrol>
</yt:accesscontrol>
</yt:accesscontrol>
</content>
</category>
</category>
</entry>
<entry gd:etag="W/"A0MASX47eCp7I2A9WhNQGE4."">
<id>
tag:youtube.com,2008:video:wyx6JDQCslE
</id>
<published>
2011-09-16T07:00:00.000Z
</published>
<updated>
2012-11-25T10:30:48.000Z
</updated>
<app:control>
<yt:state name="restricted" reasoncode="limitedSyndication">
Syndication of this video was restricted.
</yt:state>
</app:control>
<category scheme="http://schemas.google.com/g/2005#kind" term="http://gdata.youtube.com/schemas/2007#video">
<category scheme="http://gdata.youtube.com/schemas/2007/categories.cat" term="Music" label="Music">
<title>
LMFAO - Sexy and I Know It
</title>
<content type="application/x-shockwave-flash" src="http://www.youtube.com/v/wyx6JDQCslE?version=3&f=videos&d=ATyYogbqwqxa4DPqNslKUiAO88HsQjpE1a8d1GxQnGDm&app=youtube_gdata">
<link rel="alternate" type="text/html" href="http://www.youtube.com/watch?v=wyx6JDQCslE&feature=youtube_gdata"/>
<link rel="http://gdata.youtube.com/schemas/2007#video.responses" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/wyx6JDQCslE/responses?v=2"/>
<link rel="http://gdata.youtube.com/schemas/2007#video.ratings" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/wyx6JDQCslE/ratings?v=2"/>
<link rel="http://gdata.youtube.com/schemas/2007#video.complaints" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/wyx6JDQCslE/complaints?v=2"/>
<link rel="http://gdata.youtube.com/schemas/2007#video.related" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/wyx6JDQCslE/related?v=2"/>
<link rel="http://gdata.youtube.com/schemas/2007#uploader" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/users/k78ZcA6kflEvBR0UrGDH0Q?v=2"/>
<link rel="self" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/wyx6JDQCslE?v=2"/>
<author>
<name>
LMFAOVEVO
</name>
<uri>
http://gdata.youtube.com/feeds/api/users/LMFAOVEVO
</uri>
<yt:userid>
k78ZcA6kflEvBR0UrGDH0Q
</yt:userid>
</author>
<yt:accesscontrol action="comment" permission="allowed">
<yt:accesscontrol action="commentVote" permission="allowed">
<yt:accesscontrol action="videoRespond" permission="allowed">
<yt:accesscontrol action="rate" permission="allowed">
<yt:accesscontrol action="embed" permission="allowed">
<yt:accesscontrol action="list" permission="allowed">
<yt:accesscontrol action="autoPlay" permission="allowed">
<yt:accesscontrol action="syndicate" permission="allowed">
<gd:comments>
<gd:feedlink rel="http://gdata.youtube.com/schemas/2007#comments" href="http://gdata.youtube.com/feeds/api/videos/wyx6JDQCslE/comments?v=2" counthint="619573"/>
</gd:comments>
<yt:hd>
<media:group>
<media:category label="Music" scheme="http://gdata.youtube.com/schemas/2007/categories.cat">
Music
</media:category>
<media:content url="http://www.youtube.com/v/wyx6JDQCslE?version=3&f=videos&d=ATyYogbqwqxa4DPqNslKUiAO88HsQjpE1a8d1GxQnGDm&app=youtube_gdata" type="application/x-shockwave-flash" medium="video" isdefault="true" expression="full" duration="204" yt:format="5">
<media:credit role="uploader" scheme="urn:youtube" yt:display="LMFAOVEVO" yt:type="partner">
lmfaovevo
</media:credit>
<media:description type="plain">
Music video by LMFAO performing Sexy and I Know It. Get it on iTunes: glnk.it © 2011 Interscope Records #VEVOCertified on November 12, 2011. www.vevo.com www.youtube.com
</media:description>
<media:keywords>
<media:license type="text/html" href="http://www.youtube.com/t/terms">
youtube
</media:license>
<media:player url="http://www.youtube.com/watch?v=wyx6JDQCslE&feature=youtube_gdata_player">
<media:rating scheme="http://gdata.youtube.com/schemas/2007#mediarating" yt:country="all">
1
</media:rating>
<media:restriction type="country" relationship="deny">
DE
</media:restriction>
<media:thumbnail url="http://i.ytimg.com/vi/wyx6JDQCslE/default.jpg" height="90" width="120" time="00:01:42" yt:name="default">
<media:thumbnail url="http://i.ytimg.com/vi/wyx6JDQCslE/mqdefault.jpg" height="180" width="320" yt:name="mqdefault">
<media:thumbnail url="http://i.ytimg.com/vi/wyx6JDQCslE/hqdefault.jpg" height="360" width="480" yt:name="hqdefault">
<media:thumbnail url="http://i.ytimg.com/vi/wyx6JDQCslE/1.jpg" height="90" width="120" time="00:00:51" yt:name="start">
<media:thumbnail url="http://i.ytimg.com/vi/wyx6JDQCslE/2.jpg" height="90" width="120" time="00:01:42" yt:name="middle">
<media:thumbnail url="http://i.ytimg.com/vi/wyx6JDQCslE/3.jpg" height="90" width="120" time="00:02:33" yt:name="end">
<media:title type="plain">
LMFAO - Sexy and I Know It
</media:title>
<yt:aspectratio>
widescreen
</yt:aspectratio>
<yt:duration seconds="204">
<yt:uploaded>
2011-09-16T07:00:00.000Z
</yt:uploaded>
<yt:uploaderid>
UCk78ZcA6kflEvBR0UrGDH0Q
</yt:uploaderid>
<yt:videoid>
wyx6JDQCslE
</yt:videoid>
</yt:duration>
</media:thumbnail>
</media:thumbnail>
</media:thumbnail>
</media:thumbnail>
</media:thumbnail>
</media:thumbnail>
</media:player>
</media:keywords>
</media:content>
</media:group>
<gd:rating average="4.639656" max="5" min="1" numraters="1134649" rel="http://schemas.google.com/g/2005#overall">
<yt:statistics favoritecount="0" viewcount="252768122">
<yt:rating numdislikes="102216" numlikes="1032433"/>
</yt:statistics>
</gd:rating>
</yt:hd>
</yt:accesscontrol>
</yt:accesscontrol>
</yt:accesscontrol>
</yt:accesscontrol>
</yt:accesscontrol>
</yt:accesscontrol>
</yt:accesscontrol>
</yt:accesscontrol>
</content>
</category>
</category>
</entry>
<entry gd:etag="W/"A0UMRH47eCp7I2A9WhNQGE4."">
<id>
tag:youtube.com,2008:video:SkTt9k4Y-a8
</id>
<published>
2012-02-22T08:00:00.000Z
</published>
<updated>
2012-11-25T10:28:05.000Z
</updated>
<app:control>
<yt:state name="restricted" reasoncode="limitedSyndication">
Syndication of this video was restricted.
</yt:state>
</app:control>
<category scheme="http://schemas.google.com/g/2005#kind" term="http://gdata.youtube.com/schemas/2007#video">
<category scheme="http://gdata.youtube.com/schemas/2007/categories.cat" term="Music" label="Music">
<title>
LMFAO - Sorry For Party Rocking
</title>
<content type="application/x-shockwave-flash" src="http://www.youtube.com/v/SkTt9k4Y-a8?version=3&f=videos&d=ATyYogbqwqxa4DPqNslKUiAO88HsQjpE1a8d1GxQnGDm&app=youtube_gdata">
<link rel="alternate" type="text/html" href="http://www.youtube.com/watch?v=SkTt9k4Y-a8&feature=youtube_gdata"/>
<link rel="http://gdata.youtube.com/schemas/2007#video.responses" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/SkTt9k4Y-a8/responses?v=2"/>
<link rel="http://gdata.youtube.com/schemas/2007#video.ratings" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/SkTt9k4Y-a8/ratings?v=2"/>
<link rel="http://gdata.youtube.com/schemas/2007#video.complaints" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/SkTt9k4Y-a8/complaints?v=2"/>
<link rel="http://gdata.youtube.com/schemas/2007#video.related" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/SkTt9k4Y-a8/related?v=2"/>
<link rel="http://gdata.youtube.com/schemas/2007#uploader" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/users/k78ZcA6kflEvBR0UrGDH0Q?v=2"/>
<link rel="self" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/SkTt9k4Y-a8?v=2"/>
<author>
<name>
LMFAOVEVO
</name>
<uri>
http://gdata.youtube.com/feeds/api/users/LMFAOVEVO
</uri>
<yt:userid>
k78ZcA6kflEvBR0UrGDH0Q
</yt:userid>
</author>
<yt:accesscontrol action="comment" permission="allowed">
<yt:accesscontrol action="commentVote" permission="allowed">
<yt:accesscontrol action="videoRespond" permission="allowed">
<yt:accesscontrol action="rate" permission="allowed">
<yt:accesscontrol action="embed" permission="allowed">
<yt:accesscontrol action="list" permission="allowed">
<yt:accesscontrol action="autoPlay" permission="allowed">
<yt:accesscontrol action="syndicate" permission="allowed">
<gd:comments>
<gd:feedlink rel="http://gdata.youtube.com/schemas/2007#comments" href="http://gdata.youtube.com/feeds/api/videos/SkTt9k4Y-a8/comments?v=2" counthint="199756"/>
</gd:comments>
<yt:hd>
<media:group>
<media:category label="Music" scheme="http://gdata.youtube.com/schemas/2007/categories.cat">
Music
</media:category>
<media:content url="http://www.youtube.com/v/SkTt9k4Y-a8?version=3&f=videos&d=ATyYogbqwqxa4DPqNslKUiAO88HsQjpE1a8d1GxQnGDm&app=youtube_gdata" type="application/x-shockwave-flash" medium="video" isdefault="true" expression="full" duration="440" yt:format="5">
<media:credit role="uploader" scheme="urn:youtube" yt:display="LMFAOVEVO" yt:type="partner">
lmfaovevo
</media:credit>
<media:description type="plain">
Sorry For Party Rocking - Buy the album now! smarturl.it
</media:description>
<media:keywords>
<media:license type="text/html" href="http://www.youtube.com/t/terms">
youtube
</media:license>
<media:player url="http://www.youtube.com/watch?v=SkTt9k4Y-a8&feature=youtube_gdata_player">
<media:restriction type="country" relationship="deny">
DE
</media:restriction>
<media:thumbnail url="http://i.ytimg.com/vi/SkTt9k4Y-a8/default.jpg" height="90" width="120" time="00:03:40" yt:name="default">
<media:thumbnail url="http://i.ytimg.com/vi/SkTt9k4Y-a8/mqdefault.jpg" height="180" width="320" yt:name="mqdefault">
<media:thumbnail url="http://i.ytimg.com/vi/SkTt9k4Y-a8/hqdefault.jpg" height="360" width="480" yt:name="hqdefault">
<media:thumbnail url="http://i.ytimg.com/vi/SkTt9k4Y-a8/1.jpg" height="90" width="120" time="00:01:50" yt:name="start">
<media:thumbnail url="http://i.ytimg.com/vi/SkTt9k4Y-a8/2.jpg" height="90" width="120" time="00:03:40" yt:name="middle">
<media:thumbnail url="http://i.ytimg.com/vi/SkTt9k4Y-a8/3.jpg" height="90" width="120" time="00:05:30" yt:name="end">
<media:title type="plain">
LMFAO - Sorry For Party Rocking
</media:title>
<yt:aspectratio>
widescreen
</yt:aspectratio>
<yt:duration seconds="440">
<yt:uploaded>
2012-02-22T08:00:00.000Z
</yt:uploaded>
<yt:uploaderid>
UCk78ZcA6kflEvBR0UrGDH0Q
</yt:uploaderid>
<yt:videoid>
SkTt9k4Y-a8
</yt:videoid>
</yt:duration>
</media:thumbnail>
</media:thumbnail>
</media:thumbnail>
</media:thumbnail>
</media:thumbnail>
</media:thumbnail>
</media:player>
</media:keywords>
</media:content>
</media:group>
<gd:rating average="4.7480745" max="5" min="1" numraters="603607" rel="http://schemas.google.com/g/2005#overall">
<yt:statistics favoritecount="0" viewcount="135753962">
<yt:rating numdislikes="38016" numlikes="565591"/>
</yt:statistics>
</gd:rating>
</yt:hd>
</yt:accesscontrol>
</yt:accesscontrol>
</yt:accesscontrol>
</yt:accesscontrol>
</yt:accesscontrol>
</yt:accesscontrol>
</yt:accesscontrol>
</yt:accesscontrol>
</content>
</category>
</category>
</entry>
</category>
</feed>

11
tts.php Normal file
View File

@ -0,0 +1,11 @@
<?php
$qstr = substr($_GET['q'], 0, 100);
$qstr = urlencode($qstr);
$file = md5($qstr);
$file = "audio/".$file.".mp3";
if (!file_exists($file)) {
$mp3 = file_get_contents('http://translate.google.com/translate_tts?tl=en&q='.$qstr);
file_put_contents($file, $mp3);
}
echo $file;
?>