| 6 |
import flash.display.NativeWindowType; |
import flash.display.NativeWindowType; |
| 7 |
import flash.display.StageDisplayState; |
import flash.display.StageDisplayState; |
| 8 |
import flash.display.StageQuality; |
import flash.display.StageQuality; |
| 9 |
|
import flash.errors.IOError; |
| 10 |
import flash.events.ErrorEvent; |
import flash.events.ErrorEvent; |
| 11 |
import flash.events.Event; |
import flash.events.Event; |
| 12 |
import flash.events.EventDispatcher; |
import flash.events.EventDispatcher; |
| 35 |
import mx.formatters.NumberFormatter; |
import mx.formatters.NumberFormatter; |
| 36 |
|
|
| 37 |
import org.libspark.utils.ForcibleLoader; |
import org.libspark.utils.ForcibleLoader; |
| 38 |
|
import org.mineap.nicovideo4as.CommentPost; |
| 39 |
import org.mineap.nicovideo4as.MyListLoader; |
import org.mineap.nicovideo4as.MyListLoader; |
| 40 |
import org.mineap.nicovideo4as.WatchVideoPage; |
import org.mineap.nicovideo4as.WatchVideoPage; |
| 41 |
import org.mineap.nicovideo4as.analyzer.GetRelationResultAnalyzer; |
import org.mineap.nicovideo4as.analyzer.GetRelationResultAnalyzer; |
| 3534 |
|
|
| 3535 |
/** |
/** |
| 3536 |
* 引数で指定された文字列とコマンドを使ってニコニコ動画へコメントをポストします。 |
* 引数で指定された文字列とコマンドを使ってニコニコ動画へコメントをポストします。 |
| 3537 |
* @param postMessage |
* @param comment |
| 3538 |
* @param command |
* @param command |
| 3539 |
* |
* |
| 3540 |
*/ |
*/ |
| 3541 |
public function postMessage(postMessage:String, command:String):void{ |
public function postMessage(comment:String, command:String):void{ |
| 3542 |
|
|
| 3543 |
logManager.addLog("***コメント投稿開始***"); |
logManager.addLog("***コメント投稿開始***"); |
| 3544 |
|
|
| 3551 |
} |
} |
| 3552 |
|
|
| 3553 |
if(videoID != null){ |
if(videoID != null){ |
|
// var commentPost:CommentPost = new CommentPost(); |
|
|
// commentPost.postComment(videoID, command, postMessage, commentTimerVpos/10); |
|
| 3554 |
|
|
| 3555 |
var a2n:Access2Nico = new Access2Nico(null, null, this, logManager, null); |
var commentPost:CommentPost = new CommentPost(); |
| 3556 |
a2n.addEventListener(Access2Nico.NICO_POST_COMMENT_COMPLETE, function():void{ |
commentPost.addEventListener(CommentPost.COMMENT_POST_FAIL, function(event:IOErrorEvent):void |
| 3557 |
var post:XML = a2n.getPostComment(); |
{ |
| 3558 |
if(!isStreamingPlay){ |
trace(event); |
| 3559 |
var path:String = PathMaker.createNomalCommentPathByVideoPath(source); |
logManager.addLog("\t\t" + CommentPost.COMMENT_POST_FAIL + ":" + event); |
| 3560 |
(new FileIO(logManager)).addComment(path, post); |
logManager.addLog("コメント投稿失敗"); |
| 3561 |
} |
Alert.show("コメントの投稿に失敗", Message.M_ERROR); |
| 3562 |
commentManager.addPostComment(new NNDDComment(Number(post.attribute("vpos")), String(post.text()), String(post.attribute("mail")), String(post.attribute("user_id")), Number(post.attribute("no")), String(post.attribute("thread")), true)); |
commentPost.close(); |
|
logManager.addLog("***コメント投稿完了***"); |
|
|
|
|
| 3563 |
}); |
}); |
| 3564 |
a2n.addEventListener(Access2Nico.NICO_POST_COMMENT_FAIL, function():void{ |
commentPost.addEventListener(CommentPost.COMMENT_POST_SUCCESS, function():void{ |
| 3565 |
var post:XML = a2n.getPostComment(); |
var post:XML = commentPost.getPostComment(); |
| 3566 |
if(!isStreamingPlay){ |
if(!isStreamingPlay){ |
| 3567 |
var path:String = PathMaker.createNomalCommentPathByVideoPath(source); |
var path:String = PathMaker.createNomalCommentPathByVideoPath(source); |
| 3568 |
(new FileIO(logManager)).addComment(path, post); |
(new FileIO(logManager)).addComment(path, post); |
| 3569 |
} |
} |
| 3570 |
commentManager.addPostComment(new NNDDComment(Number(post.attribute("vpos")), String(post.text()), String(post.attribute("mail")), String(post.attribute("user_id")), Number(post.attribute("no")), String(post.attribute("thread")), true)); |
trace('コメントを投稿:' + videoID); |
| 3571 |
logManager.addLog("***コメント投稿失敗***"); |
logManager.addLog("***コメント投稿完了***"); |
| 3572 |
|
commentPost.close(); |
| 3573 |
}); |
}); |
| 3574 |
a2n.postMessage(Access2Nico.TOP_PAGE_URL, Access2Nico.LOGIN_URL, UserManager.instance.user, UserManager.instance.password, postMessage, command, videoID, commentTimerVpos/10); |
|
| 3575 |
|
// コメントを投稿 |
| 3576 |
|
commentPost.postCommentWithLogin(UserManager.instance.user, UserManager.instance.password, videoID, comment, command, commentTimerVpos/10); |
| 3577 |
|
|
| 3578 |
|
// とりあえずコメントを表示。通し番号をマイナスにして正規のコメントと区別する。 |
| 3579 |
|
commentManager.addPostComment(new NNDDComment(commentTimerVpos/10, comment, command, '', -1, '', true)); |
| 3580 |
|
|
| 3581 |
}else{ |
}else{ |
| 3582 |
//動画IDがついてないのでPostできなかった |
//動画IDがついてないのでPostできなかった |