BibliographyClassGroovy

BibliographyClassGroovy

Last modified by Kenneth Latimer on 2009/07/08 12:18
import java.net.*; class urlReader { String readUrl(refurl) { // vcontext = context.get("vcontext"); // def refurl = vcontext.get("refurl"); java.net.URI refuri = new java.net.URI(refurl); String query = refuri.getQuery(); String host = refuri.getHost(); String type = "" if(host.endsWith("youtube.com")) { if(query.startsWith("v=")) { if(query.indexOf("&") > -1) { query = query.substring(2,query.indexOf("&")); } else { query = query.substring(2); } type = "youtube"; embedIndex = query; } }

return type; } }

Tags:
Created by Kenneth Latimer on 2009/07/08 12:17

This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 2.7.1.${buildNumber} - Documentation