Greasy Fork镜像 还支持 简体中文。

AtCoder-Google-Calender

AtCoderでGoogle Calender に追加するリンクを生成。面倒な日時の入力を省略できます。

  1. // ==UserScript==
  2. // @name AtCoder-Google-Calender
  3. // @namespace https://github.com/penicillin0/
  4. // @version 0.1.5
  5. // @description AtCoderでGoogle Calender に追加するリンクを生成。面倒な日時の入力を省略できます。
  6. // @author penicillin0
  7. // @license MIT
  8. // @match https://atcoder.jp/contests/*
  9. // @homepage https://github.com/penicillin0/AtCoder-Google-Calender#readme
  10. // @supportURL https://twitter.com/penicillin0at
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15. const contest_name = document.querySelector('a.contest-title').innerHTML;
  16. const contest_url = document.querySelector('a.contest-title');
  17.  
  18. // 開始時間と修了時間の取得
  19. const times = document.querySelectorAll('small.contest-duration a');
  20. const start_time_formed = String(times[0]).split('=')[1].replace('&p1', '') + '00';
  21. const end_time_formed = String(times[1]).split('=')[1].replace('&p1', '') + '00';
  22.  
  23.  
  24. const google_calendar_url = 'http://www.google.com/calendar/event?' +
  25. 'action=' + 'TEMPLATE' +
  26. '&text=' + contest_name +
  27. '&dates=' + start_time_formed + '/' + end_time_formed +
  28. '&location=' + contest_url;
  29.  
  30. const insert_txt = ` <a href='${google_calendar_url}', target="_blank">Google Calendar</a>`;
  31. const place = document.querySelector('small.contest-duration');
  32. // window.alert(place)
  33. place.insertAdjacentHTML('beforeend', insert_txt);
  34.  
  35. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址