Browse Source

runtime fixes

master
Alison Watson 2 years ago
parent
commit
a21ffcd574
  1. 4
      fish/gender-swap
  2. 10
      text/gender-swap

4
fish/gender-swap

@ -1,7 +1,7 @@
#!/usr/bin/env fish
function gender-swap -d 'Swaps gender'
"$_agw_dir_rc"/text/gender-swap $args
function gender-swap -d 'Swaps gender' -a pro pre ali
"$_agw_dir_rc"/text/gender-swap $pro $pre $ali
end
## EOF

10
text/gender-swap

@ -13,11 +13,11 @@ require 'cgi'
def url_params param, key, output = {}
case
when param.is_a?(Array)
param.map.with_index do |v, k|
param.each.with_index do |v, k|
url_params(v, key + "[" + k.to_s + "]", output)
end
when param.is_a?(Hash)
param.map do |k, v|
param.each do |k, v|
url_params(v, key + "[" + k.to_s + "]", output)
end
else
@ -30,9 +30,9 @@ CLIENT_KEY = ENV["_agw_secret_gender_swap_client_key"]
CLIENT_SECRET = ENV["_agw_secret_gender_swap_client_secret"]
ACCESS_TOKEN = ENV["_agw_secret_gender_swap_access_token"]
ALIGNMENT = ARGV.pop
PRESENTATION = ARGV.pop
PRONOUNS = ARGV.pop.split("/").map do |pro|
ALIGNMENT = ARGV[2]
PRESENTATION = ARGV[1]
PRONOUNS = ARGV[0].split("/").map do |pro|
path = if pro == "they" then "they/.../themself" else pro end
%(<a href="http://pronoun.is/#{path}">#{pro}</a>)
end

Loading…
Cancel
Save