Permalink
Browse files

update search string to use timestamp: and top sorting for channels t…

…hat utilize search
  • Loading branch information...
1 parent 8ed5872 commit 542472198c378da8857e6692dd85fcff51cab9c1 @octatone committed Apr 11, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 js/tv.js
View
@@ -1,5 +1,11 @@
/* Globals */
-var search_str = "search/.json?q=%28or+site%3A%27youtube.com%27+site%3A%27vimeo.com%27+site%3A%27youtu.be%27%29&sort=new&restrict_sr=on&limit=100";
+/* we need the date in unixtime */
+var one_day = 86400,
+ date = new Date,
+ unixtime_ms = date.getTime(),
+ unixtime = parseInt(unixtime_ms / 1000);
+
+var search_str = "search/.json?q=%28and+%28or+site%3A%27youtube.com%27+site%3A%27vimeo.com%27+site%3A%27youtu.be%27%29+timestamp%3A"+(unixtime - 5*one_day)+"..%29&restrict_sr=on&sort=top"
var globals = {
/* Channels Object */

0 comments on commit 5424721

Please sign in to comment.