// ==UserScript== // @name Google news API endpoint generator lite // @description グーグルのニュースを検索して結果をJSONで受け取ることができます。【確認用】 // ==/UserScript== /* * @title Google news API endpoint generator lite * @description グーグルのニュースを検索して結果をJSONで受け取ることができます。【確認用】 * @license MIT License * @require memo 1. YQLを利用しています。何かと都合がいいです。 2. 対象となる記事は日本語に限定されません。optionで選択できるようにするといいかも。 3. DOM未確認のまま操作しており、空白のページ他では適切に動作しないことがあります。 4. 右下のPackedをクリックしてコードをコピー! */ (function () { var createPlaceholder = function(){ //overlay var overlay = document.createElement('div'); overlay.style.width = '100vw'; overlay.style.height = '100vh'; overlay.style.position = 'absolute'; overlay.style.top = '0'; overlay.style.left = '0'; overlay.style.backgroundColor = 'rgba(0, 0, 0, 0.5)'; overlay.style.zIndex = 2121212120; document.body.appendChild(overlay); //main var c = document.createElement('div'); c.style.padding = '10px 20px'; c.style.width = '95vw'; c.style.position = 'absolute'; c.style.top = '30px'; c.style.left = '30px'; c.style.backgroundColor = '#f0f0f0'; c.style.zIndex = 2121212121; c.innerHTML = '
' + '