This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var roll=function(max,min,count){ | |
var i=0; | |
var ret=[]; | |
while(i<count){ | |
ret.push(parseInt(Math.random()*(max-min+1)+min)); | |
i++; | |
} | |
return ret; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sm=function(s){ | |
if(typeof s !='object'||s==null)var s=[]; | |
if(typeof s.length =='undefined')s=[s]; | |
return { | |
segments:s, | |
addText:function(text){ | |
this.segments.push({ | |
text:text, | |
type:'TEXT' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Segment=require('./classes/segment'); | |
function buildContent(content,bot_id,user_id,user_name){ | |
var ret=new Segment(); | |
ret.addMention(user_name,user_id); | |
for(var i in content){ | |
if(content[i].type=='USER_MENTION'&&content[i].user.userId==bot_id){ | |
console.log('Command detected.'); | |
var command=content[parseInt(i)+1].text.trim(); | |
var rest=content; | |
rest.splice(0,parseInt(i)+2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_tags = (raw)-> | |
return '' if raw is '' | |
return '' if !raw? | |
raw = raw.replace /☪|★|☆/g,'' | |
pattern = /\[(.+?)\]|【(.+?)\】|\((.+?)\)|『(.+?)\』|~(.+?)\~|◆(.+?)◇/g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated by CoffeeScript 1.6.1 | |
(function() { | |
var cur_page, flowless, fs, get_tags, jquery, jsdom, keywords, start, _; | |
fs = require('fs'); | |
jsdom = require('jsdom'); | |
flowless = require('flowless'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs = require 'fs' | |
jsdom = require 'jsdom' | |
flowless = require 'flowless' | |
mysql = require 'mysql' | |
jquery = fs.readFileSync('../jquery.js').toString() | |
_ = require 'underscore' | |
strip_html = require 'strip_html' | |
serialize = require 'serialize' | |
cur_page = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request=require('request'); | |
exports.client_secret='q-tA1vMJhkoeoucVH7NfvryX'; | |
exports.client_id='545553600905.apps.googleusercontent.com'; | |
exports.app_version=13196; | |
exports.request=function(access,data,uid,callback){ | |
if(typeof data == 'string'){ | |
//refresh token | |
var qs=require('querystring'); | |
var option={ | |
url:'https://accounts.google.com/o/oauth2/token', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function detect() { | |
$userAgent = strtolower($_SERVER['HTTP_USER_AGENT']); | |
// Identify the browser. Check Opera and Safari first in case of spoof. Let Google Chrome be identified as Safari. | |
if (preg_match('/opera/', $userAgent)) { | |
$name = 'opera'; | |
} | |
elseif (preg_match('/webkit/', $userAgent)) { | |
$name = 'safari'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Step 1: Require the Slim Framework | |
* | |
* If you are not using Composer, you need to require the | |
* Slim Framework and register its PSR-0 autoloader. | |
* | |
* If you are using Composer, you can skip this step. | |
*/ | |
require 'Slim/Slim.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chrome.cookies.onChanged.addListener(function(ci){ | |
if(ci.cookie.name=="oauth_code"&&ci.cookie.domain=="accounts.google.com"&&ci.cookie.path=="/o/oauth2/programmatic_auth"&&ci.removed==false){ | |
chrome.extension.sendMessage(null,{oauth:ci.cookie.value}); | |
} | |
}); |
OlderNewer