ubergeek42 / weechat-android

Simple Weechat-Relay Android Client
521 stars 103 forks source link

[enhancement] curl command shown in the File sharing settings could be dynamically affected by the settings user applies #547

Closed BrendanTCC closed 1 year ago

BrendanTCC commented 2 years ago

I have VERY little experience with android app development (not even sure I'm ready to have another crack), but here's an oddball idea for anyone interested in playing around with it:

In the File Sharing settings, an example curl command is shown:

curl -s --user user:pass \
--header 'Additional: Header' \
--form additional-field \
--form file=@file.ext \ https://example.com | perl -nle \
'm#^https://\S+#; print $1//$&'

Why not have the command shown dynamically affected by the settings the user saves, for those that happen to want to go down a rabbit hole of playing with curl, for the sake of playing with curl?

ie, let's say the url is set to https://ttm.sh, that the user:pass isn't, configured, and that there's no additional headers configured:

curl -s \
--form file=@file.ext \ 
https://ttm.sh | perl -nle \
'm#^https://\S+#; print $1//$&'

No hard feelings if this is deemed too idiotic to spend any brainpower on.

(edit: removed "--form additional-field \" from the second example because i was a goose and forgot about it)

oakkitten commented 2 years ago

I thought about doing exactly this but decided not to do it because: