divshare 0.1.0

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.
@@ -0,0 +1,294 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
5
+
6
+ <meta name="description" content="DivShare is a free file hosting service for everyone. No registration required!" />
7
+ <meta name="keywords" content="CHROMIUM_2.mpg, free file host, free file hosting, free file sharing, flash mp3 player, photo sharing, photo galleries, image galleries, file host, file sharing, image host, image sharing, upload, free, DivShare" />
8
+
9
+ <title>CHROMIUM_2.mpg - DivShare</title>
10
+
11
+ <link href="http://www.divshare.com/styles/v2/global.css" rel="stylesheet" /><link href="/styles/v2/download.css" rel="stylesheet" /><script language="javascript" src="/scripts/prototype-1_4.js"></script><script language="javascript" src="/scripts/prototype.js"></script><script src="/scripts/scriptaculous/scriptaculous.js?load=effects" type="text/javascript"></script><script language="javascript" src="/scripts/global.js"></script><script language="javascript" type="text/javascript" src="/scripts/download.js"></script><script language="javascript" type="text/javascript" src="/scripts/swfobject.js"></script>
12
+
13
+
14
+
15
+ </head>
16
+
17
+ <body>
18
+ <address>Bogus</address>
19
+
20
+ <center>
21
+
22
+ <div id="header">
23
+ <div class="wrapper">
24
+
25
+
26
+ <table cellspacing="0" border="0" cellpadding="0" width="100%">
27
+ <tr>
28
+
29
+ <td rowspan="2" width="190"><a href="http://www.divshare.com/"><img title="DivShare" class="logo" src="http://www.divshare.com/images/v2/logo.png" border="0" alt="DivShare" /></a></td>
30
+ <td valign="middle" align="right">
31
+
32
+ </td>
33
+ </tr>
34
+ <tr>
35
+ <td class="tabs">
36
+ <ul>
37
+ <!-- NOTE: These appear in reverse order! -->
38
+
39
+
40
+
41
+
42
+ <li><a href="http://www.divshare.com/" style="border:none;">home</a></li>
43
+
44
+ <li><a href="http://www.divshare.com/page/about">about us</a></li>
45
+
46
+ <li><a href="http://www.divshare.com/signup">sign up</a></li>
47
+
48
+
49
+ <li><a href="http://www.divshare.com/login">log in</a></li>
50
+
51
+
52
+
53
+
54
+ </ul>
55
+ </td>
56
+
57
+ </tr>
58
+ </table>
59
+
60
+
61
+ </div><!--wrapper-->
62
+ </div><!--header-->
63
+
64
+ <div class="wrapper">
65
+
66
+
67
+
68
+ <script language="javascript" type="text/javascript">
69
+
70
+ function updateInfo(){ return "updated"; }
71
+ //
72
+ </script>
73
+
74
+
75
+
76
+
77
+
78
+ <div style="margin:5px 0 20px 0; text-align:center;">
79
+ <script type="text/javascript">
80
+ google_ad_client = "pub-8392263506318316";
81
+ google_ad_width = 728;
82
+ google_ad_height = 90;
83
+ google_ad_format = "728x90_as";
84
+ google_ad_type = "text_image";
85
+ //2007-09-10: DivShare
86
+ google_ad_channel = "4464379279";
87
+ google_color_border = "FFFFFF";
88
+ google_color_bg = "FFFFFF";
89
+ google_color_link = "0033CC";
90
+ google_color_text = "7F7F7F";
91
+ google_color_url = "008000";
92
+ //
93
+ </script>
94
+ <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
95
+ </script> </div>
96
+
97
+ <!-- MAIN -->
98
+
99
+
100
+ <div style="margin-bottom:10px;">
101
+
102
+
103
+ <h2 class="above" style="border:none; padding-bottom:0; margin-bottom:5px;">
104
+ CHROMIUM_2.mpg
105
+ </h2>
106
+
107
+ <table cellspacing="0" border="0" cellpadding="0" width="100%">
108
+ <tr>
109
+ <td class="video_td" valign="top">
110
+
111
+
112
+ <object id="fullscreen" height="455" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,18,0" width="560">
113
+
114
+ <param name="movie" value="http://www.divshare.com/flash/video?myId=2173654-e71&autoplay=true" />
115
+
116
+ <param name="allowFullScreen" value="true" />
117
+
118
+ <param name="allowScriptAccess" value="always" />
119
+
120
+ <embed name="fullscreen" src="http://www.divshare.com/flash/video?myId=2173654-e71&autoplay=true" allowfullscreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowscriptaccess="always" height="455" width="560"></embed>
121
+ </object>
122
+
123
+
124
+
125
+ <div style="padding-top:5px;"></div>
126
+
127
+ <center>
128
+ <div style="text-align:left; margin:5px 25px 10px 25px;">
129
+
130
+ <div class="icon_container" style="background:url('/images/icons/folder.gif') no-repeat top left;">
131
+ <h3>Films <small class="gray unbold">&mdash; 4 files</small></h3>
132
+
133
+ <table cellspacing="0" border="0" cellpadding="0">
134
+
135
+ <tr><td><div class="folder_file_list" style="background:url('/images/icons/files_16/file_video.gif') no-repeat left center;"><a href="/download/2173631-31a" title="midnight_outtake.mov">midnight_outtake.mov</a></div></td><td><div class="folder_file_list" style="background:url('/images/icons/files_16/file_video.gif') no-repeat left center;"><a href="/download/2173648-fdc" title="CHROMIUM_2.mov">CHROMIUM_2.mov</a></div></td></tr><tr><td><div class="folder_file_list" style="background:url('/images/icons/files_16/file_video.gif') no-repeat left center;"><a href="/download/2173654-e71" title="CHROMIUM_2.mpg">CHROMIUM_2.mpg</a></div></td><td><div class="folder_file_list" style="background:url('/images/icons/files_16/file_generic.gif') no-repeat left center;"><a href="/download/2173748-fab" title="CH1.mp4">CH1.mp4</a></div></td></tr>
136
+
137
+ </table>
138
+
139
+ </div>
140
+
141
+ </div>
142
+ </center>
143
+
144
+
145
+
146
+ </td>
147
+ <td class="sider_td" valign="top">
148
+
149
+
150
+ <div style="line-height:13pt;">
151
+
152
+ &raquo; Downloads: 74 <br />
153
+
154
+ &raquo; Last DL: Oct. 1, 2007<br />
155
+
156
+ &raquo; Uploaded: Sep. 30, 2007<br />
157
+
158
+ &raquo; File Size: 2.35 <span class="tiny">MB</span><br />
159
+
160
+
161
+ </div>
162
+
163
+
164
+ <div style="margin-top:8px; padding-top:10px; border-top:1px dotted #ccc;">
165
+
166
+ <span class="icon_span" style="background-image:url('/images/icons/files_16/file_video.gif'); padding-top:4px; padding-bottom:4px; font-size:8pt;">
167
+
168
+ <a href="http://s08.divshare.com/launch.php?f=2173654&s=e71" class="action" title="Download Original">Download Original</a>
169
+
170
+ </span>
171
+
172
+ </div>
173
+
174
+ <div class="sider_divider">
175
+
176
+ <table cellspacing="0" border="0" cellpadding="0">
177
+
178
+ <tr>
179
+
180
+ <td style="padding-bottom:5px;"><strong>Embed:</strong></td>
181
+
182
+ <td style="padding:0 0 5px 5px;"><input class="center_sharing_text_field" type="text" value="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,18,0\" width=\"425\" height=\"374\" id=\"divflv\"><param name=\"movie\" value=\"http://www.divshare.com/flash/video?myId=2173654-e71\" /><param name=\"allowFullScreen\" value=\"true\" /><embed src=\"http://www.divshare.com/flash/video?myId=2173654-e71\" width=\"425\" height=\"374\" name=\"divflv\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed></object>" onclick="this.select();" style="width:118px;" /></td>
183
+
184
+ </tr>
185
+
186
+
187
+
188
+ <tr>
189
+
190
+ <td style="padding-bottom:5px;"><strong>Forum:</strong></td>
191
+
192
+ <td style="padding:0 0 5px 5px;"><input class="center_sharing_text_field" type="text" value="[url=http://www.divshare.com/download/2173654-e71]DivShare File - CHROMIUM_2.mpg[/url]" onclick="this.select();" style="width:118px;" /></td>
193
+
194
+ </tr>
195
+
196
+ <tr>
197
+
198
+ <td><strong>Link:</strong></td>
199
+
200
+ <td style="padding-left:5px;"><input class="center_sharing_text_field" type="text" value="http://www.divshare.com/download/2173654-e71" onclick="this.select();" style="width:118px;" /></td>
201
+
202
+ </tr>
203
+
204
+ </table>
205
+
206
+
207
+ </div>
208
+
209
+ <div class="sider_divider">
210
+
211
+ <table cellspacing="0" border="0" cellpadding="0">
212
+ <tr>
213
+ <td><strong>Post To:</strong></td>
214
+ <td class="post_icon"><a href="javascript:myspace_popup('http://www.divshare.com/scripts/social/post_to_myspace.php?f=2173654&s=e71');"><img title="MySpace" src="/images/icons/myspace_16.gif" border="0" alt="MySpace" /></a></td>
215
+ <td class="post_icon"><a href="javascript:fb_popup('http://www.facebook.com/sharer.php?u=http://www.divshare.com/download/2173654-e71');"><img title="Facebook" src="/images/icons/facebook_16.gif" border="0" alt="Facebook" /></a></td>
216
+ <td class="post_icon"><a href="http://del.icio.us/post" onclick="window.open('http://del.icio.us/post?v=4&noui&jump=close&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=700,height=400'); return false;"><img title="del.icio.us" src="/images/icons/delicious_16.gif" border="0" alt="del.icio.us" /></a></td>
217
+ </tr>
218
+ </table>
219
+
220
+ </div>
221
+
222
+ <div class="sider_divider flag_text">
223
+
224
+ Inappropriate content? Report this file to <a href="/page/support">DivShare Support</a>.
225
+ </div>
226
+
227
+
228
+ <div class="sider_divider" style="line-height:12pt;">
229
+
230
+
231
+ Your logo, your Flash player.
232
+
233
+ <div style="margin-top:1ex;">
234
+
235
+ Take control of your Flash video with <strong><a href="/direct">DivShare Direct</a></strong>.</div>
236
+
237
+
238
+ </div>
239
+
240
+ </td>
241
+ </tr>
242
+ </table>
243
+
244
+
245
+ <div class="sider_divider" style="margin-top:5px; padding-top:15px; text-align:center; font-size:9pt;">
246
+ <script type="text/javascript">
247
+ google_ad_client = "pub-8392263506318316";
248
+ google_ad_width = 336;
249
+ google_ad_height = 280;
250
+ google_ad_format = "336x280_as";
251
+ google_ad_type = "text_image";
252
+ //2007-09-10: DivShare
253
+ google_ad_channel = "4464379279";
254
+ google_color_border = "FFFFFF";
255
+ google_color_bg = "FFFFFF";
256
+ google_color_link = "0033CC";
257
+ google_color_text = "7F7F7F";
258
+ google_color_url = "008000";
259
+ //
260
+ </script>
261
+ <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
262
+ </script> </div>
263
+
264
+ </div>
265
+
266
+
267
+
268
+
269
+
270
+
271
+ </div><!--wrapper-->
272
+
273
+ <div class="buffer"></div>
274
+
275
+ <div id="footer">
276
+
277
+ <a href="http://www.divshare.com/page/about">about us</a> | <a href="http://www.divshare.com/page/support">support</a> | <a href="http://blog.divshare.com">blog</a> | <a href="http://www.divshare.com/integrate">integrate</a> | <a href="http://www.divshare.com/page/terms">terms of use</a> | <a href="http://www.divshare.com/page/privacy">privacy policy</a> | <a href="http://www.divshare.com/direct">divshare direct</a> | <a href="http://www.divshare.com/page/enterprise">enterprise</a>
278
+ <div class="copyright">
279
+ Copyright 2007 DivShare Corporation. All Rights Reserved.
280
+ </div>
281
+
282
+ </div>
283
+
284
+ </center>
285
+
286
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
287
+ </script>
288
+ <script type="text/javascript">
289
+ _uacct = "UA-1051809-1";
290
+ urchinTracker();
291
+ </script>
292
+
293
+ </body>
294
+ </html>
@@ -0,0 +1,54 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+ require 'divshare/client'
3
+ require 'divshare/post_args'
4
+ include Divshare
5
+
6
+ module PostArgsSpecHelper
7
+ def basic_args(to_merge={})
8
+ {'api_key' => 'api_key', "api_sig" => 'api_sig', "api_session_key" => 'api_session_key'}.merge(to_merge)
9
+ end
10
+
11
+ def login_args(to_merge={})
12
+ strip_key_and_sig(to_merge).merge({'method' => 'login'})
13
+ end
14
+
15
+ def logout_args(to_merge={})
16
+ strip_key_and_sig(to_merge).merge({'method' => 'logout'})
17
+ end
18
+
19
+ def strip_key_and_sig(to_merge={})
20
+ basic_args(to_merge).reject { |k,v| %w(api_session_key api_sig).include? k }
21
+ end
22
+ end
23
+
24
+ describe "A PostArgs" do
25
+ include PostArgsSpecHelper
26
+ before(:each) do
27
+ @client = mock('client')
28
+ @client.should_receive(:api_key).and_return('api_key')
29
+ @login = {'user_email' => 'email', 'user_password' => 'password'}
30
+ end
31
+
32
+ it "should generate appropriate arguments for login" do
33
+ @client.should_receive(:api_session_key).and_return(nil)
34
+ PostArgs.new(@client,'login',@login).should == login_args(@login)
35
+ end
36
+
37
+ it "should generate appropriate arguments for logout" do
38
+ @client.should_receive(:api_session_key).twice.and_return('api_session_key')
39
+ @client.should_receive(:sign).and_return('api_sig')
40
+ PostArgs.new(@client,:logout,{}).should == basic_args({'method' => 'logout'})
41
+ end
42
+
43
+ it "should convert symbol keys to strings" do
44
+ @client.should_receive(:api_session_key).and_return(nil)
45
+ symbol_keys = {}
46
+ @login.each { |k,v| symbol_keys[k.to_sym] = v }
47
+ PostArgs.new(@client,'login',symbol_keys).should == login_args(@login)
48
+ end
49
+
50
+ it "should convert symbol values to strings" do
51
+ @client.should_receive(:api_session_key).and_return(nil)
52
+ PostArgs.new(@client,:login,@login).should == login_args(@login)
53
+ end
54
+ end
@@ -0,0 +1,153 @@
1
+ lib_path = File.join(File.dirname(__FILE__), '..', 'lib')
2
+ $:.unshift(lib_path) unless $:.include?(lib_path)
3
+
4
+ # From http://www.divshare.com/integrate/api
5
+ module DivshareMockXML
6
+ def get_user_info_xml
7
+ <<-EOS
8
+ <?xml version="1.0" encoding="UTF-8"?>
9
+ <response status="1">
10
+ <user_info>
11
+ <user_fname>Rob</user_fname>
12
+ <user_email>support@divshare.com</user_email>
13
+ </user_info>
14
+ </response>
15
+ EOS
16
+ end
17
+
18
+ def get_one_file_xml
19
+ <<-EOS
20
+ <?xml version="1.0" encoding="UTF-8"?>
21
+ <response status="1">
22
+ <files>
23
+ <file>
24
+ <file_id>123456-abc</file_id>
25
+ <file_name>My Resume.doc</file_name>
26
+ <file_description>Resume (Draft 3)</file_description>
27
+ <file_size>0.4 MB</file_size>
28
+ <downloads>4</downloads>
29
+ <last_downloaded_at>1192417863</last_downloaded_at>
30
+ <uploaded_at>1192454938</uploaded_at>
31
+ <folder_title>Job Applications</folder_title>
32
+ <folder_id>12345</folder_id>
33
+ </file>
34
+ </files>
35
+ </response>
36
+ EOS
37
+ end
38
+
39
+ def get_two_files_xml
40
+ <<-EOS
41
+ <?xml version="1.0" encoding="UTF-8"?>
42
+ <response status="1">
43
+ <files>
44
+ <file>
45
+ <file_id>123456-abc</file_id>
46
+ <file_name>My Resume.doc</file_name>
47
+ <file_description>Resume (Draft 3)</file_description>
48
+ <file_size>0.4 MB</file_size>
49
+ <downloads>4</downloads>
50
+ <last_downloaded_at>1192417863</last_downloaded_at>
51
+ <uploaded_at>1192454938</uploaded_at>
52
+ <folder_title>Job Applications</folder_title>
53
+ <folder_id>12345</folder_id>
54
+ </file>
55
+ <file>
56
+ <file_id>456789-def</file_id>
57
+ <file_name>My Audio Resume.mp3</file_name>
58
+ <file_description>Resume (Draft 3)</file_description>
59
+ <file_size>4.4 MB</file_size>
60
+ <downloads>40</downloads>
61
+ <last_downloaded_at>1192817863</last_downloaded_at>
62
+ <uploaded_at>1192464938</uploaded_at>
63
+ <folder_title>Job Applications</folder_title>
64
+ <folder_id>12345</folder_id>
65
+ </file>
66
+ </files>
67
+ </response>
68
+ EOS
69
+ end
70
+
71
+ def get_three_files_xml
72
+ <<-EOS
73
+ <?xml version="1.0" encoding="UTF-8"?>
74
+ <response status="1">
75
+ <files>
76
+ <file>
77
+ <file_id>123456-abc</file_id>
78
+ <file_name>My Resume.doc</file_name>
79
+ <file_description>Resume (Draft 3)</file_description>
80
+ <file_size>0.4 MB</file_size>
81
+ <downloads>4</downloads>
82
+ <last_downloaded_at>1192417863</last_downloaded_at>
83
+ <uploaded_at>1192454938</uploaded_at>
84
+ <folder_title>Job Applications</folder_title>
85
+ <folder_id>12345</folder_id>
86
+ </file>
87
+ <file>
88
+ <file_id>456789-def</file_id>
89
+ <file_name>My Audio Resume.mp3</file_name>
90
+ <file_description>Resume (Draft 3)</file_description>
91
+ <file_size>4.4 MB</file_size>
92
+ <downloads>40</downloads>
93
+ <last_downloaded_at>1192817863</last_downloaded_at>
94
+ <uploaded_at>1192464938</uploaded_at>
95
+ <folder_title>Job Applications</folder_title>
96
+ <folder_id>12345</folder_id>
97
+ </file>
98
+ <file>
99
+ <file_id>789123-ghi</file_id>
100
+ <file_name>My Video Resume.mov</file_name>
101
+ <file_description>Resume (Draft 3)</file_description>
102
+ <file_size>14.4 MB</file_size>
103
+ <downloads>44</downloads>
104
+ <last_downloaded_at>1192817864</last_downloaded_at>
105
+ <uploaded_at>1192464939</uploaded_at>
106
+ <folder_title>Job Applications</folder_title>
107
+ <folder_id>12345</folder_id>
108
+ </file>
109
+ </files>
110
+ </response>
111
+ EOS
112
+ end
113
+
114
+ def successful_login_xml
115
+ <<-EOS
116
+ <?xml version="1.0" encoding="UTF-8"?>
117
+ <response status="1">
118
+ <api_session_key>123-abcdefghijkl</api_session_key>
119
+ </response>
120
+ EOS
121
+ end
122
+
123
+ def successful_logout_xml
124
+ <<-EOS
125
+ <?xml version="1.0" encoding="UTF-8"?>
126
+ <response status="1">
127
+ <logged_out>true</logged_out>
128
+ </response>
129
+ EOS
130
+ end
131
+
132
+ def error_xml(message)
133
+ <<-EOS
134
+ <?xml version="1.0" encoding="UTF-8"?>
135
+ <response status="0">
136
+ <error>#{message}</error>
137
+ </response>
138
+ EOS
139
+ end
140
+
141
+ def get_upload_ticket_xml
142
+ <<-EOS
143
+ <?xml version="1.0" encoding="UTF-8"?>
144
+ <response status="1">
145
+ <upload_ticket>123-abcdefghijkl</upload_ticket>
146
+ </response>
147
+ EOS
148
+ end
149
+
150
+ end
151
+
152
+
153
+