|
|||||||||
| Arts & Entertainment | Education & Government | News & Media | |||||||
| Business & Careers | Health & Recreations | Reference & Religion | |||||||
| Culture & Society | Home & Garden | Science & Jobs | |||||||
| Sports & Travel | WWW & Computers | ||||||||
|
|||||||||
| #1
Free Link Exchange Directory On The Web - Link Market |
Free Search Engine Submission |
||||||||
| |
|||||||||
<%@ page import="java.net.*"%> <%@ page import="java.io.*"%> <%@ page import="javax.xml.parsers.DocumentBuilderFactory"%> <%@ page import="javax.xml.parsers.ParserConfigurationException"%> <%@ page import="org.xml.sax.SAXException"%> <%@ page import="org.w3c.dom.*"%> <%@ page import="java.util.*"%> <%! // The following code was graciously provided by Armond Avanes (http://www.armondavanes.com) private String tla_ads( HttpServletRequest request, HttpServletResponse response ) throws IOException, ParserConfigurationException, SAXException { // Number of seconds before connection to XML times out // (This can be left the way it is) int CONNECTION_TIMEOUT = 10; // Local file to store XML // This file MUST be writable by web server // You should create a blank file and CHMOD it to 666 String LOCAL_XML_FILENAME = "local_102413.xml"; String INVENTORY_KEY = "Z6OHAMXK15O65GVMRFRY"; File localXmlFile = new File( getServletConfig().getServletContext().getRealPath(LOCAL_XML_FILENAME ) ); if( !localXmlFile.exists() ) { return( "Text Link Ads script error: " + localXmlFile.getName() + " does not exist. Please create a blank file named " + localXmlFile.getName() + "." ); } if( !localXmlFile.canWrite() ) { return( "Text Link Ads script error: " + localXmlFile.getName() + " is not writable. Please set write permissions on " + localXmlFile.getName() + "." ); } if( localXmlFile.lastModified()<(new Date().getTime() - 3600*1000) || localXmlFile.length()<20 ) { String request_uri = (request.getRequestURI()!=null) ? request.getRequestURI() : ""; String user_agent = (request.getHeader("User-Agent")!=null) ? request.getHeader("User-Agent") : ""; URL url = new URL("http://www.text-link-ads.com/xml.php?inventory_key=" + INVENTORY_KEY + "&referer=" + response.encodeURL( request_uri ) + "&user_agent=" + response.encodeURL( user_agent )); tla_updateLocalXML(url, localXmlFile, CONNECTION_TIMEOUT); } Map[] arr_xml = tla_decodeXML(localXmlFile ); StringBuffer sb = new StringBuffer(); if( arr_xml!=null && arr_xml.length>0 ) { sb.append( "\n
|
|||||||||
| ©
2000 Mona Doytchinova All rights reserved. |
|||||||||