Search Results

Search found 5 results on 1 pages for 'awis'.

Page 1/1 | 1 

  • need help with automating a CMD java tool whcih qurries alexa AWS using batch

    - by Eli.C
    Hi everyone, I need to get all available info on 600 URLs from "Alexa Web Information Service", I downloaded the java tool and I'm able to run a single query each time with a single switch/Response Group. I would like to ask how to write a batch file that would automate the process ? the java tool runs from the CMD with the following: C:java UrlInfo (key1) (key2) (URL) (Response Group) UrlInfo - constant key1 - constant key2 -constant URL - variable (I guess I need to use the "(" sign to read from a file) Response Group - variable - (14 total, and I need to run each Response Group on each of the URLs once ) the app returns data in clear text formatted as XML after each query, here is an example: C:java UrlInfo (key1) (key2) www.url.com Rank Response: (?xml version="1.0"?) (aws:UrlInfoResponse xmlns:aws="http://alexa.amazonaws.com/doc/2005-10-05/") (aws:Response xmlns:aws="http://awis.amazonaws.com/doc/2005-07-11") (aws:OperationRequest) (aws:RequestId)ec2b6-e8ae-b392(/aws:RequestId) (/aws:OperationRequest) (aws:UrlInfoResult) (aws:Alexa) (aws:TrafficData) (aws:DataUrl type="canonical")url.com/(/aws:DataUrl) (aws:Rank)472906(/aws:Rank) (/aws:TrafficData) (/aws:Alexa) (/aws:UrlInfoResult) (aws:ResponseStatus xmlns:aws="http://alexa.amazonaws.com/doc/2005-10-05/") (aws:StatusCode)Success(/aws:StatusCode) (/aws:ResponseStatus) (/aws:Response) (/aws:UrlInfoResponse) Any help would be really appreciated Thanks and regards Eli.C

    Read the article

  • need help with automating a CMD java tool which queries alexa AWS using batch

    - by Eli.C
    Hi everyone, I need to get all available info on 600 URLs from "Alexa Web Information Service", I downloaded the java tool and I'm able to run a single query each time with a single switch/Response Group. I would like to ask how to write a batch file that would automate the process? The java tool runs from the CMD with the following: C:\>java UrlInfo (key1) (key2) (URL) (Response Group) UrlInfo - constant key1 - constant key2 -constant URL - variable (I guess I need to use the "(" sign to read from a file) Response Group - variable - (14 total, and I need to run each Response Group on each of the URLs once ) the app returns data in clear text formatted as XML after each query, here is an example: C:\>java UrlInfo (key1) (key2) www.url.com Rank Response: (?xml version="1.0"?) (aws:UrlInfoResponse xmlns:aws="http://alexa.amazonaws.com/doc/2005-10-05/") (aws:Response xmlns:aws="http://awis.amazonaws.com/doc/2005-07-11") (aws:OperationRequest) (aws:RequestId)ec2b6-e8ae-b392(/aws:RequestId) (/aws:OperationRequest) (aws:UrlInfoResult) (aws:Alexa) (aws:TrafficData) (aws:DataUrl type="canonical")url.com/(/aws:DataUrl) (aws:Rank)**472906**(/aws:Rank) (/aws:TrafficData) (/aws:Alexa) (/aws:UrlInfoResult) (aws:ResponseStatus xmlns:aws="http://alexa.amazonaws.com/doc/2005-10-05/") (aws:StatusCode)Success(/aws:StatusCode) (/aws:ResponseStatus) (/aws:Response) (/aws:UrlInfoResponse) Any help would be really appreciated Thanks and regards Eli.C

    Read the article

  • Output on namespaced xpath in java

    - by user347928
    I have the following code and have had some trouble with a specific field and it's output. The namespace is connected but doesn't seem to be outputting on the required field. Any info on this would be great. import org.w3c.dom.Document; import org.xml.sax.SAXException; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPathFactory; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathExpressionException; import java.io.ByteArrayInputStream; import java.io.IOException; public class test { public static void main(String args[]) { String xmlStr = "<aws:UrlInfoResponse xmlns:aws=\"http://alexa.amazonaws.com/doc/2005-10-05/\">\n" + " <aws:Response xmlns:aws=\"http://awis.amazonaws.com/doc/2005-07-11\">\n" + " <aws:OperationRequest>\n" + " <aws:RequestId>blah</aws:RequestId>\n" + " </aws:OperationRequest>\n" + " <aws:UrlInfoResult>\n" + " <aws:Alexa>\n" + " <aws:TrafficData>\n" + " <aws:DataUrl type=\"canonical\">harvard.edu/</aws:DataUrl>\n" + " <aws:Rank>1635</aws:Rank>\n" + " </aws:TrafficData>\n" + " </aws:Alexa>\n" + " </aws:UrlInfoResult>\n" + " <aws:ResponseStatus xmlns:aws=\"http://alexa.amazonaws.com/doc/2005-10-05/\">\n" + " <aws:StatusCode>Success</aws:StatusCode>\n" + " </aws:ResponseStatus>\n" + " </aws:Response>\n" + "</aws:UrlInfoResponse>"; DocumentBuilderFactory xmlFact = DocumentBuilderFactory.newInstance(); xmlFact.setNamespaceAware(true); DocumentBuilder builder = null; try { builder = xmlFact.newDocumentBuilder(); } catch (ParserConfigurationException e) { e.printStackTrace(); } Document doc = null; try { doc = builder.parse( new ByteArrayInputStream( xmlStr.getBytes())); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } System.out.println(doc.getDocumentElement().getNamespaceURI()); System.out.println(xmlFact.isNamespaceAware()); String xpathStr = "//aws:OperationRequest"; XPathFactory xpathFact = XPathFactory.newInstance(); XPath xpath = xpathFact.newXPath(); String result = null; try { result = xpath.evaluate(xpathStr, doc); } catch (XPathExpressionException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } System.out.println("XPath result is \"" + result + "\""); } }

    Read the article

  • Output on namespaced xpath

    - by user347928
    Hi there, I have the following code and have had some trouble with a specific field and it's output. The namespace is connected but doesn't seem to be outputting on the required field. Any info on this would be great. import org.w3c.dom.Document; import org.xml.sax.SAXException; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPathFactory; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathExpressionException; import java.io.ByteArrayInputStream; import java.io.IOException; public class test { public static void main(String args[]) { String xmlStr = "<aws:UrlInfoResponse xmlns:aws=\"http://alexa.amazonaws.com/doc/2005-10-05/\">\n" + " <aws:Response xmlns:aws=\"http://awis.amazonaws.com/doc/2005-07-11\">\n" + " <aws:OperationRequest>\n" + " <aws:RequestId>blah</aws:RequestId>\n" + " </aws:OperationRequest>\n" + " <aws:UrlInfoResult>\n" + " <aws:Alexa>\n" + " <aws:TrafficData>\n" + " <aws:DataUrl type=\"canonical\">harvard.edu/</aws:DataUrl>\n" + " <aws:Rank>1635</aws:Rank>\n" + " </aws:TrafficData>\n" + " </aws:Alexa>\n" + " </aws:UrlInfoResult>\n" + " <aws:ResponseStatus xmlns:aws=\"http://alexa.amazonaws.com/doc/2005-10-05/\">\n" + " <aws:StatusCode>Success</aws:StatusCode>\n" + " </aws:ResponseStatus>\n" + " </aws:Response>\n" + "</aws:UrlInfoResponse>"; DocumentBuilderFactory xmlFact = DocumentBuilderFactory.newInstance(); xmlFact.setNamespaceAware(true); DocumentBuilder builder = null; try { builder = xmlFact.newDocumentBuilder(); } catch (ParserConfigurationException e) { e.printStackTrace(); } Document doc = null; try { doc = builder.parse( new ByteArrayInputStream( xmlStr.getBytes())); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } System.out.println(doc.getDocumentElement().getNamespaceURI()); System.out.println(xmlFact.isNamespaceAware()); String xpathStr = "//aws:OperationRequest"; XPathFactory xpathFact = XPathFactory.newInstance(); XPath xpath = xpathFact.newXPath(); String result = null; try { result = xpath.evaluate(xpathStr, doc); } catch (XPathExpressionException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } System.out.println("XPath result is \"" + result + "\""); } } Thanks Tony

    Read the article

1