Skip to content

Instantly share code, notes, and snippets.

@kyubuns
Created November 9, 2015 00:11
Show Gist options
  • Save kyubuns/4a6b0229b3341645b21e to your computer and use it in GitHub Desktop.
Save kyubuns/4a6b0229b3341645b21e to your computer and use it in GitHub Desktop.
// Generated by CoffeeScript 1.10.0
/*:
* @plugindesc ツイートするやつ
* @author kyubuns
*
* @help
*
* Plugin Command:
* Tweet (message)
*
* Example:
* Tweet \V[0001]点を取りました! http://kyubuns.net/
*
* License:
* Copyright (c) 2015 kyubuns
*
* This software is released under the MIT License.
* http://opensource.org/licenses/mit-license.php
*/
(function() {
var _Game_Interpreter_command356;
_Game_Interpreter_command356 = Game_Interpreter.prototype.command356;
Game_Interpreter.prototype.command356 = function() {
if (this._params[0].split(" ")[0] === 'Tweet') {
$gameSystem.tweet(this._params[0]);
}
return _Game_Interpreter_command356.call(this);
};
Game_System.prototype.tweet = function(rawMessage) {
var link, message;
message = Window_Base.prototype.convertEscapeCharacters(rawMessage.slice(6));
link = 'http://twitter.com/home?status=' + encodeURIComponent(message);
window.open(link, '_blank');
return console.log(message);
};
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment