kentaroi-okayu 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. data/.document +5 -0
  2. data/.gitignore +6 -0
  3. data/LICENSE +20 -0
  4. data/README.rdoc +18 -0
  5. data/Rakefile +63 -0
  6. data/VERSION +1 -0
  7. data/bin/okayu +6 -0
  8. data/lib/app.rb +25 -0
  9. data/lib/app_dir.rb +29 -0
  10. data/lib/client.rb +210 -0
  11. data/lib/controllers/listeners_controller.rb +18 -0
  12. data/lib/controllers/live_controller.rb +82 -0
  13. data/lib/controllers/visitors_controller.rb +19 -0
  14. data/lib/controllers.rb +3 -0
  15. data/lib/cookie_thief.rb +172 -0
  16. data/lib/db/migrate/000_create_lives.rb +14 -0
  17. data/lib/db/migrate/001_create_comments.rb +22 -0
  18. data/lib/db/migrate/002_create_visitors.rb +15 -0
  19. data/lib/db/migrate/003_create_listeners.rb +15 -0
  20. data/lib/db/migrate/004_create_communities.rb +13 -0
  21. data/lib/db/migrate/005_create_listeners_lives.rb +12 -0
  22. data/lib/db/migrate/006_create_lives_visitors.rb +13 -0
  23. data/lib/factory.rb +16 -0
  24. data/lib/models/comment.rb +22 -0
  25. data/lib/models/community.rb +3 -0
  26. data/lib/models/listener.rb +5 -0
  27. data/lib/models/live.rb +6 -0
  28. data/lib/models/visitor.rb +5 -0
  29. data/lib/models.rb +23 -0
  30. data/lib/okayu.rb +10 -0
  31. data/lib/player_status.rb +16 -0
  32. data/lib/sample_msg +2 -0
  33. data/lib/thread_info.rb +32 -0
  34. data/lib/user_info.rb +49 -0
  35. data/lib/views/app_frame.rb +89 -0
  36. data/lib/views/color_dialog.rb +56 -0
  37. data/lib/views/colors.rb +168 -0
  38. data/lib/views/live_panel.rb +335 -0
  39. data/lib/views/login_dialog.rb +80 -0
  40. data/lib/views/main_panel.rb +50 -0
  41. data/lib/views.rb +11 -0
  42. data/logged_in_page +893 -0
  43. data/login_error_page +83 -0
  44. data/okayu.gemspec +126 -0
  45. data/tcp_log +0 -0
  46. data/test/client_test.rb +61 -0
  47. data/test/cookie_thief_test.rb +36 -0
  48. data/test/ie_cookie.txt +63 -0
  49. data/test/okayu_test.rb +8 -0
  50. data/test/player_status_test.rb +61 -0
  51. data/test/raw_player_status +2 -0
  52. data/test/raw_player_status_community_only +3 -0
  53. data/test/raw_player_status_notlogged_in +2 -0
  54. data/test/test_helper.rb +11 -0
  55. data/test/thread_info_test.rb +11 -0
  56. metadata +193 -0
