@@ -8,6 +8,10 @@ A command-line interface for interacting with the SWITCHtube web service.
8
8
9
9
brew install fingertips/tap/teletube
10
10
11
+ If want to format or transform the resulting JSON is can be useful to install ` jq ` .
12
+
13
+ brew install jq
14
+
11
15
## From source
12
16
13
17
git clone https://github.com/Fingertips/teletube.git
@@ -26,11 +30,49 @@ If you need to operate on a different endpoint, usually for testing purposes, yo
26
30
27
31
# Channels
28
32
29
- Most interaction is around a channel so start by listing all channels you can upload to .
33
+ Start by listing all channels you can access .
30
34
31
35
teletube channels
32
36
33
- Alternatively you can limit the number of channels by filtering your own channels or the ones you don't own, but can upload to.
37
+ Or filter the channels you own, or the channels you may contribute to.
34
38
35
39
teletube channels list --role owner
36
40
teletube channels list --role contributor
41
+
42
+ # Upload a video
43
+
44
+ teletube files upload FILE.MOV
45
+
46
+ This should print a NO_CONTENT response for every 50 megabytes uploaded. Error messages are handled as long as the command keeps running.
47
+
48
+ Copy-paste the characters after 📃, this is the upload id.
49
+
50
+ You can use a channel id, upload id, and a title to create a new video with the upload.
51
+
52
+ teletube videos create --channel-id <id> --upload-id <id> --title "Very serious video about nature."
53
+
54
+ You can set other details about the video too, please use ` --help ` to see them.
55
+
56
+ teletube videos create --help
57
+
58
+ # Help
59
+
60
+ You can always end a command with ` --help ` to get more details. For example:
61
+
62
+ teletube --help
63
+ teletube browse --help
64
+ teletube browse poster --help
65
+
66
+ # JSON
67
+
68
+ Status information about the command is printed to ` stderr ` . JSON responses are written to ` stdout ` so you can use tools like ` jq ` to get details.
69
+
70
+ For example, you can format the JSON for readability.
71
+
72
+ teletube channels list --role owner | jq
73
+
74
+ Or you can transform it to only show the ` id ` and ` name ` .
75
+
76
+ teletube channels list --role owner | jq ".[] | {id: .id, name: .name}"
77
+
78
+ The best way to learn ` jq ` is through the tutorial [ https://stedolan.github.io/jq/tutorial/ ] ( https://stedolan.github.io/jq/tutorial/ ) and trying it out on [ https://jqplay.org ] ( https://jqplay.org ) .
0 commit comments