Ziggeo 1.3 → 1.04
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 +4 -4
- data/README.md +16 -420
- data/lib/Ziggeo.rb +0 -22
- data/lib/classes/ZiggeoConfig.rb +1 -4
- data/lib/classes/ZiggeoConnect.rb +2 -45
- data/lib/classes/ZiggeoStreams.rb +0 -4
- data/lib/classes/ZiggeoVideos.rb +0 -32
- metadata +11 -31
- data/lib/classes/ZiggeoAnalytics.rb +0 -11
- data/lib/classes/ZiggeoEffectProfileProcess.rb +0 -27
- data/lib/classes/ZiggeoEffectProfiles.rb +0 -23
- data/lib/classes/ZiggeoMetaProfileProcess.rb +0 -31
- data/lib/classes/ZiggeoMetaProfiles.rb +0 -23
- data/lib/classes/ZiggeoWebhooks.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa447331b1f96c31a3256ef764d2632ee8daa3a9
|
4
|
+
data.tar.gz: 6ef3e83a47414b397347c912d1c58ea31b80520d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c653ac9d8c37c46cba2057feafae04b0137b59b88292db4f62209f39e67bf3dedaf3b82de535a573c6e746cd884f7218d940ab214548adc70e7d6b0675fbfcff
|
7
|
+
data.tar.gz: 0cfb734dfaacaf93b379c91fffc5c324a62bf47c72a9df1e0bc85b5541f2c8e3882f06a0fb61d8a047921d2305543333c60bf19b153586fdc8e014b1aa3cee70
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
# Ziggeo Ruby Server SDK
|
1
|
+
# Ziggeo Ruby Server SDK
|
2
2
|
|
3
|
-
|
3
|
+
|
4
|
+
Ziggeo API (http://ziggeo.com) allows you to integrate video recording and playback with only
|
4
5
|
two lines of code in your site, service or app. This is the Ruby Server SDK repository.
|
5
6
|
|
6
7
|
Pull requests welcome.
|
@@ -18,33 +19,30 @@ gem "Ziggeo"
|
|
18
19
|
For the client-side integration, you need to add these assets to your html file:
|
19
20
|
|
20
21
|
```html
|
21
|
-
<link rel="stylesheet" href="//assets-cdn.ziggeo.com/
|
22
|
-
<script src="//assets-
|
22
|
+
<link rel="stylesheet" href="//assets-cdn.ziggeo.com/css/ziggeo-v1.css" />
|
23
|
+
<script src="//assets-csn.ziggeo.com/js/ziggeo-v1.js"></script>
|
23
24
|
```
|
24
25
|
|
25
26
|
Then, you need to specify your api token:
|
26
27
|
```html
|
27
28
|
<script>
|
28
|
-
|
29
|
-
token: "APPLICATION_TOKEN"
|
30
|
-
});
|
29
|
+
ZiggeoApi.token = "APPLICATION_TOKEN";
|
31
30
|
</script>
|
32
31
|
```
|
33
32
|
|
34
|
-
You can specify other global options, [see here](
|
33
|
+
You can specify other global options, [see here](http://ziggeo.com/docs#client-integration-header).
|
35
34
|
|
36
35
|
To fire up a recorder on your page, add:
|
37
36
|
```html
|
38
|
-
<
|
37
|
+
<ziggeo></ziggeo>
|
39
38
|
```
|
40
39
|
|
41
40
|
To embed a player for an existing video, add:
|
42
41
|
```html
|
43
|
-
<
|
42
|
+
<ziggeo ziggeo-video='video-token'></ziggeo>
|
44
43
|
```
|
45
44
|
|
46
|
-
For the full documentation, please visit [ziggeo.com](
|
47
|
-
|
45
|
+
For the full documentation, please visit [ziggeo.com](http://ziggeo.com/docs).
|
48
46
|
|
49
47
|
|
50
48
|
## Server-Side Integration
|
@@ -59,7 +57,7 @@ You can integrate the Server SDK as follows:
|
|
59
57
|
## Server-Side Methods
|
60
58
|
|
61
59
|
### Videos
|
62
|
-
|
60
|
+
|
63
61
|
The videos resource allows you to access all single videos. Each video may contain more than one stream.
|
64
62
|
|
65
63
|
|
@@ -76,20 +74,7 @@ Arguments
|
|
76
74
|
- skip: *Skip the first [n] entries.*
|
77
75
|
- reverse: *Reverse the order in which videos are returned.*
|
78
76
|
- states: *Filter videos by state*
|
79
|
-
- tags: *Filter the search result to certain tags
|
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*
|
77
|
+
- tags: *Filter the search result to certain tags*
|
93
78
|
|
94
79
|
|
95
80
|
#### Get
|
@@ -102,31 +87,6 @@ ziggeo.videos().get(token_or_key)
|
|
102
87
|
|
103
88
|
|
104
89
|
|
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
90
|
#### Download Video
|
131
91
|
|
132
92
|
Download the video data file
|
@@ -147,40 +107,6 @@ ziggeo.videos().download_image(token_or_key)
|
|
147
107
|
|
148
108
|
|
149
109
|
|
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
110
|
#### Update
|
185
111
|
|
186
112
|
Update single video by token or key.
|
@@ -198,23 +124,6 @@ Arguments
|
|
198
124
|
- expiration_days: *After how many days will this video be deleted*
|
199
125
|
|
200
126
|
|
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
127
|
#### Delete
|
219
128
|
|
220
129
|
Delete a single video by token or key.
|
@@ -242,23 +151,8 @@ Arguments
|
|
242
151
|
- volatile: *Automatically removed this video if it remains empty*
|
243
152
|
|
244
153
|
|
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
154
|
### Streams
|
261
|
-
|
155
|
+
|
262
156
|
The streams resource allows you to directly access all streams associated with a single video.
|
263
157
|
|
264
158
|
|
@@ -304,18 +198,6 @@ ziggeo.streams().download_image(video_token_or_key, token_or_key)
|
|
304
198
|
|
305
199
|
|
306
200
|
|
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
201
|
#### Delete
|
320
202
|
|
321
203
|
Delete the stream
|
@@ -373,7 +255,7 @@ ziggeo.streams().bind(video_token_or_key, token_or_key, arguments = nil)
|
|
373
255
|
|
374
256
|
|
375
257
|
### Authtokens
|
376
|
-
|
258
|
+
|
377
259
|
The auth token resource allows you to manage authorization settings for video objects.
|
378
260
|
|
379
261
|
|
@@ -431,297 +313,11 @@ Arguments
|
|
431
313
|
- grants: *Permissions this tokens grants*
|
432
314
|
|
433
315
|
|
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
316
|
|
721
317
|
|
722
318
|
|
723
319
|
## License
|
724
320
|
|
725
|
-
Copyright (c) 2013-
|
321
|
+
Copyright (c) 2013-2015 Ziggeo
|
726
322
|
|
727
|
-
Apache 2.0 License
|
323
|
+
Apache 2.0 License
|
data/lib/Ziggeo.rb
CHANGED
@@ -7,10 +7,6 @@ require_relative "classes/ZiggeoConfig"
|
|
7
7
|
require_relative "classes/ZiggeoConnect"
|
8
8
|
require_relative "classes/ZiggeoVideos"
|
9
9
|
require_relative "classes/ZiggeoStreams"
|
10
|
-
require_relative "classes/ZiggeoEffectProfiles"
|
11
|
-
require_relative "classes/ZiggeoEffectProfileProcess"
|
12
|
-
require_relative "classes/ZiggeoMetaProfiles"
|
13
|
-
require_relative "classes/ZiggeoMetaProfileProcess"
|
14
10
|
require_relative "classes/ZiggeoAuthtokens"
|
15
11
|
require_relative "classes/ZiggeoAuth"
|
16
12
|
|
@@ -25,10 +21,6 @@ class Ziggeo
|
|
25
21
|
@connect = ZiggeoConnect.new(self)
|
26
22
|
@videos = nil
|
27
23
|
@streams = nil
|
28
|
-
@effectProfiles = nil
|
29
|
-
@effectProfileProcess = nil
|
30
|
-
@metaProfiles = nil
|
31
|
-
@metaProfileProcess = nil
|
32
24
|
@authtokens = nil
|
33
25
|
@auth = nil
|
34
26
|
if (ENV["ZIGGEO_URL"] != nil)
|
@@ -55,20 +47,6 @@ class Ziggeo
|
|
55
47
|
return @streams
|
56
48
|
end
|
57
49
|
|
58
|
-
def metaProfiles()
|
59
|
-
if (@metaProfiles == nil)
|
60
|
-
@metaProfiles = ZiggeoMetaProfiles.new(self)
|
61
|
-
end
|
62
|
-
return @metaProfiles
|
63
|
-
end
|
64
|
-
|
65
|
-
def metaProfileProcess()
|
66
|
-
if (@metaProfileProcess == nil)
|
67
|
-
@metaProfileProcess = ZiggeoMetaProfileProcess.new(self)
|
68
|
-
end
|
69
|
-
return @metaProfileProcess
|
70
|
-
end
|
71
|
-
|
72
50
|
def authtokens()
|
73
51
|
if (@authtokens == nil)
|
74
52
|
@authtokens = ZiggeoAuthtokens.new(self)
|
data/lib/classes/ZiggeoConfig.rb
CHANGED
@@ -1,10 +1,7 @@
|
|
1
1
|
class ZiggeoConfig
|
2
|
-
attr_accessor :server_api_url
|
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
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'net/http'
|
2
2
|
require 'json'
|
3
3
|
require 'httparty'
|
4
|
-
require 'httmultiparty'
|
5
4
|
|
6
5
|
class ZiggeoConnect
|
7
6
|
def initialize(application)
|
@@ -9,46 +8,12 @@ class ZiggeoConnect
|
|
9
8
|
end
|
10
9
|
|
11
10
|
def request(method, path, data = nil, file = nil)
|
12
|
-
|
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)
|
11
|
+
url = URI.parse(@application.config.server_api_url + '/v1' + path)
|
21
12
|
auth = { username: @application.token, password: @application.private_key }
|
22
|
-
timeout_in_seconds = @application.config.request_timeout.to_i
|
23
|
-
|
24
13
|
method.downcase!
|
25
14
|
allowed_methods = %w(get post delete)
|
26
15
|
return unless allowed_methods.include?(method)
|
27
|
-
|
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
|
41
|
-
else
|
42
|
-
data = data.nil? ? {} : data;
|
43
|
-
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
|
16
|
+
HTTParty.send(method, url.to_s, body: data, basic_auth: auth).body
|
52
17
|
end
|
53
18
|
|
54
19
|
def requestJSON(method, path, data = nil, file = nil)
|
@@ -79,12 +44,4 @@ class ZiggeoConnect
|
|
79
44
|
return self.requestJSON("DELETE", path, data, file)
|
80
45
|
end
|
81
46
|
|
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
47
|
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
|
data/lib/classes/ZiggeoVideos.rb
CHANGED
@@ -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,43 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Ziggeo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.04'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ziggeo, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-10-31 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
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: httmultiparty
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
description: The Ziggeo Ruby and Rails Server SDK.
|
42
28
|
email:
|
43
29
|
- support@ziggeo.com
|
@@ -45,23 +31,17 @@ executables: []
|
|
45
31
|
extensions: []
|
46
32
|
extra_rdoc_files: []
|
47
33
|
files:
|
48
|
-
- README.md
|
49
|
-
- lib/Ziggeo.rb
|
50
|
-
- lib/classes/ZiggeoAnalytics.rb
|
51
34
|
- lib/classes/ZiggeoAuth.rb
|
52
35
|
- lib/classes/ZiggeoAuthtokens.rb
|
53
36
|
- lib/classes/ZiggeoConfig.rb
|
54
37
|
- 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
38
|
- lib/classes/ZiggeoStreams.rb
|
60
39
|
- lib/classes/ZiggeoVideos.rb
|
61
|
-
- lib/
|
62
|
-
|
40
|
+
- lib/Ziggeo.rb
|
41
|
+
- README.md
|
42
|
+
homepage: http://ziggeo.com
|
63
43
|
licenses:
|
64
|
-
- Apache
|
44
|
+
- Apache 2.0
|
65
45
|
metadata: {}
|
66
46
|
post_install_message:
|
67
47
|
rdoc_options: []
|
@@ -69,17 +49,17 @@ require_paths:
|
|
69
49
|
- lib
|
70
50
|
required_ruby_version: !ruby/object:Gem::Requirement
|
71
51
|
requirements:
|
72
|
-
- -
|
52
|
+
- - '>='
|
73
53
|
- !ruby/object:Gem::Version
|
74
54
|
version: '0'
|
75
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
56
|
requirements:
|
77
|
-
- -
|
57
|
+
- - '>='
|
78
58
|
- !ruby/object:Gem::Version
|
79
59
|
version: '0'
|
80
60
|
requirements: []
|
81
61
|
rubyforge_project:
|
82
|
-
rubygems_version: 2.
|
62
|
+
rubygems_version: 2.0.14
|
83
63
|
signing_key:
|
84
64
|
specification_version: 4
|
85
65
|
summary: The Ziggeo ServerSDK gem.
|
@@ -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
|