ODTDropbox

ODT++: transform xml outputs on Linked Data.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name           ODTDropbox 
// @author         Iker Azpeitia
// @version        1.3.1
// @namespace      odt++
// @description	   ODT++: transform xml outputs on Linked Data.
// @include        http://developer.yahoo.com/yql/console/*
// @include        https://developer.yahoo.com/yql/console/*
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_xmlhttpRequest
// ==/UserScript==  


window.addEventListener("load",mod,true);

function mod(){
 if(document.body.parentNode.className){
   if(window==window.top){
 	   start();
	 }
  }     
}


function start2(){
 var but=document.getElementById("submitMeButton");
 but.addEventListener("click",onClickButton,true);
 var textarea=document.getElementById("qid");
 textarea.addEventListener("keydown",function(ev){if(ev.keyCode==13){onClickButton(ev);}},true);
}

function start(){
 var but=document.getElementById("submitMeButton");
 but.addEventListener("click",onClickButton,true);
 var textarea=document.getElementById("qid");
 textarea.addEventListener("keydown",function(ev){if(ev.keyCode==13){onClickButton(ev);}},true);
}

function onClickButton(ev){
var textarea2=document.getElementById("qid").value;
var textarea=textarea2.toLowerCase();
    alert (textarea2);
textarea=textarea.replace(/(\ )*\n+(\ )*/g," ");
textarea=textarea.replace(/\s+/g, ' ');
    if(textarea.indexOf('http')==0){
    ev.stopImmediatePropagation();
    ev.preventDefault();
    ev.stopPropagation();  
    call(textarea);
 }
}

function call(uri){
  GM_xmlhttpRequest({
  method: "GET",
  url: uri,
  onload: function(response) {
      var parser=new DOMParser();
      parser=parser;
      var txt= response.responseText; 
      txt=txt.replace(/</g, "\n<span class=\'re1\'><<span>");
        document.getElementById("viewContent").innerHTML=txt;
  }
 });
 return 0;
}


function urlify(text) {
    var urlRegex = /(https?:\/\/[^\s]+)/g;
     return text.replace(urlRegex, '<a href="$1">$1</a>')
}