ankoder 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -2,7 +2,7 @@ module Ankoder #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 5
5
+ TINY = 6
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -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
@@ -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.5</a>
37
+ <a href="http://rubyforge.org/projects/ankoder" class="numbers">0.0.6</a>
37
38
  </div>
39
+
38
40
  <h1>&#x2192; &#8216;ankoder&#8217;</h1>
39
41
 
40
42
 
41
43
  <h2>What</h2>
42
-
43
-
44
- <h2>Installing</h2>
45
-
46
-
47
- <p><pre class='syntax'><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">ankoder</span></pre></p>
48
-
49
-
50
- <h2>The basics</h2>
51
-
52
-
53
- <h2>Demonstration of usage</h2>
54
-
55
-
56
- <h2>Forum</h2>
57
-
58
-
59
- <p><a href="http://groups.google.com/group/ankoder">http://groups.google.com/group/ankoder</a></p>
60
-
61
-
62
- <p><span class="caps">TODO</span> &#8211; create Google Group &#8211; ankoder</p>
63
-
64
-
65
- <h2>How to submit patches</h2>
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(&quot;api_user&quot;, &quot;api_password&quot;)</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' =&gt;&quot;http://www.youtube.com/watch?v=Sex4w4h7Tqk&quot;) </code>
66
+ <h4>To create a job to convert a video file</h4>
67
+ <code>convert_job.create(:video_id =&gt;download.id , :profile_id =&gt; 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>&lt;input class=&quot;text&quot; id=&quot;uploaded_data&quot; name=&quot;file[uploaded_data]&quot; size=&quot;30&quot; type=&quot;file&quot; /&gt;</code></p>
89
+ <p>Below is the demo of the upload form structure</p>
90
+ <code><pre>
91
+ &lt;h1&gt;Upload a file&lt;/h1&gt;<br />
92
+ &lt;form action=&quot;http://ec2-api.ankoder.com/files/upload&quot; enctype=&quot;multipart/form-data&quot; method=&quot;post&quot;&gt;<br />
93
+
94
+ &lt;input name=&quot;success_redirect&quot; type=&quot;hidden&quot; value=&quot;http://www.youhost.com/uplaod_success&quot; /&gt;<br />
95
+ &lt;input name=&quot;failed_redirect&quot; type=&quot;hidden&quot; value=&quot;http://www.youhost.com/uplaod_failed&quot; /&gt;<br />
96
+
97
+ &lt;input name=&quot;access_key&quot; type=&quot;hidden&quot; value=&quot;your_access_key&quot; /&gt;<br />
98
+ &lt;input name=&quot;postback_url&quot; type=&quot;hidden&quot; value=&quot;http://www.youhost.com/postback/upload&quot; /&gt;<br />
99
+
100
+ &lt;input name=&quot;custom_video_name&quot; type=&quot;hidden&quot; value=&quot;test.mp4&quot; /&gt;<br />
101
+ &lt;input name=&quot;custom_video_format&quot; type=&quot;hidden&quot; value=&quot;mp4&quot; /&gt;</p>
102
+
103
+ <p>&lt;p&gt;&lt;label for=&quot;file_uploaded_data&quot;&gt;File&lt;/label&gt;<br />
104
+ &lt;input name=&quot;file[uploaded_data]&quot; size=&quot;30&quot; type=&quot;file&quot; /&gt;<br />
105
+
106
+ &lt;/p&gt;<br />
107
+ &lt;input name=&quot;commit&quot; type=&quot;submit&quot; value=&quot;Upload&quot; /&gt;<br />
108
+ &lt;/form&gt;
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&#8217;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:FIXME"><span class="caps">FIXME</span> full name</a> email via the <a href="http://groups.google.com/group/ankoder">forum</a></p>
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">FIXME full name</a>, 30th April 2008<br>
86
- Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
87
- </p>
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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ankoder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ""
6
6
  authors:
7
7
  - RoRCraft.com
metadata.gz.sig CHANGED
Binary file