WME Google POI verifier

Verify Waze landmarks linked to Google POI

当前为 2016-04-25 提交的版本,查看 最新版本

// ==UserScript==
// @name         WME Google POI verifier
// @version      0.4.1b
// @description  Verify Waze landmarks linked to Google POI
// @author       Kebb01
// @include 			https://www.waze.com/editor/*
// @include 			https://www.waze.com/*/editor/*
// @include 			https://editor-beta.waze.com/*
// @namespace           http://www.dammerung.cz/_waze/skript
// @grant               none
// ==/UserScript==


var input=document.createElement("input");
input.type="button";
input.value="Find Google place";
input.onclick = runGPOI;
input.setAttribute("style", "font-size:12px;position:absolute;bottom:70px;left:350px;");
document.body.appendChild(input);

function runGPOI()
{
    var gpoiCount = document.getElementsByClassName("select2-chosen");
    gpoiCount = gpoiCount.length;
    console.log("GPOI: Count of linked Google POIs: " + gpoiCount);

    if (gpoiCount < 1) {console.log("GPOI: place is not selected or has no linked Google POI");
                        alert("GPOI: place is not selected or has no linked Google POI");
                       } else {
                           var gpoi = document.getElementsByClassName('select2-chosen')[0].innerHTML;
                           console.log("GPOI: used");
                           console.log("GPOI: " + gpoi + ", " + gpoiCount);
                           //    alert (gpoi + ", " + gpoiCount);
                           var url = "https://www.google.com/maps/place/"+gpoi;
                           window.open(url,"_blank");
                       }
}