Skip to content

Instantly share code, notes, and snippets.

@Glowin
Created March 23, 2012 09:45
Show Gist options
  • Save Glowin/2169084 to your computer and use it in GitHub Desktop.
Save Glowin/2169084 to your computer and use it in GitHub Desktop.
黑龙江科技学院图书馆考研自习室占座脚本
/*
Library Auto Zhanzuo => A javascript snippet to help you book seats online.
Copyright (C) 2012-2013 Glow
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes Sizzle.js
http://sizzlejs.com/
Copyright 2011, The Dojo Foundation
Released under the MIT, BSD, and GPL Licenses.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// ==UserScript==
// @name USTH Library Zhanzuo
// @namespace http://project.quietmusic.org/j/
// @description A javascript snippet to help you zhanzuo online.
// @include *://127.0.0.1/zhanzuo/seat.php*
// ==/UserScript==
var timer;
var seatUrl = "http://127.0.0.1/zhanzuo/seat.php";
//代码中添加jquery
if(typeof(jQuery) == "undefined") {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js";
document.head.appendChild(script);
} else {
callback(jQuery);
}
//如果不是抢座页面则自动跳转
if ( window.location.href = seatUrl) {
self.location = seatUrl;
}
function refresh() {
if ( !$(".sign") ) {
}
}
//刷新间隔
timer = window.setInterval(refresh, 20);
@quietlynn
Copy link

提醒: http://project.quietmusic.org/j/ 是我的命名空间 URL 。建议修改为自己的命名空间,以免造成冲突。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment