Ziggeo 1.5 → 1.06

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c9fe90508511b991b4a875c418506fd36b359175
4
- data.tar.gz: 247c2ae35713a2146cb1b84bb65aa10fc1399e46
3
+ metadata.gz: 44cfadc51a8a4831af6b9963799637a578792688
4
+ data.tar.gz: 968b38dee3416f98cf54c4d42cd7bb6d46418f5d
5
5
  SHA512:
6
- metadata.gz: 890361ffc3366f5a91428f61139f03e51011d2129a26dc080d4bf2f7a8f3ee5a713270fd16b106a3026991d2113117883c83ffb96adc0d9806e63d952265bb0b
7
- data.tar.gz: 26a21f6b126f811cbcf05ff4f14d60fcd84bfad1d337551a933b2767a0b4b68a93c5900a0843d75214e3874c73786f36b8b08a84af0271fe3b46d32abdf44a47
6
+ metadata.gz: 9de05bd413549b5e7dc5b8564725d2b963add066cf8d960120f282bb4387f718a28097b4769404396de5599f25c76512c1b6fabe458a14642ac1005e1ad894ea
7
+ data.tar.gz: 2e903bc600db791fb4524cabe0db3ddaf516c727de8202fb92b7d56d9534c7d765a2c95766ae0bbdd289631344be5d0befa169ca7f6307ae2f7921e42df221da
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Ziggeo Ruby Server SDK 1.5
1
+ # Ziggeo Ruby Server SDK 1.06
2
2
 
3
- Ziggeo API (https://ziggeo.com) allows you to integrate video recording and playback with only
3
+ Ziggeo API (http://ziggeo.com) allows you to integrate video recording and playback with only
4
4
  two lines of code in your site, service or app. This is the Ruby Server SDK repository.
5
5
 
6
6
  Pull requests welcome.
@@ -18,33 +18,30 @@ gem "Ziggeo"
18
18
  For the client-side integration, you need to add these assets to your html file:
19
19
 
20
20
  ```html
21
- <link rel="stylesheet" href="//assets-cdn.ziggeo.com/v2-stable/ziggeo.css" />
22
- <script src="//assets-cdn.ziggeo.com/v2-stable/ziggeo.js"></script>
21
+ <link rel="stylesheet" href="//assets-cdn.ziggeo.com/v1-latest/ziggeo.css" />
22
+ <script src="//assets-cdn.ziggeo.com/v1-latest/ziggeo.js"></script>
23
23
  ```
24
24
 
25
25
  Then, you need to specify your api token:
26
26
  ```html
27
27
  <script>
28
- var ziggeoApplication = new ZiggeoApi.V2.Application({
29
- token: "APPLICATION_TOKEN"
30
- });
28
+ ZiggeoApi.token = "APPLICATION_TOKEN";
31
29
  </script>
32
30
  ```
33
31
 
34
- You can specify other global options, [see here](https://ziggeo.com/docs).
32
+ You can specify other global options, [see here](http://ziggeo.com/docs).
35
33
 
36
34
  To fire up a recorder on your page, add:
37
35
  ```html
38
- <ziggeorecorder></ziggeorecorder>
36
+ <ziggeo></ziggeo>
39
37
  ```
40
38
 
41
39
  To embed a player for an existing video, add:
42
40
  ```html
43
- <ziggeoplayer ziggeo-video='video-token'></ziggeoplayer>
41
+ <ziggeo ziggeo-video='video-token'></ziggeo>
44
42
  ```
45
43
 
46
- For the full documentation, please visit [ziggeo.com](https://ziggeo.com/docs).
47
-
44
+ For the full documentation, please visit [ziggeo.com](http://ziggeo.com/docs).
48
45
 
49
46
 
50
47
  ## Server-Side Integration
@@ -59,7 +56,7 @@ You can integrate the Server SDK as follows:
59
56
  ## Server-Side Methods
60
57
 
61
58
  ### Videos
62
-
59
+
63
60
  The videos resource allows you to access all single videos. Each video may contain more than one stream.
64
61
 
65
62
 
@@ -76,20 +73,7 @@ Arguments
76
73
  - skip: *Skip the first [n] entries.*
77
74
  - reverse: *Reverse the order in which videos are returned.*
78
75
  - states: *Filter videos by state*
79
- - tags: *Filter the search result to certain tags, encoded as a comma-separated string*
80
-
81
-
82
- #### Count
83
-
84
- Get the video count for the application.
85
-
86
- ```ruby
87
- ziggeo.videos().count(arguments = nil)
88
- ```
89
-
90
- Arguments
91
- - states: *Filter videos by state*
92
- - tags: *Filter the search result to certain tags, encoded as a comma-separated string*
76
+ - tags: *Filter the search result to certain tags*
93
77
 
94
78
 
95
79
  #### Get
@@ -102,31 +86,6 @@ ziggeo.videos().get(token_or_key)
102
86
 
103
87
 
104
88
 
105
- #### Get Bulk
106
-
107
- Get multiple videos by tokens or keys.
108
-
109
- ```ruby
110
- ziggeo.videos().get_bulk(arguments = nil)
111
- ```
112
-
113
- Arguments
114
- - tokens_or_keys: *Comma-separated list with the desired videos tokens or keys (Limit: 100 tokens or keys).*
115
-
116
-
117
- #### Stats Bulk
118
-
119
- Get stats for multiple videos by tokens or keys.
120
-
121
- ```ruby
122
- ziggeo.videos().stats_bulk(arguments = nil)
123
- ```
124
-
125
- Arguments
126
- - tokens_or_keys: *Comma-separated list with the desired videos tokens or keys (Limit: 100 tokens or keys).*
127
- - summarize: *Boolean. Set it to TRUE to get the stats summarized. Set it to FALSE to get the stats for each video in a separate array. Default: TRUE.*
128
-
129
-
130
89
  #### Download Video
131
90
 
132
91
  Download the video data file
@@ -147,40 +106,6 @@ ziggeo.videos().download_image(token_or_key)
147
106
 
148
107
 
149
108
 
150
- #### Get Stats
151
-
152
- Get the video's stats
153
-
154
- ```ruby
155
- ziggeo.videos().get_stats(token_or_key)
156
- ```
157
-
158
-
159
-
160
- #### Push To Service
161
-
162
- Push a video to a provided push service.
163
-
164
- ```ruby
165
- ziggeo.videos().push_to_service(token_or_key, arguments = nil)
166
- ```
167
-
168
- Arguments
169
- - pushservicetoken: *Push Services's token (from the Push Services configured for the app)*
170
-
171
-
172
- #### Apply Effect
173
-
174
- Apply an effect profile to a video.
175
-
176
- ```ruby
177
- ziggeo.videos().apply_effect(token_or_key, arguments = nil)
178
- ```
179
-
180
- Arguments
181
- - effectprofiletoken: *Effect Profile token (from the Effect Profiles configured for the app)*
182
-
183
-
184
109
  #### Update
185
110
 
186
111
  Update single video by token or key.
@@ -198,23 +123,6 @@ Arguments
198
123
  - expiration_days: *After how many days will this video be deleted*
199
124
 
200
125
 
201
- #### Update Bulk
202
-
203
- Update multiple videos by token or key.
204
-
205
- ```ruby
206
- ziggeo.videos().update_bulk(arguments = nil)
207
- ```
208
-
209
- Arguments
210
- - tokens_or_keys: *Comma-separated list with the desired videos tokens or keys (Limit: 100 tokens or keys).*
211
- - min_duration: *Minimal duration of video*
212
- - max_duration: *Maximal duration of video*
213
- - tags: *Video Tags*
214
- - volatile: *Automatically removed this video if it remains empty*
215
- - expiration_days: *After how many days will this video be deleted*
216
-
217
-
218
126
  #### Delete
219
127
 
220
128
  Delete a single video by token or key.
@@ -242,23 +150,8 @@ Arguments
242
150
  - volatile: *Automatically removed this video if it remains empty*
243
151
 
244
152
 
245
- #### Analytics
246
-
247
- Get analytics for a specific videos with the given params
248
-
249
- ```ruby
250
- ziggeo.videos().analytics(token_or_key, arguments = nil)
251
- ```
252
-
253
- Arguments
254
- - from: *A UNIX timestamp in microseconds used as the start date of the query*
255
- - to: *A UNIX timestamp in microseconds used as the end date of the query*
256
- - date: *A UNIX timestamp in microseconds to retrieve data from a single date. If set, it overwrites the from and to params.*
257
- - query: *The query you want to run. It can be one of the following: device_views_by_os, device_views_by_date, total_plays_by_country, full_plays_by_country, total_plays_by_hour, full_plays_by_hour, total_plays_by_browser, full_plays_by_browser*
258
-
259
-
260
153
  ### Streams
261
-
154
+
262
155
  The streams resource allows you to directly access all streams associated with a single video.
263
156
 
264
157
 
@@ -304,18 +197,6 @@ ziggeo.streams().download_image(video_token_or_key, token_or_key)
304
197
 
305
198
 
306
199
 
307
- #### Push To Service
308
-
309
- Push a stream to a provided push service.
310
-
311
- ```ruby
312
- ziggeo.streams().push_to_service(video_token_or_key, token_or_key, arguments = nil)
313
- ```
314
-
315
- Arguments
316
- - pushservicetoken: *Push Services's token (from the Push Services configured for the app)*
317
-
318
-
319
200
  #### Delete
320
201
 
321
202
  Delete the stream
@@ -373,7 +254,7 @@ ziggeo.streams().bind(video_token_or_key, token_or_key, arguments = nil)
373
254
 
374
255
 
375
256
  ### Authtokens
376
-
257
+
377
258
  The auth token resource allows you to manage authorization settings for video objects.
378
259
 
379
260
 
@@ -431,297 +312,11 @@ Arguments
431
312
  - grants: *Permissions this tokens grants*
432
313
 
433
314
 
434
- ### EffectProfiles
435
-
436
- The effect profiles resource allows you to access and create effect profiles for your app. Each effect profile may contain one process or more.
437
-
438
-
439
- #### Create
440
-
441
- Create a new effect profile.
442
-
443
- ```ruby
444
- ziggeo.effectProfiles().create(arguments = nil)
445
- ```
446
-
447
- Arguments
448
- - key: *Effect profile key.*
449
- - title: *Effect profile title.*
450
-
451
-
452
- #### Index
453
-
454
- Get list of effect profiles.
455
-
456
- ```ruby
457
- ziggeo.effectProfiles().index(arguments = nil)
458
- ```
459
-
460
- Arguments
461
- - limit: *Limit the number of returned effect profiles. Can be set up to 100.*
462
- - skip: *Skip the first [n] entries.*
463
- - reverse: *Reverse the order in which effect profiles are returned.*
464
-
465
-
466
- #### Get
467
-
468
- Get a single effect profile
469
-
470
- ```ruby
471
- ziggeo.effectProfiles().get(token_or_key)
472
- ```
473
-
474
-
475
-
476
- #### Delete
477
-
478
- Delete the effect profile
479
-
480
- ```ruby
481
- ziggeo.effectProfiles().delete(token_or_key)
482
- ```
483
-
484
-
485
-
486
- ### EffectProfileProcess
487
-
488
- The process resource allows you to directly access all process associated with a single effect profile.
489
-
490
-
491
- #### Index
492
-
493
- Return all processes associated with a effect profile
494
-
495
- ```ruby
496
- ziggeo.effectProfileProcess().index(effect_token_or_key, arguments = nil)
497
- ```
498
-
499
- Arguments
500
- - states: *Filter streams by state*
501
-
502
-
503
- #### Get
504
-
505
- Get a single process
506
-
507
- ```ruby
508
- ziggeo.effectProfileProcess().get(effect_token_or_key, token_or_key)
509
- ```
510
-
511
-
512
-
513
- #### Delete
514
-
515
- Delete the process
516
-
517
- ```ruby
518
- ziggeo.effectProfileProcess().delete(effect_token_or_key, token_or_key)
519
- ```
520
-
521
-
522
-
523
- #### Create Filter Process
524
-
525
- Create a new filter effect process
526
-
527
- ```ruby
528
- ziggeo.effectProfileProcess().create_filter_process(effect_token_or_key, arguments = nil)
529
- ```
530
-
531
- Arguments
532
- - effect: *Effect to be applied in the process*
533
-
534
-
535
- #### Create Watermark Process
536
-
537
- Attaches an image to a new stream
538
-
539
- ```ruby
540
- ziggeo.effectProfileProcess().create_watermark_process(effect_token_or_key, arguments = nil, file = nil)
541
- ```
542
-
543
- Arguments
544
- - file: *Image file to be attached*
545
- - vertical: *Specify the vertical position of your watermark (a value between 0.0 and 1.0)*
546
- - horizontal: *Specify the horizontal position of your watermark (a value between 0.0 and 1.0)*
547
- - scale: *Specify the image scale of your watermark (a value between 0.0 and 1.0)*
548
-
549
-
550
- ### MetaProfiles
551
-
552
- The meta profiles resource allows you to access and create meta profiles for your app. Each meta profile may contain one process or more.
553
-
554
-
555
- #### Create
556
-
557
- Create a new meta profile.
558
-
559
- ```ruby
560
- ziggeo.metaProfiles().create(arguments = nil)
561
- ```
562
-
563
- Arguments
564
- - key: *Meta Profile profile key.*
565
- - title: *Meta Profile profile title.*
566
-
567
-
568
- #### Index
569
-
570
- Get list of meta profiles.
571
-
572
- ```ruby
573
- ziggeo.metaProfiles().index(arguments = nil)
574
- ```
575
-
576
- Arguments
577
- - limit: *Limit the number of returned meta profiles. Can be set up to 100.*
578
- - skip: *Skip the first [n] entries.*
579
- - reverse: *Reverse the order in which meta profiles are returned.*
580
-
581
-
582
- #### Get
583
-
584
- Get a single meta profile
585
-
586
- ```ruby
587
- ziggeo.metaProfiles().get(token_or_key)
588
- ```
589
-
590
-
591
-
592
- #### Delete
593
-
594
- Delete the meta profile
595
-
596
- ```ruby
597
- ziggeo.metaProfiles().delete(token_or_key)
598
- ```
599
-
600
-
601
-
602
- ### MetaProfileProcess
603
-
604
- The process resource allows you to directly access all process associated with a single meta profile.
605
-
606
-
607
- #### Index
608
-
609
- Return all processes associated with a meta profile
610
-
611
- ```ruby
612
- ziggeo.metaProfileProcess().index(meta_token_or_key)
613
- ```
614
-
615
-
616
-
617
- #### Get
618
-
619
- Get a single process
620
-
621
- ```ruby
622
- ziggeo.metaProfileProcess().get(meta_token_or_key, token_or_key)
623
- ```
624
-
625
-
626
-
627
- #### Delete
628
-
629
- Delete the process
630
-
631
- ```ruby
632
- ziggeo.metaProfileProcess().delete(meta_token_or_key, token_or_key)
633
- ```
634
-
635
-
636
-
637
- #### Create Video Analysis Process
638
-
639
- Create a new video analysis meta process
640
-
641
- ```ruby
642
- ziggeo.metaProfileProcess().create_video_analysis_process(meta_token_or_key)
643
- ```
644
-
645
-
646
-
647
- #### Create Audio Transcription Process
648
-
649
- Create a new audio transcription meta process
650
-
651
- ```ruby
652
- ziggeo.metaProfileProcess().create_audio_transcription_process(meta_token_or_key)
653
- ```
654
-
655
-
656
-
657
- #### Create Nsfw Process
658
-
659
- Create a new nsfw filter meta process
660
-
661
- ```ruby
662
- ziggeo.metaProfileProcess().create_nsfw_process(meta_token_or_key, arguments = nil)
663
- ```
664
-
665
- Arguments
666
- - nsfw_action: *One of the following three: approve, reject, nothing.*
667
-
668
-
669
- ### Webhooks
670
-
671
- The webhooks resource allows you to create or delete webhooks related to a given application.
672
-
673
-
674
- #### Create
675
-
676
- Create a new webhook for the given url to catch the given events.
677
-
678
- ```ruby
679
- ziggeo.webhooks().create(arguments = nil)
680
- ```
681
-
682
- Arguments
683
- - target_url: *The url that will catch the events*
684
- - encoding: *Data encoding to be used by the webhook to send the events.*
685
- - events: *Comma-separated list of the events the webhook will catch. They must be valid webhook type events.*
686
-
687
-
688
- #### Delete
689
-
690
- Delete a webhook using its URL.
691
-
692
- ```ruby
693
- ziggeo.webhooks().delete(arguments = nil)
694
- ```
695
-
696
- Arguments
697
- - target_url: *The url that will catch the events*
698
-
699
-
700
- ### Analytics
701
-
702
- The analytics resource allows you to access the analytics for the given application
703
-
704
-
705
- #### Get
706
-
707
- Get analytics for the given params
708
-
709
- ```ruby
710
- ziggeo.analytics().get(arguments = nil)
711
- ```
712
-
713
- Arguments
714
- - from: *A UNIX timestamp in microseconds used as the start date of the query*
715
- - to: *A UNIX timestamp in microseconds used as the end date of the query*
716
- - date: *A UNIX timestamp in microseconds to retrieve data from a single date. If set, it overwrites the from and to params.*
717
- - query: *The query you want to run. It can be one of the following: device_views_by_os, device_views_by_date, total_plays_by_country, full_plays_by_country, total_plays_by_hour, full_plays_by_hour, total_plays_by_browser, full_plays_by_browser*
718
-
719
-
720
315
 
721
316
 
722
317
 
723
318
  ## License
724
319
 
725
- Copyright (c) 2013-2018 Ziggeo
320
+ Copyright (c) 2013-2016 Ziggeo
726
321
 
727
- Apache 2.0 License
322
+ Apache 2.0 License
@@ -5,106 +5,60 @@ require 'cgi'
5
5
 
6
6
  require_relative "classes/ZiggeoConfig"
7
7
  require_relative "classes/ZiggeoConnect"
8
- require_relative "classes/ZiggeoAuth"
9
8
  require_relative "classes/ZiggeoVideos"
10
9
  require_relative "classes/ZiggeoStreams"
11
10
  require_relative "classes/ZiggeoAuthtokens"
12
- require_relative "classes/ZiggeoEffectProfiles"
13
- require_relative "classes/ZiggeoEffectProfileProcess"
14
- require_relative "classes/ZiggeoMetaProfiles"
15
- require_relative "classes/ZiggeoMetaProfileProcess"
16
- require_relative "classes/ZiggeoWebhooks"
17
- require_relative "classes/ZiggeoAnalytics"
11
+ require_relative "classes/ZiggeoAuth"
18
12
 
19
13
  class Ziggeo
20
14
 
21
- attr_accessor :token, :private_key, :encryption_key, :config, :connect
22
-
23
- def initialize(token = nil, private_key = nil, encryption_key = nil)
24
- @token = token
25
- @private_key = private_key
26
- @encryption_key = encryption_key
27
- @config = ZiggeoConfig.new()
28
- @connect = ZiggeoConnect.new(self)
29
- @auth = nil
30
- @videos = nil
31
- @streams = nil
32
- @authtokens = nil
33
- @effectProfiles = nil
34
- @effectProfileProcess = nil
35
- @metaProfiles = nil
36
- @metaProfileProcess = nil
37
- @webhooks = nil
38
- @analytics = nil
39
- if (ENV["ZIGGEO_URL"] != nil)
40
- uri = URI.parse(ENV["ZIGGEO_URL"])
41
- @config.server_api_url = uri.scheme + "://" + uri.host + ":" + uri.port.to_s
42
- @token = uri.user
43
- @private_key = uri.password
44
- query = CGI::parse(uri.query)
45
- @encryption_key = query["encryption_key"]
46
- end
15
+ attr_accessor :token, :private_key, :encryption_key, :config, :connect
16
+ def initialize(token = nil, private_key = nil, encryption_key = nil)
17
+ @token = token
18
+ @private_key = private_key
19
+ @encryption_key = encryption_key
20
+ @config = ZiggeoConfig.new()
21
+ @connect = ZiggeoConnect.new(self)
22
+ @videos = nil
23
+ @streams = nil
24
+ @authtokens = nil
25
+ @auth = nil
26
+ if (ENV["ZIGGEO_URL"] != nil)
27
+ uri = URI.parse(ENV["ZIGGEO_URL"])
28
+ @config.server_api_url = uri.scheme + "://" + uri.host + ":" + uri.port.to_s
29
+ @token = uri.user
30
+ @private_key = uri.password
31
+ query = CGI::parse(uri.query)
32
+ @encryption_key = query["encryption_key"]
47
33
  end
34
+ end
48
35
 
49
- def auth()
50
- if (@auth == nil)
51
- @auth = ZiggeoAuth.new(self)
52
- end
53
- return @auth end
54
-
55
- def videos()
56
- if (@videos == nil)
57
- @videos = ZiggeoVideos.new(self)
58
- end
59
- return @videos end
60
-
61
- def streams()
62
- if (@streams == nil)
63
- @streams = ZiggeoStreams.new(self)
64
- end
65
- return @streams end
66
-
67
- def authtokens()
68
- if (@authtokens == nil)
69
- @authtokens = ZiggeoAuthtokens.new(self)
70
- end
71
- return @authtokens end
72
-
73
- def effectProfiles()
74
- if (@effectProfiles == nil)
75
- @effectProfiles = ZiggeoEffectProfiles.new(self)
76
- end
77
- return @effectProfiles end
78
-
79
- def effectProfileProcess()
80
- if (@effectProfileProcess == nil)
81
- @effectProfileProcess = ZiggeoEffectProfileProcess.new(self)
82
- end
83
- return @effectProfileProcess end
84
-
85
- def metaProfiles()
86
- if (@metaProfiles == nil)
87
- @metaProfiles = ZiggeoMetaProfiles.new(self)
88
- end
89
- return @metaProfiles end
90
-
91
- def metaProfileProcess()
92
- if (@metaProfileProcess == nil)
93
- @metaProfileProcess = ZiggeoMetaProfileProcess.new(self)
94
- end
95
- return @metaProfileProcess end
36
+ def videos()
37
+ if (@videos == nil)
38
+ @videos = ZiggeoVideos.new(self)
39
+ end
40
+ return @videos
41
+ end
96
42
 
97
- def webhooks()
98
- if (@webhooks == nil)
99
- @webhooks = ZiggeoWebhooks.new(self)
100
- end
101
- return @webhooks end
43
+ def streams()
44
+ if (@streams == nil)
45
+ @streams = ZiggeoStreams.new(self)
46
+ end
47
+ return @streams
48
+ end
102
49
 
103
- def analytics()
104
- if (@analytics == nil)
105
- @analytics = ZiggeoAnalytics.new(self)
106
- end
107
- return @analytics end
50
+ def authtokens()
51
+ if (@authtokens == nil)
52
+ @authtokens = ZiggeoAuthtokens.new(self)
53
+ end
54
+ return @authtokens
55
+ end
108
56
 
57
+ def auth()
58
+ if (@auth == nil)
59
+ @auth = ZiggeoAuth.new(self)
60
+ end
61
+ return @auth
62
+ end
109
63
 
110
64
  end
@@ -1,10 +1,7 @@
1
1
  class ZiggeoConfig
2
- attr_accessor :server_api_url, :request_timeout, :request_timeout_per_mb, :regions
2
+ attr_accessor :server_api_url
3
3
 
4
4
  def initialize()
5
- @request_timeout = 30 # seconds
6
- @request_timeout_per_mb = 20 # seconds per MB of uploaded file
7
5
  @server_api_url = "https://srvapi.ziggeo.com"
8
- @regions = {"r1" => "https://srvapi-eu-west-1.ziggeo.com", }
9
6
  end
10
7
  end
@@ -9,46 +9,18 @@ class ZiggeoConnect
9
9
  end
10
10
 
11
11
  def request(method, path, data = nil, file = nil)
12
- server_api_url = @application.config.server_api_url
13
- regions = @application.config.regions
14
- regions.each do |key, value|
15
- if (@application.token.start_with?(key))
16
- server_api_url = value
17
- end
18
- end
19
-
20
- url = URI.parse(server_api_url + '/v1' + path)
12
+ url = URI.parse(@application.config.server_api_url + '/v1' + path)
21
13
  auth = { username: @application.token, password: @application.private_key }
22
- timeout_in_seconds = @application.config.request_timeout.to_i
23
-
24
14
  method.downcase!
25
15
  allowed_methods = %w(get post delete)
26
16
  return unless allowed_methods.include?(method)
27
17
  if (file.nil?)
28
- if (method == "get")
29
- begin
30
- HTTParty.send(method, url.to_s, query: data, basic_auth: auth, timeout: timeout_in_seconds).body
31
- rescue Net::ReadTimeout => error
32
- self.timeout_error_message timeout_in_seconds, error
33
- end
34
- else
35
- begin
36
- HTTParty.send(method, url.to_s, body: data, basic_auth: auth, timeout: timeout_in_seconds).body
37
- rescue Net::ReadTimeout => error
38
- self.timeout_error_message timeout_in_seconds, error
39
- end
40
- end
18
+ HTTParty.send(method, url.to_s, body: data, basic_auth: auth).body
41
19
  else
42
20
  data = data.nil? ? {} : data;
43
21
  data["file"] = File.new(file)
44
- timeout_in_seconds = ( ( File.size(file).to_f / 2**20 ).round(0) * @application.config.request_timeout_per_mb.to_i ).to_i;
45
-
46
- begin
47
- HTTMultiParty.send(method, url.to_s, body: data, basic_auth: auth, timeout: timeout_in_seconds).body
48
- rescue Net::ReadTimeout => error
49
- self.timeout_error_message timeout_in_seconds, error
50
- end
51
- end
22
+ HTTMultiParty.send(method, url.to_s, body: data, basic_auth: auth).body
23
+ end
52
24
  end
53
25
 
54
26
  def requestJSON(method, path, data = nil, file = nil)
@@ -79,12 +51,4 @@ class ZiggeoConnect
79
51
  return self.requestJSON("DELETE", path, data, file)
80
52
  end
81
53
 
82
- protected
83
-
84
- def timeout_error_message( timeout_in_seconds, error )
85
- puts "Error source: " + error.message
86
- puts "Server not responding. Host: #{@application.config.server_api_url} not responded in #{timeout_in_seconds} seconds."
87
- exit(1)
88
- end
89
-
90
54
  end
@@ -20,10 +20,6 @@ class ZiggeoStreams
20
20
  return @application.connect.get('/videos/' + video_token_or_key + '/streams/' + token_or_key + '/image')
21
21
  end
22
22
 
23
- def push_to_service(video_token_or_key, token_or_key, data = nil)
24
- return @application.connect.postJSON('/videos/' + video_token_or_key + '/streams/' + token_or_key + '/push', data)
25
- end
26
-
27
23
  def delete(video_token_or_key, token_or_key)
28
24
  return @application.connect.delete('/videos/' + video_token_or_key + '/streams/' + token_or_key + '')
29
25
  end
@@ -8,22 +8,10 @@ class ZiggeoVideos
8
8
  return @application.connect.getJSON('/videos/', data)
9
9
  end
10
10
 
11
- def count(data = nil)
12
- return @application.connect.getJSON('/videos/count', data)
13
- end
14
-
15
11
  def get(token_or_key)
16
12
  return @application.connect.getJSON('/videos/' + token_or_key + '')
17
13
  end
18
14
 
19
- def get_bulk(data = nil)
20
- return @application.connect.postJSON('/videos/get_bulk', data)
21
- end
22
-
23
- def stats_bulk(data = nil)
24
- return @application.connect.postJSON('/videos/stats_bulk', data)
25
- end
26
-
27
15
  def download_video(token_or_key)
28
16
  return @application.connect.get('/videos/' + token_or_key + '/video')
29
17
  end
@@ -32,26 +20,10 @@ class ZiggeoVideos
32
20
  return @application.connect.get('/videos/' + token_or_key + '/image')
33
21
  end
34
22
 
35
- def get_stats(token_or_key)
36
- return @application.connect.getJSON('/videos/' + token_or_key + '/stats')
37
- end
38
-
39
- def push_to_service(token_or_key, data = nil)
40
- return @application.connect.postJSON('/videos/' + token_or_key + '/push', data)
41
- end
42
-
43
- def apply_effect(token_or_key, data = nil)
44
- return @application.connect.postJSON('/videos/' + token_or_key + '/effect', data)
45
- end
46
-
47
23
  def update(token_or_key, data = nil)
48
24
  return @application.connect.postJSON('/videos/' + token_or_key + '', data)
49
25
  end
50
26
 
51
- def update_bulk(data = nil)
52
- return @application.connect.postJSON('/videos/update_bulk', data)
53
- end
54
-
55
27
  def delete(token_or_key)
56
28
  return @application.connect.delete('/videos/' + token_or_key + '')
57
29
  end
@@ -60,8 +32,4 @@ class ZiggeoVideos
60
32
  return @application.connect.postJSON('/videos/', data, file)
61
33
  end
62
34
 
63
- def analytics(token_or_key, data = nil)
64
- return @application.connect.postJSON('/videos/' + token_or_key + '/analytics', data)
65
- end
66
-
67
35
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Ziggeo
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.5'
4
+ version: '1.06'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ziggeo, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-11 00:00:00.000000000 Z
11
+ date: 2016-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.13.5
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.13.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: httmultiparty
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: The Ziggeo Ruby and Rails Server SDK.
@@ -45,23 +45,17 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - README.md
49
- - lib/Ziggeo.rb
50
- - lib/classes/ZiggeoAnalytics.rb
51
48
  - lib/classes/ZiggeoAuth.rb
52
49
  - lib/classes/ZiggeoAuthtokens.rb
53
50
  - lib/classes/ZiggeoConfig.rb
54
51
  - lib/classes/ZiggeoConnect.rb
55
- - lib/classes/ZiggeoEffectProfileProcess.rb
56
- - lib/classes/ZiggeoEffectProfiles.rb
57
- - lib/classes/ZiggeoMetaProfileProcess.rb
58
- - lib/classes/ZiggeoMetaProfiles.rb
59
52
  - lib/classes/ZiggeoStreams.rb
60
53
  - lib/classes/ZiggeoVideos.rb
61
- - lib/classes/ZiggeoWebhooks.rb
62
- homepage: https://ziggeo.com
54
+ - lib/Ziggeo.rb
55
+ - README.md
56
+ homepage: http://ziggeo.com
63
57
  licenses:
64
- - Apache-2.0
58
+ - Apache 2.0
65
59
  metadata: {}
66
60
  post_install_message:
67
61
  rdoc_options: []
@@ -69,17 +63,17 @@ require_paths:
69
63
  - lib
70
64
  required_ruby_version: !ruby/object:Gem::Requirement
71
65
  requirements:
72
- - - ">="
66
+ - - '>='
73
67
  - !ruby/object:Gem::Version
74
68
  version: '0'
75
69
  required_rubygems_version: !ruby/object:Gem::Requirement
76
70
  requirements:
77
- - - ">="
71
+ - - '>='
78
72
  - !ruby/object:Gem::Version
79
73
  version: '0'
80
74
  requirements: []
81
75
  rubyforge_project:
82
- rubygems_version: 2.5.2.3
76
+ rubygems_version: 2.0.14
83
77
  signing_key:
84
78
  specification_version: 4
85
79
  summary: The Ziggeo ServerSDK gem.
@@ -1,11 +0,0 @@
1
- class ZiggeoAnalytics
2
-
3
- def initialize(application)
4
- @application = application
5
- end
6
-
7
- def get(data = nil)
8
- return @application.connect.postJSON('/analytics/get', data)
9
- end
10
-
11
- end
@@ -1,27 +0,0 @@
1
- class ZiggeoEffectProfileProcess
2
-
3
- def initialize(application)
4
- @application = application
5
- end
6
-
7
- def index(effect_token_or_key, data = nil)
8
- return @application.connect.getJSON('/effects/' + effect_token_or_key + '/process', data)
9
- end
10
-
11
- def get(effect_token_or_key, token_or_key)
12
- return @application.connect.getJSON('/effects/' + effect_token_or_key + '/process/' + token_or_key + '')
13
- end
14
-
15
- def delete(effect_token_or_key, token_or_key)
16
- return @application.connect.delete('/effects/' + effect_token_or_key + '/process/' + token_or_key + '')
17
- end
18
-
19
- def create_filter_process(effect_token_or_key, data = nil)
20
- return @application.connect.postJSON('/effects/' + effect_token_or_key + '/process/filter', data)
21
- end
22
-
23
- def create_watermark_process(effect_token_or_key, data = nil, file = nil)
24
- return @application.connect.postJSON('/effects/' + effect_token_or_key + '/process/watermark', data, file)
25
- end
26
-
27
- end
@@ -1,23 +0,0 @@
1
- class ZiggeoEffectProfiles
2
-
3
- def initialize(application)
4
- @application = application
5
- end
6
-
7
- def create(data = nil)
8
- return @application.connect.postJSON('/effects/', data)
9
- end
10
-
11
- def index(data = nil)
12
- return @application.connect.getJSON('/effects/', data)
13
- end
14
-
15
- def get(token_or_key)
16
- return @application.connect.getJSON('/effects/' + token_or_key + '')
17
- end
18
-
19
- def delete(token_or_key)
20
- return @application.connect.delete('/effects/' + token_or_key + '')
21
- end
22
-
23
- end
@@ -1,31 +0,0 @@
1
- class ZiggeoMetaProfileProcess
2
-
3
- def initialize(application)
4
- @application = application
5
- end
6
-
7
- def index(meta_token_or_key)
8
- return @application.connect.getJSON('/metaprofiles/' + meta_token_or_key + '/process')
9
- end
10
-
11
- def get(meta_token_or_key, token_or_key)
12
- return @application.connect.getJSON('/metaprofiles/' + meta_token_or_key + '/process/' + token_or_key + '')
13
- end
14
-
15
- def delete(meta_token_or_key, token_or_key)
16
- return @application.connect.delete('/metaprofiles/' + meta_token_or_key + '/process/' + token_or_key + '')
17
- end
18
-
19
- def create_video_analysis_process(meta_token_or_key)
20
- return @application.connect.postJSON('/metaprofiles/' + meta_token_or_key + '/process/analysis')
21
- end
22
-
23
- def create_audio_transcription_process(meta_token_or_key)
24
- return @application.connect.postJSON('/metaprofiles/' + meta_token_or_key + '/process/transcription')
25
- end
26
-
27
- def create_nsfw_process(meta_token_or_key, data = nil)
28
- return @application.connect.postJSON('/metaprofiles/' + meta_token_or_key + '/process/nsfw', data)
29
- end
30
-
31
- end
@@ -1,23 +0,0 @@
1
- class ZiggeoMetaProfiles
2
-
3
- def initialize(application)
4
- @application = application
5
- end
6
-
7
- def create(data = nil)
8
- return @application.connect.postJSON('/metaprofiles/', data)
9
- end
10
-
11
- def index(data = nil)
12
- return @application.connect.getJSON('/metaprofiles/', data)
13
- end
14
-
15
- def get(token_or_key)
16
- return @application.connect.getJSON('/metaprofiles/' + token_or_key + '')
17
- end
18
-
19
- def delete(token_or_key)
20
- return @application.connect.delete('/metaprofiles/' + token_or_key + '')
21
- end
22
-
23
- end
@@ -1,15 +0,0 @@
1
- class ZiggeoWebhooks
2
-
3
- def initialize(application)
4
- @application = application
5
- end
6
-
7
- def create(data = nil)
8
- return @application.connect.post('/api/hook', data)
9
- end
10
-
11
- def delete(data = nil)
12
- return @application.connect.post('/api/removehook', data)
13
- end
14
-
15
- end