Skip to content

Commit 7fcada4

Browse files
committed
Explain how to upload and create video.
And explain a bit about jq and tranforming json.
1 parent 5ab807a commit 7fcada4

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

README.md

+44-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ A command-line interface for interacting with the SWITCHtube web service.
88

99
brew install fingertips/tap/teletube
1010

11+
If want to format or transform the resulting JSON is can be useful to install `jq`.
12+
13+
brew install jq
14+
1115
## From source
1216

1317
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
2630

2731
# Channels
2832

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.
3034

3135
teletube channels
3236

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.
3438

3539
teletube channels list --role owner
3640
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

Comments
 (0)