CTFtime writeup column

Insert a new column of writeup to table at archive page.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         CTFtime writeup column
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Insert a new column of writeup to table at archive page.
// @author       Bu4275
// @match        https://ctftime.org/event/list/past
// @grant        none
// ==/UserScript==
/* jshint -W097 */
'use strict';

// Your code here...

var s = '';
var div = document.getElementsByClassName('container')[1];
var table = div.getElementsByClassName('table table-striped')[0];

// Insert a column
var cell1 = table.rows[0].insertCell(1);
cell1.innerHTML = "<th>writeup</th>";

var str ='';

for(var i=1;i<table.rows.length;i++){
    var tr = table.rows[i];
    var td = tr.getElementsByTagName('td')[0]
    var url = td.getElementsByTagName('a')[0].getAttribute('href') + "/tasks/";
    
    // Insert a column
    var cell1 = table.rows[i].insertCell(1);
    cell1.innerHTML = "<a href=" +url + "> writeup </a>";
    
    //str = str  + url + "\t" +  td.innerText.toString()+'\n';
}


//console.log(str);