Skip to content

Instantly share code, notes, and snippets.

@vs4vijay
vs4vijay / GetDataFromXPath
Created Sep 27, 2013
Extract Data from XPath via Google Apps Script
View GetDataFromXPath
function getDataFromXpath(path, url) {
var data = UrlFetchApp.fetch(url);
var text = data.getContentText();
var xmlDoc = Xml.parse(text, true);
// Replacing tbody tag because app script doesnt understand.
path = path.replace("/html/","").replace("/tbody","","g");
var tags = path.split("/");
Logger.log("tags : " + tags);
// getting the DOM of HTML
View robot.js
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
View robot.js
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
View Viz
First Gist
View Mouse.java
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
class Mouse implements Runnable
{
static Robot r;
static Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();;
public static void main(String[] args) throws Exception