data/login_error_page ADDED
@@ -0,0 +1,83 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <meta http-equiv="Content-Script-Type" content="text/javascript">
6
+ <meta http-equiv="Content-Style-Type" content="text/css">
7
+ <meta name="copyright" content="(C) niwango, Inc.">
8
+ <title>ニコニコ動画 ログインフォーム</title>
9
+ <base href="https://secure.nicovideo.jp/secure/">
10
+ <link rel="stylesheet" type="text/css" href="css/login_form.css?090729">
11
+ <script type="text/javascript" src="js/swfobject.js?4"></script>
12
+ </head>
13
+ <body>
14
+
15
+ <table width="928" border="0" cellpadding="4" cellspacing="0" style="margin:0 28px;"><tr><td><a href="http://www.nicovideo.jp/"><img src="img/login_form/logo.png" alt="ニコニコ動画"></a></td></tr></table>
16
+ <div class="mb16p4">
17
+ <!--↓フォーム+広告↓-->
18
+ <p><img alt="" src="img/_.gif" class="main_frm_1"></p>
19
+ <div class="main_bg">
20
+ <table width="912" border="0" cellpadding="0" cellspacing="0"><tr>
21
+ <td width="300" style="text-align:center; padding-right:32px;">
22
+
23
+ <table width="300" border="0" cellpadding="0" cellspacing="0" sumary="" style="color:#333; text-align:center; margin:0 0 8px;"><tr><td>
24
+ <p><img src="img/_.gif" alt="" width="1" height="1" class="login_frm_1"></p>
25
+ <form name="login" id="login" method="post" action="https://secure.nicovideo.jp/secure/login?site=niconico" onsubmit="if (tooAdvancedClock) alert('お使いの PC の時計が進みすぎているため、正常にログインができない場合がございます。');">
26
+ <input type="hidden" name="next_url" value=""><div class="login_input_bg">
27
+ <table border="0" cellspacing="0" cellpadding="4" summary="login" style="text-align:center; margin:0 auto;">
28
+ <tr><td>
29
+ <p style="margin:0 0 2px;"><label for="mail"><img src="img/login_form/txt_mail.png" alt="メールアドレス"></label></p>
30
+ <p><input class="form_input" value="" type="text" name="mail" id="mail"></p>
31
+ </td></tr>
32
+ <tr><td>
33
+ <p style="margin:0 0 2px;"><label for="password"><img src="img/login_form/txt_pass.png" alt="パスワード"></label></p>
34
+ <p><input class="form_input" value="" type="password" name="password" id="password"></p>
35
+ </td></tr>
36
+ <tr><td>
37
+ <p style="margin:0 0 4px;"><input name="login" type="image" id="login_submit" src="img/login_form/btn_login.png" alt="ログイン"></p>
38
+ <!-- ↓エラーメッセージ↓ -->
39
+ <p class="TXT12"><strong style="color:#F30;">ログイン情報が間違っています!</strong></p>
40
+ <!--↑エラーメッセージ↑-->
41
+ <p class="TXT10">※パスワードを忘れた方は <a href="https://secure.nicovideo.jp/secure/remind_pass" style="color:#233;">再発行の手続き</a> へ</p>
42
+ </td></tr>
43
+ </table>
44
+ </div>
45
+ </form>
46
+ <p><img alt="" src="img/_.gif" class="login_frm_2"></p>
47
+ </td></tr></table>
48
+ <script type="text/javascript"><!--
49
+ var tooAdvancedClock = ((Math.ceil(new Date().getTime() / 1000) - 1251880048) > 60*10);
50
+ document.login.mail.focus();
51
+ --></script><p class="TXT12" style="margin:0 0 2px;">はじめての方は <strong>新規登録</strong> へお進みください</p>
52
+ <p><a href="https://secure.nicovideo.jp/secure/register"><img src="img/login_form/btn_register.png" alt="アカウント新規登録"></a></p>
53
+
54
+ </td>
55
+ <td>
56
+ <div id="web_pc_login" style="width:576px; height:324px; border:solid 2px #FFF;"></div>
57
+ </td>
58
+ </tr></table>
59
+ </div>
60
+ <p><img alt="© niwango, inc." src="img/_.gif" class="main_frm_2"></p>
61
+ <!--↑フォーム+広告↑-->
62
+ </div>
63
+
64
+ <script type="text/javascript"><!--
65
+
66
+ function showAd(ad) {
67
+ if (!ad || !ad.data || !ad.data.web_pc_login || !ad.data.web_pc_login[0]) return;
68
+ var html, data = ad.data.web_pc_login[0];
69
+ if (data.type == "swf" && typeof SWFObject != "undefined") {
70
+ var so = new SWFObject(data.image, "ads_" + data.code, "100%", "100%");
71
+ if (data.url) so.addVariable("clickTAG", data.url);
72
+ html = so.getSWFHTML();
73
+ delete so;
74
+ } else {
75
+ html = '<img src="' + data.image + '">';
76
+ if (data.url) html = '<a href="' + data.url + '" target="_blank">' + html + '</a>';
77
+ }
78
+ document.getElementById("web_pc_login").innerHTML = html;
79
+ }
80
+
81
+ //--></script><script type="text/javascript" src="https://ad.nicovideo.jp/server/get?callback=showAd&amp;carrier=5&amp;format=json&amp;location=web_pc_login&amp;_=1251880048" defer></script>
82
+ </body>
83
+ </html>
data/okayu.gemspec ADDED
@@ -0,0 +1,126 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{okayu}
8
+ s.version = "0.0.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Kentaro Imai"]
12
+ s.date = %q{2009-09-18}
13
+ s.default_executable = %q{okayu}
14
+ s.description = %q{A comment viewer for http://live.nicovideo.jp/}
15
+ s.email = %q{kentaroi@gmail.com}
16
+ s.executables = ["okayu"]
17
+ s.extra_rdoc_files = [
18
+ "LICENSE",
19
+ "README.rdoc"
20
+ ]
21
+ s.files = [
22
+ ".document",
23
+ ".gitignore",
24
+ "LICENSE",
25
+ "README.rdoc",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "bin/okayu",
29
+ "lib/app.rb",
30
+ "lib/app_dir.rb",
31
+ "lib/client.rb",
32
+ "lib/controllers.rb",
33
+ "lib/controllers/listeners_controller.rb",
34
+ "lib/controllers/live_controller.rb",
35
+ "lib/controllers/visitors_controller.rb",
36
+ "lib/cookie_thief.rb",
37
+ "lib/db/migrate/000_create_lives.rb",
38
+ "lib/db/migrate/001_create_comments.rb",
39
+ "lib/db/migrate/002_create_visitors.rb",
40
+ "lib/db/migrate/003_create_listeners.rb",
41
+ "lib/db/migrate/004_create_communities.rb",
42
+ "lib/db/migrate/005_create_listeners_lives.rb",
43
+ "lib/db/migrate/006_create_lives_visitors.rb",
44
+ "lib/factory.rb",
45
+ "lib/models.rb",
46
+ "lib/models/comment.rb",
47
+ "lib/models/community.rb",
48
+ "lib/models/listener.rb",
49
+ "lib/models/live.rb",
50
+ "lib/models/visitor.rb",
51
+ "lib/okayu.rb",
52
+ "lib/player_status.rb",
53
+ "lib/sample_msg",
54
+ "lib/thread_info.rb",
55
+ "lib/user_info.rb",
56
+ "lib/views.rb",
57
+ "lib/views/app_frame.rb",
58
+ "lib/views/color_dialog.rb",
59
+ "lib/views/colors.rb",
60
+ "lib/views/live_panel.rb",
61
+ "lib/views/login_dialog.rb",
62
+ "lib/views/main_panel.rb",
63
+ "logged_in_page",
64
+ "login_error_page",
65
+ "okayu.gemspec",
66
+ "tcp_log",
67
+ "test/client_test.rb",
68
+ "test/cookie_thief_test.rb",
69
+ "test/ie_cookie.txt",
70
+ "test/okayu_test.rb",
71
+ "test/player_status_test.rb",
72
+ "test/raw_player_status",
73
+ "test/raw_player_status_community_only",
74
+ "test/raw_player_status_notlogged_in",
75
+ "test/test_helper.rb",
76
+ "test/thread_info_test.rb"
77
+ ]
78
+ s.has_rdoc = true
79
+ s.homepage = %q{http://github.com/kentaroi/okayu}
80
+ s.rdoc_options = ["--charset=UTF-8"]
81
+ s.require_paths = ["lib"]
82
+ s.rubygems_version = %q{1.3.1}
83
+ s.summary = %q{A comment viewer for http://live.nicovideo.jp/}
84
+ s.test_files = [
85
+ "test/test_helper.rb",
86
+ "test/thread_info_test.rb",
87
+ "test/cookie_thief_test.rb",
88
+ "test/client_test.rb",
89
+ "test/player_status_test.rb",
90
+ "test/okayu_test.rb"
91
+ ]
92
+
93
+ if s.respond_to? :specification_version then
94
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
95
+ s.specification_version = 2
96
+
97
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
98
+ s.add_runtime_dependency(%q<mechanize>, [">= 0"])
99
+ s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
100
+ s.add_runtime_dependency(%q<facter>, [">= 0"])
101
+ s.add_runtime_dependency(%q<sqlite3-ruby>, [">= 0"])
102
+ s.add_runtime_dependency(%q<activerecord>, [">= 2.2.0"])
103
+ s.add_runtime_dependency(%q<wxruby>, [">= 0"])
104
+ s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
105
+ s.add_development_dependency(%q<redgreen>, [">= 0"])
106
+ else
107
+ s.add_dependency(%q<mechanize>, [">= 0"])
108
+ s.add_dependency(%q<nokogiri>, [">= 0"])
109
+ s.add_dependency(%q<facter>, [">= 0"])
110
+ s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
111
+ s.add_dependency(%q<activerecord>, [">= 2.2.0"])
112
+ s.add_dependency(%q<wxruby>, [">= 0"])
113
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
114
+ s.add_dependency(%q<redgreen>, [">= 0"])
115
+ end
116
+ else
117
+ s.add_dependency(%q<mechanize>, [">= 0"])
118
+ s.add_dependency(%q<nokogiri>, [">= 0"])
119
+ s.add_dependency(%q<facter>, [">= 0"])
120
+ s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
121
+ s.add_dependency(%q<activerecord>, [">= 2.2.0"])
122
+ s.add_dependency(%q<wxruby>, [">= 0"])
123
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
124
+ s.add_dependency(%q<redgreen>, [">= 0"])
125
+ end
126
+ end
data/tcp_log ADDED
Binary file
@@ -0,0 +1,61 @@
1
+ require 'test_helper'
2
+ require 'client.rb'
3
+
4
+ module Okayu
5
+ class ClientTest < Test::Unit::TestCase
6
+
7
+ context "With mail and password, Client" do
8
+ setup do
9
+ id_pass_file = "#{File.dirname(File.expand_path(__FILE__))}/id_pass.txt"
10
+ mail = ''
11
+ password = ''
12
+ if File.exist?(id_pass_file)
13
+ File.open id_pass_file, 'r' do |f|
14
+ mail = f.readline.chomp
15
+ password = f.readline.chomp
16
+ end
17
+ Client.connect :mail => mail, :password => password
18
+ end
19
+ until Client.connected?
20
+ print 'INPUT mail: '
21
+ mail = gets().chomp
22
+ print 'INPUT password: '
23
+ password = gets().chomp
24
+
25
+ Client.connect :mail => mail, :password => password
26
+
27
+ File.open id_pass_file, 'w' do |f|
28
+ f.puts mail
29
+ f.puts password
30
+ end
31
+ end
32
+ end
33
+
34
+ should "login correctly" do
35
+ assert Client.connected?
36
+ end
37
+
38
+ should 'convert url to live id' do
39
+ url = 'http://live.nicovideo.jp/watch/lv3585528'
40
+ live_id = 'lv3585528'
41
+ assert_equal live_id, Client.live_id_from_url(url)
42
+ end
43
+
44
+ should 'return live_id even if live_id_from_url was passed live_id instead of url' do
45
+ url = 'lv3585528'
46
+ live_id = 'lv3585528'
47
+ assert_equal live_id, Client.live_id_from_url(url)
48
+ end
49
+
50
+ should "get player status" do
51
+ puts "input live id or url:"
52
+ live_id = gets()
53
+ if live_id.chomp != ''
54
+ assert Client.open( live_id )
55
+ else
56
+ assert true
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,36 @@
1
+ require 'test_helper'
2
+ require 'cookie_thief.rb'
3
+
4
+ module Okayu
5
+ class CookieThiefTest < Test::Unit::TestCase
6
+
7
+ context "FirefoxCookieThief " do
8
+ should 'create sql correctly' do
9
+ assert_equal "select host, isHttpOnly, path, isSecure, expiry, name, value from moz_cookies where host = 'nicovideo.jp' and name = 'user_session';", FirefoxCookieThief.sql_from_hash(:host => 'nicovideo.jp', :name => 'user_session')
10
+ end
11
+
12
+ should "get cookie" do
13
+ assert FirefoxCookieThief.get :host => 'nicovideo.jp', :name => 'user_session'
14
+ end
15
+ end
16
+
17
+ context "IECookieThief " do
18
+ setup do
19
+ File.open("#{File.dirname(File.expand_path(__FILE__))}/ie_cookie.txt") do |f|
20
+ @cookies_str = f.read
21
+ end
22
+ end
23
+
24
+ should "get right number of cookies from cookies string" do
25
+ cookies = IECookieThief.cookies_from_cookies_string @cookies_str
26
+ assert_equal 7, cookies.length
27
+ end
28
+
29
+ should "get right cookie from cookies, selected by name" do
30
+ cookies = IECookieThief.cookies_from_cookies_string @cookies_str
31
+ assert_equal 1, IECookieThief.select_by_name(cookies, 'user_session').length
32
+ puts cookies.last
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,63 @@
1
+ __utma
2
+ 8292653.872898213.1218424930.1250285941.1253184412.924
3
+ nicovideo.jp/
4
+ 1600
5
+ 2350186496
6
+ 32111674
7
+ 707688800
8
+ 30029700
9
+ *
10
+ desopen
11
+ 1
12
+ nicovideo.jp/
13
+ 1600
14
+ 3672445824
15
+ 30036156
16
+ 1651594624
17
+ 29962731
18
+ *
19
+ col
20
+ 2
21
+ nicovideo.jp/
22
+ 1600
23
+ 647270272
24
+ 30041043
25
+ 2922356368
26
+ 29967617
27
+ *
28
+ srch
29
+ s
30
+ nicovideo.jp/
31
+ 1600
32
+ 3618453376
33
+ 30073644
34
+ 1600542176
35
+ 30000219
36
+ *
37
+ __utmz
38
+ 8292653.1250285738.922.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none)
39
+ nicovideo.jp/
40
+ 1600
41
+ 3866218752
42
+ 30059663
43
+ 709069504
44
+ 30022951
45
+ *
46
+ __utmb
47
+ 8292653
48
+ nicovideo.jp/
49
+ 1600
50
+ 1761439616
51
+ 30029704
52
+ 943158800
53
+ 30029700
54
+ *
55
+ user_session
56
+ user_session_11973863_1270889571885674991
57
+ nicovideo.jp/
58
+ 1536
59
+ 943677440
60
+ 30035735
61
+ 941798800
62
+ 30029700
63
+ *
@@ -0,0 +1,8 @@
1
+ require 'test_helper'
2
+
3
+ class OkayuTest < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ # flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ assert true
7
+ end
8
+ end
@@ -0,0 +1,61 @@
1
+ require 'test_helper'
2
+ require 'shoulda'
3
+ # require 'player_status.rb'
4
+
5
+ $raw_player_status = <<END_OF_STRING
6
+ <?xml version="1.0" encoding="utf-8"?>
7
+ <getplayerstatus status="ok" time="1251874144"><stream><id>lv3613765</id><watch_count>2</watch_count><comment_count>1</comment_count><danjo_comment_mode>0</danjo_comment_mode><relay_comment>0</relay_comment><bourbon_url/><full_video/><after_video/><before_video/><kickout_video/><ichiba_notice_enable>0</ichiba_notice_enable><comment_lock>0</comment_lock><background_comment>0</background_comment><provider_type>community</provider_type><default_community>co40602</default_community><telop><enable>0</enable></telop><base_time>1251874017</base_time><open_time>1251874017</open_time><start_time>1251874017</start_time><contents_list><contents id="main" disableAudio="0" disableVideo="0" start_time="1251874019">rtmp:liverepeater:rtmp://nlpoca07.live.nicovideo.jp:1935/publicorigin/lv3613765</contents></contents_list></stream><user><room_label>co40602</room_label><room_seetno>1</room_seetno><userAge>33</userAge><userSex>1</userSex><userPrefecture>13</userPrefecture><nickname>robot</nickname><is_premium>0</is_premium><user_id>11973863</user_id><is_join></is_join></user><rtmp><url>rtmp://nleza10.live.nicovideo.jp:1935/liveedge</url><ticket>11973863:lv3613765:0:1251874144:e57dfd2535613a1a</ticket></rtmp><ms><addr>msg101.live.nicovideo.jp</addr><port>2810</port><thread>1004433759</thread></ms></getplayerstatus>
8
+ END_OF_STRING
9
+
10
+ $raw_player_status_not_logged_in = <<END_OF_STRING
11
+ <?xml version="1.0" encoding="utf-8"?>
12
+ <getplayerstatus status="fail" time="1251881319"><error><code>notfound</code></error></getplayerstatus>
13
+ END_OF_STRING
14
+
15
+ module Okayu
16
+ class PlayerStatusTest < Test::Unit::TestCase
17
+ context "When not logged in, PlayerStatus" do
18
+ setup do
19
+ @player_status = PlayerStatus.new $raw_player_status_not_logged_in
20
+ end
21
+ should "status false" do
22
+ assert !@player_status.status
23
+ end
24
+ end
25
+
26
+ context "When logged in correctly, PlayerStatus" do
27
+ setup do
28
+ @player_status = PlayerStatus.new $raw_player_status
29
+ end
30
+
31
+ should "status true" do
32
+ assert @player_status.status
33
+ end
34
+
35
+ should "get addr" do
36
+ assert_equal 'msg101.live.nicovideo.jp', @player_status.addr
37
+ end
38
+
39
+ should "get port" do
40
+ assert_equal '2810', @player_status.port
41
+ end
42
+
43
+ should "get thread" do
44
+ assert_equal '1004433759', @player_status.thread
45
+ end
46
+
47
+ should "get room_label" do
48
+ assert_equal 'co40602', @player_status.room_label
49
+ end
50
+
51
+ should "get room_seetno" do
52
+ assert_equal '1', @player_status.room_seetno
53
+ end
54
+
55
+ should "get community" do
56
+ assert_equal 'co40602', @player_status.default_community
57
+ end
58
+ end
59
+
60
+ end
61
+ end
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <getplayerstatus status="ok" time="1251874144"><stream><id>lv3613765</id><watch_count>2</watch_count><comment_count>1</comment_count><danjo_comment_mode>0</danjo_comment_mode><relay_comment>0</relay_comment><bourbon_url/><full_video/><after_video/><before_video/><kickout_video/><ichiba_notice_enable>0</ichiba_notice_enable><comment_lock>0</comment_lock><background_comment>0</background_comment><provider_type>community</provider_type><default_community>co40602</default_community><telop><enable>0</enable></telop><base_time>1251874017</base_time><open_time>1251874017</open_time><start_time>1251874017</start_time><contents_list><contents id="main" disableAudio="0" disableVideo="0" start_time="1251874019">rtmp:liverepeater:rtmp://nlpoca07.live.nicovideo.jp:1935/publicorigin/lv3613765</contents></contents_list></stream><user><room_label>co40602</room_label><room_seetno>1</room_seetno><userAge>33</userAge><userSex>1</userSex><userPrefecture>13</userPrefecture><nickname>robot</nickname><is_premium>0</is_premium><user_id>11973863</user_id><is_join></is_join></user><rtmp><url>rtmp://nleza10.live.nicovideo.jp:1935/liveedge</url><ticket>11973863:lv3613765:0:1251874144:e57dfd2535613a1a</ticket></rtmp><ms><addr>msg101.live.nicovideo.jp</addr><port>2810</port><thread>1004433759</thread></ms></getplayerstatus>
@@ -0,0 +1,3 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <getplayerstatus status="fail" time="1252847465"><error><code>require_community_member</code></error></getplayerstatus>
3
+
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <getplayerstatus status="fail" time="1251881319"><error><code>notfound</code></error></getplayerstatus>
@@ -0,0 +1,11 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+ require 'redgreen'
5
+
6
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
7
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
8
+ require 'okayu'
9
+
10
+ class Test::Unit::TestCase
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'test_helper'
2
+ require 'shoulda'
3
+
4
+ module Okayu
5
+ class PlayerStatusTest < Test::Unit::TestCase
6
+ context "When not logged in, PlayerStatus" do
7
+ setup do
8
+ end
9
+ end
10
+ end
11
+ end
metadata ADDED
@@ -0,0 +1,193 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: kentaroi-okayu
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Kentaro Imai
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-09-18 00:00:00 -07:00
13
+ default_executable: okayu
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: mechanize
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: nokogiri
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: facter
37
+ type: :runtime
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: "0"
44
+ version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: sqlite3-ruby
47
+ type: :runtime
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: "0"
54
+ version:
55
+ - !ruby/object:Gem::Dependency
56
+ name: activerecord
57
+ type: :runtime
58
+ version_requirement:
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: 2.2.0
64
+ version:
65
+ - !ruby/object:Gem::Dependency
66
+ name: wxruby
67
+ type: :runtime
68
+ version_requirement:
69
+ version_requirements: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: "0"
74
+ version:
75
+ - !ruby/object:Gem::Dependency
76
+ name: thoughtbot-shoulda
77
+ type: :development
78
+ version_requirement:
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: "0"
84
+ version:
85
+ - !ruby/object:Gem::Dependency
86
+ name: redgreen
87
+ type: :development
88
+ version_requirement:
89
+ version_requirements: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: "0"
94
+ version:
95
+ description: A comment viewer for http://live.nicovideo.jp/
96
+ email: kentaroi@gmail.com
97
+ executables:
98
+ - okayu
99
+ extensions: []
100
+
101
+ extra_rdoc_files:
102
+ - LICENSE
103
+ - README.rdoc
104
+ files:
105
+ - .document
106
+ - .gitignore
107
+ - LICENSE
108
+ - README.rdoc
109
+ - Rakefile
110
+ - VERSION
111
+ - bin/okayu
112
+ - lib/app.rb
113
+ - lib/app_dir.rb
114
+ - lib/client.rb
115
+ - lib/controllers.rb
116
+ - lib/controllers/listeners_controller.rb
117
+ - lib/controllers/live_controller.rb
118
+ - lib/controllers/visitors_controller.rb
119
+ - lib/cookie_thief.rb
120
+ - lib/db/migrate/000_create_lives.rb
121
+ - lib/db/migrate/001_create_comments.rb
122
+ - lib/db/migrate/002_create_visitors.rb
123
+ - lib/db/migrate/003_create_listeners.rb
124
+ - lib/db/migrate/004_create_communities.rb
125
+ - lib/db/migrate/005_create_listeners_lives.rb
126
+ - lib/db/migrate/006_create_lives_visitors.rb
127
+ - lib/factory.rb
128
+ - lib/models.rb
129
+ - lib/models/comment.rb
130
+ - lib/models/community.rb
131
+ - lib/models/listener.rb
132
+ - lib/models/live.rb
133
+ - lib/models/visitor.rb
134
+ - lib/okayu.rb
135
+ - lib/player_status.rb
136
+ - lib/sample_msg
137
+ - lib/thread_info.rb
138
+ - lib/user_info.rb
139
+ - lib/views.rb
140
+ - lib/views/app_frame.rb
141
+ - lib/views/color_dialog.rb
142
+ - lib/views/colors.rb
143
+ - lib/views/live_panel.rb
144
+ - lib/views/login_dialog.rb
145
+ - lib/views/main_panel.rb
146
+ - logged_in_page
147
+ - login_error_page
148
+ - okayu.gemspec
149
+ - tcp_log
150
+ - test/client_test.rb
151
+ - test/cookie_thief_test.rb
152
+ - test/ie_cookie.txt
153
+ - test/okayu_test.rb
154
+ - test/player_status_test.rb
155
+ - test/raw_player_status
156
+ - test/raw_player_status_community_only
157
+ - test/raw_player_status_notlogged_in
158
+ - test/test_helper.rb
159
+ - test/thread_info_test.rb
160
+ has_rdoc: true
161
+ homepage: http://github.com/kentaroi/okayu
162
+ licenses:
163
+ post_install_message:
164
+ rdoc_options:
165
+ - --charset=UTF-8
166
+ require_paths:
167
+ - lib
168
+ required_ruby_version: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: "0"
173
+ version:
174
+ required_rubygems_version: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - ">="
177
+ - !ruby/object:Gem::Version
178
+ version: "0"
179
+ version:
180
+ requirements: []
181
+
182
+ rubyforge_project:
183
+ rubygems_version: 1.3.5
184
+ signing_key:
185
+ specification_version: 2
186
+ summary: A comment viewer for http://live.nicovideo.jp/
187
+ test_files:
188
+ - test/test_helper.rb
189
+ - test/thread_info_test.rb
190
+ - test/cookie_thief_test.rb
191
+ - test/client_test.rb
192
+ - test/player_status_test.rb
193
+ - test/okayu_test.rb