Created
April 4, 2017 17:41
-
-
Save muffinista/bcce21dec929c7aa436354622f98cb47 to your computer and use it in GitHub Desktop.
ruby version of LOVELETTERS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# this code is modified from | |
# | |
# https://github.com/gingerbeardman/loveletter | |
# | |
# any mistakes are certainly added from me | |
# | |
# this is the code for https://botsin.space/@loveletter | |
require 'mastodon' | |
token = ENV["MASTODON_TOKEN"] | |
client = Mastodon::REST::Client.new(base_url: 'https://botsin.space', bearer_token:token) | |
sals1 =["Beloved", "Darling", "Dear", "Dearest", "Fanciful", "Honey"] | |
sals2 = ["Chickpea", "Dear", "Duck", "Jewel", "Love", "Moppet", "Sweetheart"] | |
adjs = ["affectionate", "amorous", "anxious", "avid", "beautiful", "breathless", "burning", "covetous", "craving", "curious", "eager", "fervent", "fondest", "loveable", "lovesick", "loving", "passionate", "precious", "seductive", "sweet", "sympathetic", "tender", "unsatisfied", "winning", "wistful"] | |
nouns = ["adoration", "affection", "ambition", "appetite", "ardour", "being", "burning", "charm", "craving", "desire", "devotion", "eagerness", "enchantment", "enthusiasm", "fancy", "fellow feeling", "fervour", "fondness", "heart", "hunger", "infatuation", "little liking", "longing", "love", "lust", "passion", "rapture", "sympathy", "thirst", "wish", "yearning"] | |
advs = ["affectionately", "ardently", "anxiously", "beautifully", "burningly", "covetously", "curiously", "eagerly", "fervently", "fondly", "impatiently", "keenly", "lovingly", "passionately", "seductively", "tenderly", "wistfully"] | |
verbs = ["adores", "attracts", "clings to", "holds dear", "hopes for", "hungers for", "likes", "longs for", "loves", "lusts after", "pants for", "pines for", "sighs for", "tempts", "thirsts for", "treasures", "yearns for", "woos"] | |
def rando | |
rand(0..9) < 5 | |
end | |
space = " " | |
output = [] | |
salutation = [sals1.sample, sals2.sample, "\n#{space}"].join(" ") | |
lastcall = nil | |
output << salutation | |
concat = "" | |
1.upto(5) { | |
if rando | |
#LONG | |
optadj1 = rando ? '' : adjs.sample | |
noun1 = nouns.sample | |
optadv = rando ? '' : advs.sample | |
verb = verbs.sample | |
optadj2 = rando ? '' : adjs.sample | |
noun2 = nouns.sample | |
if (lastcall != nil || lastcall == :long) | |
concat = ". " | |
end | |
puts [concat, optadj1, noun1, optadv, verb, optadj2, noun2].inspect | |
line = ("%s My %s %s %s %s your %s %s" % [concat, optadj1, noun1, optadv, verb, optadj2, noun2]).squeeze(" ") | |
output << line | |
lastcall = :long | |
else | |
# SHORT | |
adj = adjs.sample | |
noun = nouns.sample | |
if lastcall == :short | |
concat = ", " | |
elsif lastcall == :long | |
concat = ". You are" | |
else | |
concat = "You are " | |
end | |
puts [concat, adj, noun].inspect | |
line = ("%s my %s %s" % [concat, adj, noun]).squeeze(" ") | |
output << line | |
lastcall = :short | |
end | |
} | |
adv = advs.sample | |
output << ".\n#{space}#{space}Yours %s,\n#{space}#{space}M.U.C.\n" % adv | |
output = output.join("").upcase | |
puts output | |
client.create_status(output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment