ankoder 0.0.5 → 0.0.6
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.
- data.tar.gz.sig +0 -0
- data/lib/ankoder/version.rb +1 -1
- data/lib/ankoder/video.rb +11 -0
- data/website/index.html +86 -29
- metadata +1 -1
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/ankoder/version.rb
CHANGED
data/lib/ankoder/video.rb
CHANGED
@@ -12,5 +12,16 @@ module Ankoder
|
|
12
12
|
encoded_message = Base64.encode64(HMAC::SHA1::digest(Configuration::private_key, message)).strip
|
13
13
|
"http://#{Configuration::host}/video/#{video_id}/download/?message=#{CGI.escape(message)}&signature=#{encoded_message}"
|
14
14
|
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
# Will return one of three values, in the following order of precedence:
|
19
|
+
#
|
20
|
+
# 1) The current time in seconds since the epoch plus the number of seconds passed in
|
21
|
+
# the +:expires_in+ option
|
22
|
+
# 2) The current time in seconds since the epoch plus the default number of seconds (60 seconds)
|
23
|
+
def self.expires(expires_in =nil)
|
24
|
+
Time.now.to_i + (expires_in || DEFAULT_EXPIRY)
|
25
|
+
end
|
15
26
|
end
|
16
27
|
end
|
data/website/index.html
CHANGED
@@ -26,6 +26,7 @@
|
|
26
26
|
versionBox.applyCornersToAll();
|
27
27
|
}
|
28
28
|
</script>
|
29
|
+
|
29
30
|
</head>
|
30
31
|
<body>
|
31
32
|
<div id="main">
|
@@ -33,36 +34,89 @@
|
|
33
34
|
<h1>ankoder</h1>
|
34
35
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/ankoder"; return false'>
|
35
36
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/ankoder" class="numbers">0.0.
|
37
|
+
<a href="http://rubyforge.org/projects/ankoder" class="numbers">0.0.6</a>
|
37
38
|
</div>
|
39
|
+
|
38
40
|
<h1>→ ‘ankoder’</h1>
|
39
41
|
|
40
42
|
|
41
43
|
<h2>What</h2>
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
44
|
+
<p>ankoder is a service provided by rorcraft that allows you convert a Video of any format (YouTube's videos,etc) to MPEG4 (AVI/MOV/MP4/MP3/3GP) or FLV file online. And this gem is to provide the API for you to send request to our video encoding server.</p>
|
45
|
+
<h2>Installing</h2>
|
46
|
+
|
47
|
+
<pre class='syntax'><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">ankoder</span></pre>
|
48
|
+
<h2>The basics</h2>
|
49
|
+
<p>As this service is still in private beta stage, for every developer start to use this api , have to apply for the private testing account. To apply the testing account, please fill in the form in <a href="http://free.ankoder.com/">http://free.ankoder.com/</a> .</p>
|
50
|
+
<h2>Demonstration of usage</h2>
|
51
|
+
|
52
|
+
<p>After we have approved the application , we will assign the username and password to login the service, for example, api_user as username , and api_passowrd as password.</p>
|
53
|
+
<h4>Add the following lines to ApplicationController</h4>
|
54
|
+
<code>
|
55
|
+
require "ankoder"
|
56
|
+
include Ankoder
|
57
|
+
</code>
|
58
|
+
<h4>To create a user session<br />
|
59
|
+
</h4>
|
60
|
+
<code>user = Auth.create("api_user", "api_password")</code>
|
61
|
+
|
62
|
+
<h4>To list out the available converting profile</h4>
|
63
|
+
<code>profiles = user.profiles.find(:all)</code>
|
64
|
+
<h4>To download a video from Youtube</h4>
|
65
|
+
<code>download = user.downloads.create('url' =>"http://www.youtube.com/watch?v=Sex4w4h7Tqk") </code>
|
66
|
+
<h4>To create a job to convert a video file</h4>
|
67
|
+
<code>convert_job.create(:video_id =>download.id , :profile_id => profile.id )</code>
|
68
|
+
|
69
|
+
<h4>To Get the list of the upload server </h4>
|
70
|
+
<p><code>api_servers = user.upload.find(:all)</code></p>
|
71
|
+
<h4>or to get the recommended upload server</h4>
|
72
|
+
<p><code>api_server = user.upload.find(:first)</code></p>
|
73
|
+
<h2>Direct Upload Form Example</h2>
|
74
|
+
<p>the form action can get from <code>user.upload.find(:all)</code></p>
|
75
|
+
<p>params that accept by ankoder upload api</p>
|
76
|
+
<p>access_key ( required ) : your own access key</p>
|
77
|
+
<p>success_redirect ( required ) : url that will redirect to if the upload is successful</p>
|
78
|
+
|
79
|
+
<p>failed_redirect ( required ) : url that will redirect to if the upload is failed</p>
|
80
|
+
|
81
|
+
<p>postback_url ( optional ) : our server will send out the direct postback to you contain the id of the upload video </p>
|
82
|
+
<p>You can also add some custom params that if you want us to postback to you, as this kind of message will be using your private key to hash , so that you can sure that the message is issued by ankoder.</p>
|
83
|
+
<p>Params that begin with custom_ will be conside as your custom param.</p>
|
84
|
+
<p>for the file name field , you have to use the below format</p>
|
85
|
+
|
86
|
+
<p>
|
87
|
+
<!-- <code><pre><input class="text" id="uploaded_data" name="file[merb_uploaded_data]" size="30" type="file" /></pre></code> -->
|
88
|
+
<code><input class="text" id="uploaded_data" name="file[uploaded_data]" size="30" type="file" /></code></p>
|
89
|
+
<p>Below is the demo of the upload form structure</p>
|
90
|
+
<code><pre>
|
91
|
+
<h1>Upload a file</h1><br />
|
92
|
+
<form action="http://ec2-api.ankoder.com/files/upload" enctype="multipart/form-data" method="post"><br />
|
93
|
+
|
94
|
+
<input name="success_redirect" type="hidden" value="http://www.youhost.com/uplaod_success" /><br />
|
95
|
+
<input name="failed_redirect" type="hidden" value="http://www.youhost.com/uplaod_failed" /><br />
|
96
|
+
|
97
|
+
<input name="access_key" type="hidden" value="your_access_key" /><br />
|
98
|
+
<input name="postback_url" type="hidden" value="http://www.youhost.com/postback/upload" /><br />
|
99
|
+
|
100
|
+
<input name="custom_video_name" type="hidden" value="test.mp4" /><br />
|
101
|
+
<input name="custom_video_format" type="hidden" value="mp4" /></p>
|
102
|
+
|
103
|
+
<p><p><label for="file_uploaded_data">File</label><br />
|
104
|
+
<input name="file[uploaded_data]" size="30" type="file" /><br />
|
105
|
+
|
106
|
+
</p><br />
|
107
|
+
<input name="commit" type="submit" value="Upload" /><br />
|
108
|
+
</form>
|
109
|
+
|
110
|
+
</p>
|
111
|
+
</pre>
|
112
|
+
</code>
|
113
|
+
<h2>Forum</h2>
|
114
|
+
|
115
|
+
<p><a href="http://groups.google.com/group/ankoder">http://groups.google.com/group/ankoder</a></p>
|
116
|
+
<h2>Our development Blog</h2>
|
117
|
+
<p><a href="http://devblog.rorcraft.com/">http://devblog.rorcraft.com/</a></p>
|
118
|
+
|
119
|
+
<h2>How to submit patches</h2>
|
66
120
|
|
67
121
|
|
68
122
|
<p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people’s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
|
@@ -80,11 +134,14 @@
|
|
80
134
|
<h2>Contact</h2>
|
81
135
|
|
82
136
|
|
83
|
-
<p>Comments are welcome. Send an email to <a href="mailto:
|
137
|
+
<p>Comments are welcome. Send an email to <a href="mailto:info@rorcraft.com">info@rorcraft.com</a></span> or via the <a href="http://groups.google.com/group/ankoder">forum</a></p>
|
84
138
|
<p class="coda">
|
85
|
-
<a href="FIXME email">
|
86
|
-
|
87
|
-
|
139
|
+
<a href="FIXME email"></a>Ankoder, a service by RoRCraft Limited,<br />
|
140
|
+
|
141
|
+
Last Updated :
|
142
|
+
1st April 2008<br>
|
143
|
+
|
144
|
+
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a> </p>
|
88
145
|
</div>
|
89
146
|
|
90
147
|
<!-- insert site tracking codes here, like Google Urchin -->
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|