<%@ page contentType="text/html; charset=UTF-8" %> <%@ taglib uri="/localtube/taglib333.tld" prefix="y" %> <% String lat = request.getParameter("lat"); String lng = request.getParameter("lng"); String order = request.getParameter("order"); if (order==null) order="published"; if (order.equals("view")) order = "viewCount"; else if (order.equals("rate")) order="rating"; else order="published"; //published – Entries are returned in reverse chronological order. This is the default value for video feeds other than search results feeds. //viewCount – Entries are ordered from most views to least views. //rating – %> Local tube

Local videos

<% if (lat==null || lng==null) { %> <% } %> <% if (lat!=null && lng!=null) { String sUrl="http://gdata.youtube.com/feeds/api/videos?v=2&orderby="+order+"&max-results=50&location="+lat+","+lng+"!&location-radius=50km"; %> <% String title = vb.getTitle(); String player = vb.getMedia().getPlayer(); String content = vb.getContent(); String thumbnail=""; for (int m=0; m"; break; } if (title==null) title=""; if (content==null) content=""; title = title.replaceAll("\"","'"); title = title.replaceAll("\\\\"," "); content = content.replaceAll("\"","'"); content = content.replaceAll("\\\\"," "); content = content.replaceAll("\n"," "); content = content.replaceAll("\r"," "); player = player.replace("http://www","http://m"); int i=player.indexOf("&feature"); if (i>0) player = player.substring(0,i); String s = vb.getStatistics(); if (s==null) s="0"; String sDuration = vb.getDuration(); if (sDuration==null) sDuration="0"; int duration=0; try { duration = Integer.parseInt(sDuration); } catch (Exception ex) { duration = 0; } int min=0; int sec = 0; while (duration>60) { min++; duration-=60; } sec = duration; String sSec = ""+sec; if (sec<10) sSec = "0"+sSec; out.println(""+thumbnail+"" +""+title+"" +"
"+min+":"+sSec+"   "+s+" views" +"

" +""); %>
<% } %>
<% if (lat!=null && lng!=null) { %>

Order by:   time   rating   views

<% } %>