├── action.sh
└── README
/action.sh:
--------------------------------------------------------------------------------
1 | static string HTTPPost(string sUrl, string sRequest)
2 | {
3 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(sUrl);
4 | request.Method = "POST";
5 | request.ContentType = "application/x-www-form-urlencoded";
6 | request.ContentLength = sRequest.Length;
7 | request.GetRequestStream().Write(Encoding.UTF8.GetBytes(sRequest), 0, sRequest.Length);
8 | request.GetRequestStream().Close();
9 | HttpWebResponse response = (HttpWebResponse)request.GetResponse();
10 | StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
11 | string result = reader.ReadToEnd();
12 | reader.Close();
13 | return result;
14 | }
15 |
16 | static void Main_Encoding(string origin, string destination)
17 | {
18 | string xml, sUrl, sRequest, result, userID, userKey;
19 |
20 | //put your real userID and userKey below
21 | userID = "0";
22 | userKey = "your_key";
23 |
24 | xml = string.Format(
25 | @"
26 |
27 | {0}
28 | {1}
29 | AddMedia
30 | {2}
31 |
32 |
33 | {3}
34 |
35 | ", userID, userKey, origin, destination);
36 |
37 | sUrl = "http://manage.encoding.com/";
38 | sRequest = "xml=" + HttpUtility.UrlEncode(xml);
39 | result = HTTPPost(sUrl, sRequest);
40 | }
41 |
42 |
43 | static void Main(string[] args)
44 | {
45 | String origin = "http://yoursite.com/video/movie.avi";
46 | String destination = "ftp://username:password@yourftphost.com/video/encoded/test.flv";
47 | Main_Encoding(origin, destination);
48 | }
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | Encoding.com XML API Wrappers
2 | ==============
3 |
4 | This plugin connects to the Encoding.com API for pay as you go cloud based video transcoding services.
5 |
6 | Requires a API Key and User ID from Encoding.com. 30day adn 1GB free trial available at www.encoding.com/signup
7 |
8 | Examples:
9 |
10 | static string HTTPPost(string sUrl, string sRequest)
11 | {
12 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(sUrl);
13 | request.Method = "POST";
14 | request.ContentType = "application/x-www-form-urlencoded";
15 | request.ContentLength = sRequest.Length;
16 | request.GetRequestStream().Write(Encoding.UTF8.GetBytes(sRequest), 0, sRequest.Length);
17 | request.GetRequestStream().Close();
18 | HttpWebResponse response = (HttpWebResponse)request.GetResponse();
19 | StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
20 | string result = reader.ReadToEnd();
21 | reader.Close();
22 | return result;
23 | }
24 |
25 | static void Main_Encoding(string origin, string destination)
26 | {
27 | string xml, sUrl, sRequest, result, userID, userKey;
28 |
29 | userID = "777";
30 | userKey = "277e0d0sdfaaa9140a27c03419f5era";
31 |
32 | xml = string.Format(
33 | @"
34 |
35 | {0}
36 | {1}
37 | AddMedia
38 | {2}
39 |
40 |
41 | {3}
42 |
43 | ", userID, userKey, origin, destination);
44 |
45 | sUrl = "http://manage.encoding.com/";
46 | sRequest = "xml=" + HttpUtility.UrlEncode(xml);
47 | result = HTTPPost(sUrl, sRequest);
48 | }
49 |
50 |
51 | static void Main(string[] args)
52 | {
53 | String origin = "http://yoursite.com/video/movie.avi";
54 | String destination = "ftp://username:password@yourftphost.com/video/encoded/test.flv";
55 | Main_Encoding(origin, destination);
56 | }
57 |
58 | Copyright (c) 2009 Encoding.com Inc.
--------------------------------------------------------------------------------