Last edit: @simpleurbanart in #ft_movies 11 months ago - Slack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)

if ((user.id ~= 'UA74M7VPF' and user.id ~= 'UANAKA332') and channel.type ~= "im") then
 print(string.format("\60@%s\62, this factoid is only available through messaging me directly.", user.id))
else
 local calid = 'ksiwskm4anhkfc5h92'		-- API only calid (multi-day events break this program lol)
 local public_calid = 'https://teamup.com/ks4amgm5k9628hgv55'	-- Full calid, printed for the public below
 local thing_name = 'showings'
 local daycount = tonumber(argv[1])		-- Days to display movies of
 local whenTable = { 'today', 'today & tomorrow' }
 local unt = nil
 local list_max = 12
 local movies_id = 'C2H9G55D1'
 local ftmovies_id = 'GCTSYQS0L'
 if daycount == nil then
  daycount = 1
 end
 if daycount ~= nil and daycount > 1 then
  unt = time.now()
  unt.day = unt.day + daycount
 end
 local respj = funcs.teamup_events(fmap.api_keys.teamup, calid, nil, unt)
 j = respj.events
 print('<#C2H9G55D1|movies> :clapper:\n\n')
 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\n\n')
 end
 for i=1,list_max do
  if j[i] ~= nil then
   local stime = time.parse(j[i].start_dt, "2006-01-02T15:04:05-07:00")
   local etime = time.parse(j[i].end_dt, "2006-01-02T15:04:05-07:00")
   local who = ""
   local notes = 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   if j[i].notes ~= "" then
    notes = j[i].notes
   end
   -- list of strings to replace (the order is important to avoid conflicts)
   local cleaner = {
    { "&amp;", "&" },	-- decode ampersands
    { "&#151;", "-" },	-- em dash
    { "&#146;", "'" },	-- right single quote
    { "&#147;", "\"" },	-- left double quote
    { "&#148;", "\"" },	-- right double quote
    { "&#150;", "-" },	-- en dash
    { "&#160;", " " },	-- non-breaking space
    { "<br ?/?>", "\n" },-- all <br> tags whether terminated or not (<br> <br/> <br />) become new lines
    { "</p>", "\n" },	-- ends of paragraphs become n!ew lines
    { "(%b<>)", "" },	-- all other html elements are completely swapped with ">" (must be done last)
    { "\r", "\n" },	-- return carriage become new lines
    { "[\n\n]+", "\n" },	-- reduce all multiple new lines with a single new line
    { "^\n*", "" },	-- trim new lines from the start...
    { "\n*$", "" },	-- ... and end
    }
   -- clean html from the string
   for i=1, #cleaner do
    local cleans = cleaner[i]
    notes = string.gsub( notes, cleans[1], cleans[2] )
   end
   if ((channel.type == "im" or channel.id == movies_id) or channel.id == ftmovies_id) then
    print('<' .. notes .. '|' .. j[i].title .. '>\n>' .. stime:format("Mon Jan 02 from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   else
    print('*' .. j[i].title .. '*\n' )
   end
   print('>Requested by ' .. who .. '\n')
  else 
   break 
  end
 end
 if ((channel.type ~= "im" and channel.id ~= movies_id) and channel.id ~= ftmovies_id) then
  print('\n*Join us in <#C2H9G55D1|movies> to see posters, times, and request a movie!*\n')
  print('\nDM \60@U2NNW0FPH\62 with `!movies` for more details.')
 else
 print('\n:calendar: <' .. public_calid .. '|Click here to view the full calendar>\n')
 end
end

History

Revision: 4299 by @simpleurbanart in #ft_movies 11 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)

if ((user.id ~= 'UA74M7VPF' and user.id ~= 'UANAKA332') and channel.type ~= "im") then
 print(string.format("\60@%s\62, this factoid is only available through messaging me directly.", user.id))
else
 local calid = 'ksiwskm4anhkfc5h92'		-- API only calid (multi-day events break this program lol)
 local public_calid = 'https://teamup.com/ks4amgm5k9628hgv55'	-- Full calid, printed for the public below
 local thing_name = 'showings'
 local daycount = tonumber(argv[1])		-- Days to display movies of
 local whenTable = { 'today', 'today & tomorrow' }
 local unt = nil
 local list_max = 12
 local movies_id = 'C2H9G55D1'
 local ftmovies_id = 'GCTSYQS0L'
 if daycount == nil then
  daycount = 1
 end
 if daycount ~= nil and daycount > 1 then
  unt = time.now()
  unt.day = unt.day + daycount
 end
 local respj = funcs.teamup_events(fmap.api_keys.teamup, calid, nil, unt)
 j = respj.events
 print('<#C2H9G55D1|movies> :clapper:\n\n')
 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\n\n')
 end
 for i=1,list_max do
  if j[i] ~= nil then
   local stime = time.parse(j[i].start_dt, "2006-01-02T15:04:05-07:00")
   local etime = time.parse(j[i].end_dt, "2006-01-02T15:04:05-07:00")
   local who = ""
   local notes = 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   if j[i].notes ~= "" then
    notes = j[i].notes
   end
   -- list of strings to replace (the order is important to avoid conflicts)
   local cleaner = {
    { "&amp;", "&" },	-- decode ampersands
    { "&#151;", "-" },	-- em dash
    { "&#146;", "'" },	-- right single quote
    { "&#147;", "\"" },	-- left double quote
    { "&#148;", "\"" },	-- right double quote
    { "&#150;", "-" },	-- en dash
    { "&#160;", " " },	-- non-breaking space
    { "<br ?/?>", "\n" },-- all <br> tags whether terminated or not (<br> <br/> <br />) become new lines
    { "</p>", "\n" },	-- ends of paragraphs become n!ew lines
    { "(%b<>)", "" },	-- all other html elements are completely swapped with ">" (must be done last)
    { "\r", "\n" },	-- return carriage become new lines
    { "[\n\n]+", "\n" },	-- reduce all multiple new lines with a single new line
    { "^\n*", "" },	-- trim new lines from the start...
    { "\n*$", "" },	-- ... and end
    }
   -- clean html from the string
   for i=1, #cleaner do
    local cleans = cleaner[i]
    notes = string.gsub( notes, cleans[1], cleans[2] )
   end
   if ((channel.type == "im" or channel.id == movies_id) or channel.id == ftmovies_id) then
    print('<' .. notes .. '|' .. j[i].title .. '>\n>' .. stime:format("Mon Jan 02 from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   else
    print('*' .. j[i].title .. '*\n' )
   end
   print('>Requested by ' .. who .. '\n')
  else 
   break 
  end
 end
 if ((channel.type ~= "im" and channel.id ~= movies_id) and channel.id ~= ftmovies_id) then
  print('\n*Join us in <#C2H9G55D1|movies> to see posters, times, and request a movie!*\n')
  print('\nDM \60@U2NNW0FPH\62 with `!movies` for more details.')
 else
 print('\n:calendar: <' .. public_calid .. '|Click here to view the full calendar>\n')
 end
end

Revision: 4298 by @simpleurbanart in #ft_movies 11 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)

if ((user.id ~= 'UA74M7VPF' and user.id ~= 'UANAKA332') and channel.type ~= "im") then
 print(string.format("\60@%s\62, this factoid is only available through messaging me directly.", user.id))
else
 local calid = 'ksiwskm4anhkfc5h92'		-- API only calid (multi-day events break this program lol)
 local public_calid = 'https://teamup.com/ks4amgm5k9628hgv55'	-- Full calid, printed for the public below
 local thing_name = 'showings'
 local daycount = tonumber(argv[1])		-- Days to display movies of
 local whenTable = { 'today', 'today & tomorrow' }
 local unt = nil
 local list_max = 12
 local movies_id = 'C2H9G55D1'
 local ftmovies_id = 'GCTSYQS0L'
 if daycount == nil then
  daycount = 1
 end
 if daycount ~= nil and daycount > 1 then
  unt = time.now()
  unt.day = unt.day + daycount
 end
 local respj = funcs.teamup_events(fmap.api_keys.teamup, calid, nil, unt)
 j = respj.events
 print('<#C2H9G55D1|movies> :clapper:\n\n')
 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\n\n')
 end
 for i=1,list_max do
  if j[i] ~= nil then
   local stime = time.parse(j[i].start_dt, "2006-01-02T15:04:05-07:00")
   local etime = time.parse(j[i].end_dt, "2006-01-02T15:04:05-07:00")
   local who = ""
   local notes = 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   if j[i].notes ~= "" then
    notes = j[i].notes
   end
   -- list of strings to replace (the order is important to avoid conflicts)
   local cleaner = {
    { "&amp;", "&" },	-- decode ampersands
    { "&#151;", "-" },	-- em dash
    { "&#146;", "'" },	-- right single quote
    { "&#147;", "\"" },	-- left double quote
    { "&#148;", "\"" },	-- right double quote
    { "&#150;", "-" },	-- en dash
    { "&#160;", " " },	-- non-breaking space
    { "<br ?/?>", "\n" },-- all <br> tags whether terminated or not (<br> <br/> <br />) become new lines
    { "</p>", "\n" },	-- ends of paragraphs become n!ew lines
    { "(%b<>)", "" },	-- all other html elements are completely swapped with ">" (must be done last)
    { "\r", "\n" },	-- return carriage become new lines
    { "[\n\n]+", "\n" },	-- reduce all multiple new lines with a single new line
    { "^\n*", "" },	-- trim new lines from the start...
    { "\n*$", "" },	-- ... and end
    }
   -- clean html from the string
   for i=1, #cleaner do
    local cleans = cleaner[i]
    notes = string.gsub( notes, cleans[1], cleans[2] )
   end
   if ((channel.type == "im" or channel.id == movies_id) or channel.id == ftmovies_id) then
    print('<' .. notes .. '|' .. j[i].title .. '>\n>' .. stime:format("Mon Jan 02 from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   else
    print('*' .. j[i].title .. '*\n' )
   end
   print('>Requested by ' .. who .. '\n')
  else 
   break 
  end
 end
 if (channel.type ~= "im" and channel.id ~= movies_id) then
  print('\n*Join us in <#C2H9G55D1|movies> to see posters, times, and request a movie!*\n')
  print('\nDM \60@U2NNW0FPH\62 with `!movies` for more details.')
 else
 print('\n:calendar: <' .. public_calid .. '|Click here to view the full calendar>\n')
 end
end

Revision: 4297 by @simpleurbanart in #ft_movies 11 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)

if ((user.id ~= 'UA74M7VPF' and user.id ~= 'UANAKA332') and channel.type ~= "im") then
 print(string.format("\60@%s\62, this factoid is only available through messaging me directly.", user.id))
else
 local calid = 'ksiwskm4anhkfc5h92'		-- API only calid (multi-day events break this program lol)
 local public_calid = 'https://teamup.com/ks4amgm5k9628hgv55'	-- Full calid, printed for the public below
 local thing_name = 'showings'
 local daycount = tonumber(argv[1])		-- Days to display movies of
 local whenTable = { 'today', 'today & tomorrow' }
 local unt = nil
 local list_max = 12
 local movies_id = 'C2H9G55D1'
 if daycount == nil then
  daycount = 1
 end
 if daycount ~= nil and daycount > 1 then
  unt = time.now()
  unt.day = unt.day + daycount
 end
 local respj = funcs.teamup_events(fmap.api_keys.teamup, calid, nil, unt)
 j = respj.events
 print('<#C2H9G55D1|movies> :clapper:\n\n')
 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\n\n')
 end
 for i=1,list_max do
  if j[i] ~= nil then
   local stime = time.parse(j[i].start_dt, "2006-01-02T15:04:05-07:00")
   local etime = time.parse(j[i].end_dt, "2006-01-02T15:04:05-07:00")
   local who = ""
   local notes = 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   if j[i].notes ~= "" then
    notes = j[i].notes
   end
   -- list of strings to replace (the order is important to avoid conflicts)
   local cleaner = {
    { "&amp;", "&" },	-- decode ampersands
    { "&#151;", "-" },	-- em dash
    { "&#146;", "'" },	-- right single quote
    { "&#147;", "\"" },	-- left double quote
    { "&#148;", "\"" },	-- right double quote
    { "&#150;", "-" },	-- en dash
    { "&#160;", " " },	-- non-breaking space
    { "<br ?/?>", "\n" },-- all <br> tags whether terminated or not (<br> <br/> <br />) become new lines
    { "</p>", "\n" },	-- ends of paragraphs become n!ew lines
    { "(%b<>)", "" },	-- all other html elements are completely swapped with ">" (must be done last)
    { "\r", "\n" },	-- return carriage become new lines
    { "[\n\n]+", "\n" },	-- reduce all multiple new lines with a single new line
    { "^\n*", "" },	-- trim new lines from the start...
    { "\n*$", "" },	-- ... and end
    }
   -- clean html from the string
   for i=1, #cleaner do
    local cleans = cleaner[i]
    notes = string.gsub( notes, cleans[1], cleans[2] )
   end
   if ((channel.type == "im" or channel.id == movies_id) or channel.type == "private") then
    print('<' .. notes .. '|' .. j[i].title .. '>\n>' .. stime:format("Mon Jan 02 from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   else
    print('*' .. j[i].title .. '*\n' )
   end
   print('>Requested by ' .. who .. '\n')
  else 
   break 
  end
 end
 if (channel.type ~= "im" and channel.id ~= movies_id) then
  print('\n*Join us in <#C2H9G55D1|movies> to see posters, times, and request a movie!*\n')
  print('\nDM \60@U2NNW0FPH\62 with `!movies` for more details.')
 else
 print('\n:calendar: <' .. public_calid .. '|Click here to view the full calendar>\n')
 end
end

Revision: 4290 by @simpleurbanart in #[IM @simpleurbanart] 11 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)

if ((user.id ~= 'UA74M7VPF' and user.id ~= 'UANAKA332') and channel.type ~= "im") then
 print(string.format("\60@%s\62, this factoid is only available through messaging me directly.", user.id))
else
 local calid = 'ksiwskm4anhkfc5h92'		-- API only calid (multi-day events break this program lol)
 local public_calid = 'https://teamup.com/ks4amgm5k9628hgv55'	-- Full calid, printed for the public below
 local thing_name = 'showings'
 local daycount = tonumber(argv[1])		-- Days to display movies of
 local whenTable = { 'today', 'today & tomorrow' }
 local unt = nil
 local list_max = 12
 local movies_id = 'C2H9G55D1'
 if daycount == nil then
  daycount = 1
 end
 if daycount ~= nil and daycount > 1 then
  unt = time.now()
  unt.day = unt.day + daycount
 end
 local respj = funcs.teamup_events(fmap.api_keys.teamup, calid, nil, unt)
 j = respj.events
 print('<#C2H9G55D1|movies> :clapper:\n\n')
 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\n\n')
 end
 for i=1,list_max do
  if j[i] ~= nil then
   local stime = time.parse(j[i].start_dt, "2006-01-02T15:04:05-07:00")
   local etime = time.parse(j[i].end_dt, "2006-01-02T15:04:05-07:00")
   local who = ""
   local notes = 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   if j[i].notes ~= "" then
    notes = j[i].notes
   end
   -- list of strings to replace (the order is important to avoid conflicts)
   local cleaner = {
    { "&amp;", "&" },	-- decode ampersands
    { "&#151;", "-" },	-- em dash
    { "&#146;", "'" },	-- right single quote
    { "&#147;", "\"" },	-- left double quote
    { "&#148;", "\"" },	-- right double quote
    { "&#150;", "-" },	-- en dash
    { "&#160;", " " },	-- non-breaking space
    { "<br ?/?>", "\n" },-- all <br> tags whether terminated or not (<br> <br/> <br />) become new lines
    { "</p>", "\n" },	-- ends of paragraphs become n!ew lines
    { "(%b<>)", "" },	-- all other html elements are completely swapped with ">" (must be done last)
    { "\r", "\n" },	-- return carriage become new lines
    { "[\n\n]+", "\n" },	-- reduce all multiple new lines with a single new line
    { "^\n*", "" },	-- trim new lines from the start...
    { "\n*$", "" },	-- ... and end
    }
   -- clean html from the string
   for i=1, #cleaner do
    local cleans = cleaner[i]
    notes = string.gsub( notes, cleans[1], cleans[2] )
   end
   if (channel.type == "im" or channel.id == movies_id) then
    print('<' .. notes .. '|' .. j[i].title .. '>\n>' .. stime:format("Mon Jan 02 from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   else
    print('*' .. j[i].title .. '*\n' )
   end
   print('>Requested by ' .. who .. '\n')
  else 
   break 
  end
 end
 if (channel.type ~= "im" and channel.id ~= movies_id) then
  print('\n*Join us in <#C2H9G55D1|movies> to see posters, times, and request a movie!*\n')
  print('\nDM \60@U2NNW0FPH\62 with `!movies` for more details.')
 else
 print('\n:calendar: <' .. public_calid .. '|Click here to view the full calendar>\n')
 end
end

Revision: 4209 by @simpleurbanart in #[IM @simpleurbanart] 11 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)

if ((user.id ~= 'UA74M7VPF' and user.id ~= 'UANAKA332') and channel.type ~= "im") then
 print(string.format("\60@%s\62, this factoid is only available through messaging me directly.", user.id))
else
 local calid = 'ksiwskm4anhkfc5h92'		-- API only calid (multi-day events break this program lol)
 local public_calid = 'https://teamup.com/ks4amgm5k9628hgv55'	-- Full calid, printed for the public below
 local thing_name = 'showings'
 local daycount = tonumber(argv[1])		-- Days to display movies of
 local whenTable = { 'today', 'today & tomorrow' }
 local unt = nil
 local list_max = 12
 if daycount == nil then
  daycount = 1
 end
 if daycount ~= nil and daycount > 1 then
  unt = time.now()
  unt.day = unt.day + daycount
 end
 local respj = funcs.teamup_events(fmap.api_keys.teamup, calid, nil, unt)
 j = respj.events
 print('<#C2H9G55D1|movies> :clapper:\n\n')
 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\n\n')
 end
 for i=1,list_max do
  if j[i] ~= nil then
   local stime = time.parse(j[i].start_dt, "2006-01-02T15:04:05-07:00")
   local etime = time.parse(j[i].end_dt, "2006-01-02T15:04:05-07:00")
   local who = ""
   local notes = 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   if j[i].notes ~= "" then
    notes = j[i].notes
   end
   -- list of strings to replace (the order is important to avoid conflicts)
   local cleaner = {
    { "&amp;", "&" },	-- decode ampersands
    { "&#151;", "-" },	-- em dash
    { "&#146;", "'" },	-- right single quote
    { "&#147;", "\"" },	-- left double quote
    { "&#148;", "\"" },	-- right double quote
    { "&#150;", "-" },	-- en dash
    { "&#160;", " " },	-- non-breaking space
    { "<br ?/?>", "\n" },-- all <br> tags whether terminated or not (<br> <br/> <br />) become new lines
    { "</p>", "\n" },	-- ends of paragraphs become n!ew lines
    { "(%b<>)", "" },	-- all other html elements are completely swapped with ">" (must be done last)
    { "\r", "\n" },	-- return carriage become new lines
    { "[\n\n]+", "\n" },	-- reduce all multiple new lines with a single new line
    { "^\n*", "" },	-- trim new lines from the start...
    { "\n*$", "" },	-- ... and end
    }
   -- clean html from the string
   for i=1, #cleaner do
    local cleans = cleaner[i]
    notes = string.gsub( notes, cleans[1], cleans[2] )
   end
   print('<' .. notes .. '|' .. j[i].title .. '>\n>' .. stime:format("Mon Jan 02 from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('>Requested by ' .. who .. '\n')
  else 
   break 
  end
 end
 print('\n:calendar: <' .. public_calid .. '|Click here to view the full calendar>\n')
end

Revision: 4208 by @simpleurbanart in #[IM @simpleurbanart] 11 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)

if ((user.id ~= 'UA74M7VPF' and user.id ~= 'UANAKA332') and channel.type ~= "im") then
 print(string.format("\60@%s\62, this factoid is only available through messaging me directly.", user.id))
else
 local calid = 'ksiwskm4anhkfc5h92'		-- API only calid (multi-day events break this program lol)
 local public_calid = 'https://teamup.com/ks4amgm5k9628hgv55'	-- Full calid, printed for the public below
 local thing_name = 'showings'
 local daycount = tonumber(argv[1])		-- Days to display movies of
 local whenTable = { 'today', 'today & tomorrow' }
 local unt = nil
 local list_max = 12
 if daycount == nil then
  daycount = 1
 end
 if daycount ~= nil and daycount > 1 then
  unt = time.now()
  unt.day = unt.day + daycount
 end
 local respj = funcs.teamup_events(fmap.api_keys.teamup, calid, nil, unt)
 j = respj.events
 print('<#C2H9G55D1|movies> :clapper:\n\n')
 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\n\n')
 end
 for i=1,list_max do
  if j[i] ~= nil then
   local stime = time.parse(j[i].start_dt, "2006-01-02T15:04:05-07:00")
   local etime = time.parse(j[i].end_dt, "2006-01-02T15:04:05-07:00")
   local who = ""
   local notes = 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   if j[i].notes ~= "" then
    notes = j[i].notes
   end
   -- list of strings to replace (the order is important to avoid conflicts)
   local cleaner = {
    { "&amp;", "&" },	-- decode ampersands
    { "&#151;", "-" },	-- em dash
    { "&#146;", "'" },	-- right single quote
    { "&#147;", "\"" },	-- left double quote
    { "&#148;", "\"" },	-- right double quote
    { "&#150;", "-" },	-- en dash
    { "&#160;", " " },	-- non-breaking space
    { "<br ?/?>", "\n" },-- all <br> tags whether terminated or not (<br> <br/> <br />) become new lines
    { "</p>", "\n" },	-- ends of paragraphs become n!ew lines
    { "(%b<>)", "" },	-- all other html elements are completely swapped with ">" (must be done last)
    { "\r", "\n" },	-- return carriage become new lines
    { "[\n\n]+", "\n" },	-- reduce all multiple new lines with a single new line
    { "^\n*", "" },	-- trim new lines from the start...
    { "\n*$", "" },	-- ... and end
    }
   -- clean html from the string
   for i=1, #cleaner do
    local cleans = cleaner[i]
    notes = string.gsub( notes, cleans[1], cleans[2] )
   end
   print(' <' .. notes .. '|' .. j[i].title .. '>\n>' .. stime:format("Mon Jan 02 from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('> Requested by ' .. who .. '\n')
  else 
   break 
  end
 end
 print('\n:calendar: <' .. public_calid .. '|Click here to view the full calendar>\n')
end

Revision: 4206 by @simpleurbanart in #[IM @simpleurbanart] 11 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)

if ((user.id ~= 'UA74M7VPF' and user.id ~= 'UANAKA332') and channel.type ~= "im") then
 print(string.format("\60@%s\62, this factoid is only available through messaging me directly.", user.id))
else
 local calid = 'ksiwskm4anhkfc5h92'		-- API only calid (multi-day events break this program lol)
 local public_calid = 'https://teamup.com/ks4amgm5k9628hgv55'	-- Full calid, printed for the public below
 local thing_name = 'showings'
 local daycount = tonumber(argv[1])		-- Days to display movies of
 local whenTable = { 'today', 'today & tomorrow' }
 local unt = nil
 local list_max = 12
 if daycount == nil then
  daycount = 1
 end
 if daycount ~= nil and daycount > 1 then
  unt = time.now()
  unt.day = unt.day + daycount
 end
 local respj = funcs.teamup_events(fmap.api_keys.teamup, calid, nil, unt)
 j = respj.events
 print('<#C2H9G55D1|movies> :clapper:\n\n')
 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\n\n')
 end
 for i=1,list_max do
  if j[i] ~= nil then
   local stime = time.parse(j[i].start_dt, "2006-01-02T15:04:05-07:00")
   local etime = time.parse(j[i].end_dt, "2006-01-02T15:04:05-07:00")
   local who = ""
   local notes = 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   if j[i].notes ~= "" then
    notes = j[i].notes
   end
   -- list of strings to replace (the order is important to avoid conflicts)
   local cleaner = {
    { "&amp;", "&" },	-- decode ampersands
    { "&#151;", "-" },	-- em dash
    { "&#146;", "'" },	-- right single quote
    { "&#147;", "\"" },	-- left double quote
    { "&#148;", "\"" },	-- right double quote
    { "&#150;", "-" },	-- en dash
    { "&#160;", " " },	-- non-breaking space
    { "<br ?/?>", "\n" },-- all <br> tags whether terminated or not (<br> <br/> <br />) become new lines
    { "</p>", "\n" },	-- ends of paragraphs become n!ew lines
    { "(%b<>)", "" },	-- all other html elements are completely swapped with ">" (must be done last)
    { "\r", "\n" },	-- return carriage become new lines
    { "[\n\n]+", "\n" },	-- reduce all multiple new lines with a single new line
    { "^\n*", "" },	-- trim new lines from the start...
    { "\n*$", "" },	-- ... and end
    }
   -- clean html from the string
   for i=1, #cleaner do
    local cleans = cleaner[i]
    notes = string.gsub( notes, cleans[1], cleans[2] )
   end
   print('<' .. notes .. '|' .. j[i].title .. '>\n>' .. stime:format("Mon Jan 02 from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('> Requested by ' .. who .. '\n')
  else 
   break 
  end
 end
 print('\n:calendar: <' .. public_calid .. '|Click here to view the full calendar>\n')
end

Revision: 4205 (deleted) by @simpleurbanart in #[IM @simpleurbanart] 11 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)

if ((user.id ~= 'UA74M7VPF' and user.id ~= 'UANAKA332') and channel.type ~= "im") then
 print(string.format("\60@%s\62, this factoid is only available through messaging me directly.", user.id))
else
 local calid = 'ksiwskm4anhkfc5h92'		-- API only calid (multi-day events break this program lol)
 local public_calid = 'https://teamup.com/ks4amgm5k9628hgv55'	-- Full calid, printed for the public below
 local thing_name = 'showings'
 local daycount = tonumber(argv[1])		-- Days to display movies of
 local whenTable = { 'today', 'today & tomorrow' }
 local unt = nil
 local list_max = 12
 if daycount == nil then
  daycount = 1
 end
 if daycount ~= nil and daycount > 1 then
  unt = time.now()
  unt.day = unt.day + daycount
 end
 local respj = funcs.teamup_events(fmap.api_keys.teamup, calid, nil, unt)
 j = respj.events
 print('<#C2H9G55D1|movies> :clapper:\n\n')
 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\n\n')
 end
 for i=1,list_max do
  if j[i] ~= nil then
   local stime = time.parse(j[i].start_dt, "2006-01-02T15:04:05-07:00")
   local etime = time.parse(j[i].end_dt, "2006-01-02T15:04:05-07:00")
   local who = ""
   local notes = 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   if j[i].notes ~= "" then
    notes = j[i].notes
   end
   -- list of strings to replace (the order is important to avoid conflicts)
   local cleaner = {
    { "&amp;", "&" },	-- decode ampersands
    { "&#151;", "-" },	-- em dash
    { "&#146;", "'" },	-- right single quote
    { "&#147;", "\"" },	-- left double quote
    { "&#148;", "\"" },	-- right double quote
    { "&#150;", "-" },	-- en dash
    { "&#160;", " " },	-- non-breaking space
    { "<br ?/?>", "\n" },-- all <br> tags whether terminated or not (<br> <br/> <br />) become new lines
    { "</p>", "\n" },	-- ends of paragraphs become n!ew lines
    { "(%b<>)", "" },	-- all other html elements are completely swapped with ">" (must be done last)
    { "\r", "\n" },	-- return carriage become new lines
    { "[\n\n]+", "\n" },	-- reduce all multiple new lines with a single new line
    { "^\n*", "" },	-- trim new lines from the start...
    { "\n*$", "" },	-- ... and end
    }
   -- clean html from the string
   for i=1, #cleaner do
    local cleans = cleaner[i]
    notes = string.gsub( notes, cleans[1], cleans[2] )
   end
   print('<' .. notes .. '|' .. j[i].title .. '>\n>' .. stime:format("Mon Jan 02 from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('> Requested by ' .. who .. '\n')
  else 
   break 
  end
 end
 print(':calendar: <' .. public_calid .. '|Click here to view the full calendar>\n')
end

Revision: 4204 (deleted) by @simpleurbanart in #[IM @simpleurbanart] 11 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)

if ((user.id ~= 'UA74M7VPF' and user.id ~= 'UANAKA332') and channel.type ~= "im") then
 print(string.format("\60@%s\62, this factoid is only available through messaging me directly.", user.id))
else
 local calid = 'ksiwskm4anhkfc5h92'		-- API only calid (multi-day events break this program lol)
 local public_calid = 'https://teamup.com/ks4amgm5k9628hgv55'	-- Full calid, printed for the public below
 local thing_name = 'showings'
 local daycount = tonumber(argv[1])		-- Days to display movies of
 local whenTable = { 'today', 'today & tomorrow' }
 local unt = nil
 local list_max = 12
 if daycount == nil then
  daycount = 1
 end
 if daycount ~= nil and daycount > 1 then
  unt = time.now()
  unt.day = unt.day + daycount
 end
 local respj = funcs.teamup_events(fmap.api_keys.teamup, calid, nil, unt)
 j = respj.events
 print('<#C2H9G55D1|movies> :clapper:\n\n')
 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\n\n')
 end
 for i=1,list_max do
  if j[i] ~= nil then
   local stime = time.parse(j[i].start_dt, "2006-01-02T15:04:05-07:00")
   local etime = time.parse(j[i].end_dt, "2006-01-02T15:04:05-07:00")
   local who = ""
   local notes = 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   if j[i].notes ~= "" then
    notes = j[i].notes
   end
   -- list of strings to replace (the order is important to avoid conflicts)
   local cleaner = {
    { "&amp;", "&" },	-- decode ampersands
    { "&#151;", "-" },	-- em dash
    { "&#146;", "'" },	-- right single quote
    { "&#147;", "\"" },	-- left double quote
    { "&#148;", "\"" },	-- right double quote
    { "&#150;", "-" },	-- en dash
    { "&#160;", " " },	-- non-breaking space
    { "<br ?/?>", "\n" },-- all <br> tags whether terminated or not (<br> <br/> <br />) become new lines
    { "</p>", "\n" },	-- ends of paragraphs become n!ew lines
    { "(%b<>)", "" },	-- all other html elements are completely swapped with ">" (must be done last)
    { "\r", "\n" },	-- return carriage become new lines
    { "[\n\n]+", "\n" },	-- reduce all multiple new lines with a single new line
    { "^\n*", "" },	-- trim new lines from the start...
    { "\n*$", "" },	-- ... and end
    }
   -- clean html from the string
   for i=1, #cleaner do
    local cleans = cleaner[i]
    notes = string.gsub( notes, cleans[1], cleans[2] )
   end
   print('<' .. notes .. '|' .. j[i].title .. '>\n>' .. stime:format("Mon Jan 02 from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('> Requested by ' .. who .. '\n')
  else 
   break 
  end
 end
 print('>:calendar: <' .. public_calid .. '|Click here to view the full calendar>\n')
end

Revision: 4203 (deleted) by @simpleurbanart in #[IM @simpleurbanart] 11 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)

if ((user.id ~= 'UA74M7VPF' and user.id ~= 'UANAKA332') and channel.type ~= "im") then
 print(string.format("\60@%s\62, this factoid is only available through messaging me directly.", user.id))
else
 local calid = 'ksiwskm4anhkfc5h92'		-- API only calid (multi-day events break this program lol)
 local public_calid = 'https://teamup.com/ks4amgm5k9628hgv55'	-- Full calid, printed for the public below
 local thing_name = 'showings'
 local daycount = tonumber(argv[1])		-- Days to display movies of
 local whenTable = { 'today', 'today & tomorrow' }
 local unt = nil
 local list_max = 12
 if daycount == nil then
  daycount = 1
 end
 if daycount ~= nil and daycount > 1 then
  unt = time.now()
  unt.day = unt.day + daycount
 end
 local respj = funcs.teamup_events(fmap.api_keys.teamup, calid, nil, unt)
 j = respj.events
 print('<#C2H9G55D1|movies> :clapper:\n\n')
 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\n\n')
 end
 for i=1,list_max do
  if j[i] ~= nil then
   local stime = time.parse(j[i].start_dt, "2006-01-02T15:04:05-07:00")
   local etime = time.parse(j[i].end_dt, "2006-01-02T15:04:05-07:00")
   local who = ""
   local notes = 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   if j[i].notes ~= "" then
    notes = j[i].notes
   end
   -- list of strings to replace (the order is important to avoid conflicts)
   local cleaner = {
    { "&amp;", "&" },	-- decode ampersands
    { "&#151;", "-" },	-- em dash
    { "&#146;", "'" },	-- right single quote
    { "&#147;", "\"" },	-- left double quote
    { "&#148;", "\"" },	-- right double quote
    { "&#150;", "-" },	-- en dash
    { "&#160;", " " },	-- non-breaking space
    { "<br ?/?>", "\n" },-- all <br> tags whether terminated or not (<br> <br/> <br />) become new lines
    { "</p>", "\n" },	-- ends of paragraphs become n!ew lines
    { "(%b<>)", "" },	-- all other html elements are completely swapped with ">" (must be done last)
    { "\r", "\n" },	-- return carriage become new lines
    { "[\n\n]+", "\n" },	-- reduce all multiple new lines with a single new line
    { "^\n*", "" },	-- trim new lines from the start...
    { "\n*$", "" },	-- ... and end
    }
   -- clean html from the string
   for i=1, #cleaner do
    local cleans = cleaner[i]
    notes = string.gsub( notes, cleans[1], cleans[2] )
   end
   print('<' .. notes .. '|' .. j[i].title .. '>\n>' .. stime:format("Mon Jan 02 from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('> Requested by ' .. who .. '\n')
  else 
   break 
  end
 end
 print('>:calendar: <public_calid|Click here to view the full calendar>\n')
end

Revision: 4202 by @simpleurbanart in #[IM @simpleurbanart] 11 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)

if ((user.id ~= 'UA74M7VPF' and user.id ~= 'UANAKA332') and channel.type ~= "im") then
 print(string.format("\60@%s\62, this factoid is only available through messaging me directly.", user.id))
else
 local calid = 'ksiwskm4anhkfc5h92'		-- API only calid (multi-day events break this program lol)
 local public_calid = 'https://teamup.com/ks4amgm5k9628hgv55'	-- Full calid, printed for the public below
 local thing_name = 'showings'
 local daycount = tonumber(argv[1])		-- Days to display movies of
 local whenTable = { 'today', 'today & tomorrow' }
 local unt = nil
 local list_max = 12
 if daycount == nil then
  daycount = 1
 end
 if daycount ~= nil and daycount > 1 then
  unt = time.now()
  unt.day = unt.day + daycount
 end
 local respj = funcs.teamup_events(fmap.api_keys.teamup, calid, nil, unt)
 j = respj.events
 print('<#C2H9G55D1|movies> :clapper:\n\n')
 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\n\n')
 end
 for i=1,list_max do
  if j[i] ~= nil then
   local stime = time.parse(j[i].start_dt, "2006-01-02T15:04:05-07:00")
   local etime = time.parse(j[i].end_dt, "2006-01-02T15:04:05-07:00")
   local who = ""
   local notes = 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   if j[i].notes ~= "" then
    notes = j[i].notes
   end
   -- list of strings to replace (the order is important to avoid conflicts)
   local cleaner = {
    { "&amp;", "&" },	-- decode ampersands
    { "&#151;", "-" },	-- em dash
    { "&#146;", "'" },	-- right single quote
    { "&#147;", "\"" },	-- left double quote
    { "&#148;", "\"" },	-- right double quote
    { "&#150;", "-" },	-- en dash
    { "&#160;", " " },	-- non-breaking space
    { "<br ?/?>", "\n" },-- all <br> tags whether terminated or not (<br> <br/> <br />) become new lines
    { "</p>", "\n" },	-- ends of paragraphs become n!ew lines
    { "(%b<>)", "" },	-- all other html elements are completely swapped with ">" (must be done last)
    { "\r", "\n" },	-- return carriage become new lines
    { "[\n\n]+", "\n" },	-- reduce all multiple new lines with a single new line
    { "^\n*", "" },	-- trim new lines from the start...
    { "\n*$", "" },	-- ... and end
    }
   -- clean html from the string
   for i=1, #cleaner do
    local cleans = cleaner[i]
    notes = string.gsub( notes, cleans[1], cleans[2] )
   end
   print('<' .. notes .. '|' .. j[i].title .. '>\n>' .. stime:format("Mon Jan 02 from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('> Requested by ' .. who .. '\n')
  else 
   break 
  end
 end
 print(>':calendar: <public_calid|Click here to view the full calendar>\n)
end

Revision: 4201 by @simpleurbanart in #[IM @simpleurbanart] 11 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)

if ((user.id ~= 'UA74M7VPF' and user.id ~= 'UANAKA332') and channel.type ~= "im") then
 print(string.format("\60@%s\62, this factoid is only available through messaging me directly.", user.id))
else
 local calid = 'ksiwskm4anhkfc5h92'		-- API only calid (multi-day events break this program lol)
 local public_calid = 'ks4amgm5k9628hgv55'	-- Full calid, printed for the public below
 local thing_name = 'showings'
 local daycount = tonumber(argv[1])		-- Days to display movies of
 local whenTable = { 'today', 'today & tomorrow' }
 local unt = nil
 local list_max = 12
 if daycount == nil then
  daycount = 1
 end
 if daycount ~= nil and daycount > 1 then
  unt = time.now()
  unt.day = unt.day + daycount
 end
 local respj = funcs.teamup_events(fmap.api_keys.teamup, calid, nil, unt)
 j = respj.events
 print('<#C2H9G55D1|movies> :clapper:\n\n')
 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\n\n')
 end
 for i=1,list_max do
  if j[i] ~= nil then
   local stime = time.parse(j[i].start_dt, "2006-01-02T15:04:05-07:00")
   local etime = time.parse(j[i].end_dt, "2006-01-02T15:04:05-07:00")
   local who = ""
   local notes = 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   if j[i].notes ~= "" then
    notes = j[i].notes
   end
   -- list of strings to replace (the order is important to avoid conflicts)
   local cleaner = {
    { "&amp;", "&" },	-- decode ampersands
    { "&#151;", "-" },	-- em dash
    { "&#146;", "'" },	-- right single quote
    { "&#147;", "\"" },	-- left double quote
    { "&#148;", "\"" },	-- right double quote
    { "&#150;", "-" },	-- en dash
    { "&#160;", " " },	-- non-breaking space
    { "<br ?/?>", "\n" },-- all <br> tags whether terminated or not (<br> <br/> <br />) become new lines
    { "</p>", "\n" },	-- ends of paragraphs become n!ew lines
    { "(%b<>)", "" },	-- all other html elements are completely swapped with ">" (must be done last)
    { "\r", "\n" },	-- return carriage become new lines
    { "[\n\n]+", "\n" },	-- reduce all multiple new lines with a single new line
    { "^\n*", "" },	-- trim new lines from the start...
    { "\n*$", "" },	-- ... and end
    }
   -- clean html from the string
   for i=1, #cleaner do
    local cleans = cleaner[i]
    notes = string.gsub( notes, cleans[1], cleans[2] )
   end
   print('<' .. notes .. '|' .. j[i].title .. '>\n>' .. stime:format("Mon Jan 02 from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('> Requested by ' .. who .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4200 by @simpleurbanart in #[IM @simpleurbanart] 11 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)

if ((user.id ~= 'UA74M7VPF' and user.id ~= 'UANAKA332') and channel.type ~= "im") then
 print(string.format("\60@%s\62, this factoid is only available through messaging me directly.", user.id))
else
 local calid = 'ksiwskm4anhkfc5h92'		-- API only calid (multi-day events break this program lol)
 local public_calid = 'ks4amgm5k9628hgv55'	-- Full calid, printed for the public below
 local thing_name = 'showings'
 local daycount = tonumber(argv[1])		-- Days to display movies of
 local whenTable = { 'today', 'today & tomorrow' }
 local unt = nil
 local list_max = 12
 if daycount == nil then
  daycount = 1
 end
 if daycount ~= nil and daycount > 1 then
  unt = time.now()
  unt.day = unt.day + daycount
 end
 local respj = funcs.teamup_events(fmap.api_keys.teamup, calid, nil, unt)
 j = respj.events
 print('<#C2H9G55D1|movies> :clapper:\n\n')
 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\n\n')
 end
 for i=1,list_max do
  if j[i] ~= nil then
   local stime = time.parse(j[i].start_dt, "2006-01-02T15:04:05-07:00")
   local etime = time.parse(j[i].end_dt, "2006-01-02T15:04:05-07:00")
   local who = ""
   local notes = 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   if j[i].notes ~= "" then
    notes = j[i].notes
   end
   -- list of strings to replace (the order is important to avoid conflicts)
   local cleaner = {
    { "&amp;", "&" },	-- decode ampersands
    { "&#151;", "-" },	-- em dash
    { "&#146;", "'" },	-- right single quote
    { "&#147;", "\"" },	-- left double quote
    { "&#148;", "\"" },	-- right double quote
    { "&#150;", "-" },	-- en dash
    { "&#160;", " " },	-- non-breaking space
    { "<br ?/?>", "\n" },-- all <br> tags whether terminated or not (<br> <br/> <br />) become new lines
    { "</p>", "\n" },	-- ends of paragraphs become n!ew lines
    { "(%b<>)", "" },	-- all other html elements are completely swapped with ">" (must be done last)
    { "\r", "\n" },	-- return carriage become new lines
    { "[\n\n]+", "\n" },	-- reduce all multiple new lines with a single new line
    { "^\n*", "" },	-- trim new lines from the start...
    { "\n*$", "" },	-- ... and end
    }
   -- clean html from the string
   for i=1, #cleaner do
    local cleans = cleaner[i]
    notes = string.gsub( notes, cleans[1], cleans[2] )
   end
   print('<' .. notes .. '|' .. j[i].title .. '>\n>' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('> Requested by ' .. who .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4199 (deleted) by @simpleurbanart in #[IM @simpleurbanart] 11 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)

if ((user.id ~= 'UA74M7VPF' and user.id ~= 'UANAKA332') and channel.type ~= "im") then
 print(string.format("\60@%s\62, this factoid is only available through messaging me directly.", user.id))
else
 local calid = 'ksiwskm4anhkfc5h92'		-- API only calid (multi-day events break this program lol)
 local public_calid = 'ks4amgm5k9628hgv55'	-- Full calid, printed for the public below
 local thing_name = 'showings'
 local daycount = tonumber(argv[1])		-- Days to display movies of
 local whenTable = { 'today', 'today & tomorrow' }
 local unt = nil
 local list_max = 12
 if daycount == nil then
  daycount = 1
 end
 if daycount ~= nil and daycount > 1 then
  unt = time.now()
  unt.day = unt.day + daycount
 end
 local respj = funcs.teamup_events(fmap.api_keys.teamup, calid, nil, unt)
 j = respj.events
 print('<#C2H9G55D1|movies> :clapper:\n\n')
 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\n\n')
 end
 for i=1,list_max do
  if j[i] ~= nil then
   local stime = time.parse(j[i].start_dt, "2006-01-02T15:04:05-07:00")
   local etime = time.parse(j[i].end_dt, "2006-01-02T15:04:05-07:00")
   local who = ""
   local notes = 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   if j[i].notes ~= "" then
    notes = j[i].notes
   end
   -- list of strings to replace (the order is important to avoid conflicts)
   local cleaner = {
    { "&amp;", "&" },	-- decode ampersands
    { "&#151;", "-" },	-- em dash
    { "&#146;", "'" },	-- right single quote
    { "&#147;", "\"" },	-- left double quote
    { "&#148;", "\"" },	-- right double quote
    { "&#150;", "-" },	-- en dash
    { "&#160;", " " },	-- non-breaking space
    { "<br ?/?>", "\n" },-- all <br> tags whether terminated or not (<br> <br/> <br />) become new lines
    { "</p>", "\n" },	-- ends of paragraphs become n!ew lines
    { "(%b<>)", "" },	-- all other html elements are completely swapped with ">" (must be done last)
    { "\r", "\n" },	-- return carriage become new lines
    { "[\n\n]+", "\n" },	-- reduce all multiple new lines with a single new line
    { "^\n*", "" },	-- trim new lines from the start...
    { "\n*$", "" },	-- ... and end
    }
   -- clean html from the string
   for i=1, #cleaner do
    local cleans = cleaner[i]
    notes = string.gsub( notes, cleans[1], cleans[2] )
   end
   print('<' .. notes .. '|' .. j[i].title .. '>\n')
   print('>' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('> Requested by ' .. who .. '\n')
   end
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4198 by @simpleurbanart in #[IM @simpleurbanart] 11 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)

if ((user.id ~= 'UA74M7VPF' and user.id ~= 'UANAKA332') and channel.type ~= "im") then
 print(string.format("\60@%s\62, this factoid is only available through messaging me directly.", user.id))
else
 local calid = 'ksiwskm4anhkfc5h92'		-- API only calid (multi-day events break this program lol)
 local public_calid = 'ks4amgm5k9628hgv55'	-- Full calid, printed for the public below
 local thing_name = 'showings'
 local daycount = tonumber(argv[1])		-- Days to display movies of
 local whenTable = { 'today', 'today & tomorrow' }
 local unt = nil
 local list_max = 12
 if daycount == nil then
  daycount = 1
 end
 if daycount ~= nil and daycount > 1 then
  unt = time.now()
  unt.day = unt.day + daycount
 end
 local respj = funcs.teamup_events(fmap.api_keys.teamup, calid, nil, unt)
 j = respj.events
 print('<#C2H9G55D1|movies> :clapper:\n\n')
 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\n\n')
 end
 for i=1,list_max do
  if j[i] ~= nil then
   local stime = time.parse(j[i].start_dt, "2006-01-02T15:04:05-07:00")
   local etime = time.parse(j[i].end_dt, "2006-01-02T15:04:05-07:00")
   local who = ""
   local notes = 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   if j[i].notes ~= "" then
    notes = j[i].notes
   end
   -- list of strings to replace (the order is important to avoid conflicts)
   local cleaner = {
    { "&amp;", "&" },	-- decode ampersands
    { "&#151;", "-" },	-- em dash
    { "&#146;", "'" },	-- right single quote
    { "&#147;", "\"" },	-- left double quote
    { "&#148;", "\"" },	-- right double quote
    { "&#150;", "-" },	-- en dash
    { "&#160;", " " },	-- non-breaking space
    { "<br ?/?>", "\n" },-- all <br> tags whether terminated or not (<br> <br/> <br />) become new lines
    { "</p>", "\n" },	-- ends of paragraphs become n!ew lines
    { "(%b<>)", "" },	-- all other html elements are completely swapped with ">" (must be done last)
    { "\r", "\n" },	-- return carriage become new lines
    { "[\n\n]+", "\n" },	-- reduce all multiple new lines with a single new line
    { "^\n*", "" },	-- trim new lines from the start...
    { "\n*$", "" },	-- ... and end
    }
   -- clean html from the string
   for i=1, #cleaner do
    local cleans = cleaner[i]
    notes = string.gsub( notes, cleans[1], cleans[2] )
   end
   print('<' .. notes .. '|' .. j[i].title .. '>\n>' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   if who ~= "" then
    print('> Requested by ' .. who .. '\n')
   end
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4197 by @simpleurbanart in #[IM @simpleurbanart] 11 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)

if ((user.id ~= 'UA74M7VPF' and user.id ~= 'UANAKA332') and channel.type ~= "im") then
 print(string.format("\60@%s\62, this factoid is only available through messaging me directly.", user.id))
else
 local calid = 'ksiwskm4anhkfc5h92'		-- API only calid (multi-day events break this program lol)
 local public_calid = 'ks4amgm5k9628hgv55'	-- Full calid, printed for the public below
 local thing_name = 'showings'
 local daycount = tonumber(argv[1])		-- Days to display movies of
 local whenTable = { 'today', 'today & tomorrow' }
 local unt = nil
 local list_max = 12
 if daycount == nil then
  daycount = 1
 end
 if daycount ~= nil and daycount > 1 then
  unt = time.now()
  unt.day = unt.day + daycount
 end
 local respj = funcs.teamup_events(fmap.api_keys.teamup, calid, nil, unt)
 j = respj.events
 print('<#C2H9G55D1|movies> :clapper:\n\n')
 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\n\n')
 end
 for i=1,list_max do
  if j[i] ~= nil then
   local stime = time.parse(j[i].start_dt, "2006-01-02T15:04:05-07:00")
   local etime = time.parse(j[i].end_dt, "2006-01-02T15:04:05-07:00")
   local who = ""
   local notes = 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   if j[i].notes ~= "" then
    notes = j[i].notes
   end
   -- list of strings to replace (the order is important to avoid conflicts)
   local cleaner = {
    { "&amp;", "&" },	-- decode ampersands
    { "&#151;", "-" },	-- em dash
    { "&#146;", "'" },	-- right single quote
    { "&#147;", "\"" },	-- left double quote
    { "&#148;", "\"" },	-- right double quote
    { "&#150;", "-" },	-- en dash
    { "&#160;", " " },	-- non-breaking space
    { "<br ?/?>", "\n" },-- all <br> tags whether terminated or not (<br> <br/> <br />) become new lines
    { "</p>", "\n" },	-- ends of paragraphs become n!ew lines
    { "(%b<>)", "" },	-- all other html elements are completely swapped with ">" (must be done last)
    { "\r", "\n" },	-- return carriage become new lines
    { "[\n\n]+", "\n" },	-- reduce all multiple new lines with a single new line
    { "^\n*", "" },	-- trim new lines from the start...
    { "\n*$", "" },	-- ... and end
    }
   -- clean html from the string
   for i=1, #cleaner do
    local cleans = cleaner[i]
    notes = string.gsub( notes, cleans[1], cleans[2] )
   end
   print('<' .. notes .. '|' .. j[i].title .. '>\n' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   if who ~= "" then
    print('> Requested by ' .. who .. '\n')
   end
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4191 by @simpleurbanart in #[IM @simpleurbanart] 11 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)

if ((user.id ~= 'UA74M7VPF' and user.id ~= 'UANAKA332') and channel.type ~= "im") then
 print(string.format("\60@%s\62, this factoid is only available through messaging me directly.", user.id))
else
 local calid = 'ksiwskm4anhkfc5h92'		-- API only calid (multi-day events break this program lol)
 local public_calid = 'ks4amgm5k9628hgv55'	-- Full calid, printed for the public below
 local thing_name = 'showings'
 local daycount = tonumber(argv[1])		-- Days to display movies of
 local whenTable = { 'today', 'today & tomorrow' }
 local unt = nil
 local list_max = 12
 if daycount == nil then
  daycount = 1
 end
 if daycount ~= nil and daycount > 1 then
  unt = time.now()
  unt.day = unt.day + daycount
 end
 local respj = funcs.teamup_events(fmap.api_keys.teamup, calid, nil, unt)
 j = respj.events
 print('<#C2H9G55D1|movies> :clapper:\n\n')
 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\n\n')
 end
 for i=1,list_max do
  if j[i] ~= nil then
   local stime = time.parse(j[i].start_dt, "2006-01-02T15:04:05-07:00")
   local etime = time.parse(j[i].end_dt, "2006-01-02T15:04:05-07:00")
   local who = ""
   local notes = 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   if j[i].notes ~= "" then
    notes = j[i].notes
   end
   -- list of strings to replace (the order is important to avoid conflicts)
   local cleaner = {
    { "&amp;", "&" },	-- decode ampersands
    { "&#151;", "-" },	-- em dash
    { "&#146;", "'" },	-- right single quote
    { "&#147;", "\"" },	-- left double quote
    { "&#148;", "\"" },	-- right double quote
    { "&#150;", "-" },	-- en dash
    { "&#160;", " " },	-- non-breaking space
    { "<br ?/?>", "\n" },-- all <br> tags whether terminated or not (<br> <br/> <br />) become new lines
    { "</p>", "\n" },	-- ends of paragraphs become n!ew lines
    { "(%b<>)", "" },	-- all other html elements are completely swapped with ">" (must be done last)
    { "\r", "\n" },	-- return carriage become new lines
    { "[\n\n]+", "\n" },	-- reduce all multiple new lines with a single new line
    { "^\n*", "" },	-- trim new lines from the start...
    { "\n*$", "" },	-- ... and end
    }
   -- clean html from the string
   for i=1, #cleaner do
    local cleans = cleaner[i]
    notes = string.gsub( notes, cleans[1], cleans[2] )
   end
   print('<' .. notes .. '|' .. j[i].title .. '> on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   if who ~= "" then
    print('> Requested by ' .. who .. '\n')
   end
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4171 by @simpleurbanart in #[IM @simpleurbanart] 11 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)

if ((user.id ~= 'UA74M7VPF' and user.id ~= 'UANAKA332') and channel.type ~= "im") then
 print(string.format("\60@%s\62, this factoid is only available through messaging me directly.", user.id))
else
 local calid = 'ksiwskm4anhkfc5h92'		-- API only calid (multi-day events break this program lol)
 local public_calid = 'ks4amgm5k9628hgv55'	-- Full calid, printed for the public below
 local thing_name = 'showings'
 local daycount = tonumber(argv[1])		-- Days to display movies of
 local whenTable = { 'today', 'today & tomorrow' }
 local unt = nil
 local list_max = 12
 if daycount == nil then
  daycount = 1
 end
 if daycount ~= nil and daycount > 1 then
  unt = time.now()
  unt.day = unt.day + daycount
 end
 local respj = funcs.teamup_events(fmap.api_keys.teamup, calid, nil, unt)
 j = respj.events
 print('<#C2H9G55D1|movies> :admission_tickets:\n\n')
 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\n\n')
 end
 for i=1,list_max do
  if j[i] ~= nil then
   local stime = time.parse(j[i].start_dt, "2006-01-02T15:04:05-07:00")
   local etime = time.parse(j[i].end_dt, "2006-01-02T15:04:05-07:00")
   local who = ""
   local notes = 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   if j[i].notes ~= "" then
    notes = j[i].notes
   end
   -- list of strings to replace (the order is important to avoid conflicts)
   local cleaner = {
    { "&amp;", "&" },	-- decode ampersands
    { "&#151;", "-" },	-- em dash
    { "&#146;", "'" },	-- right single quote
    { "&#147;", "\"" },	-- left double quote
    { "&#148;", "\"" },	-- right double quote
    { "&#150;", "-" },	-- en dash
    { "&#160;", " " },	-- non-breaking space
    { "<br ?/?>", "\n" },-- all <br> tags whether terminated or not (<br> <br/> <br />) become new lines
    { "</p>", "\n" },	-- ends of paragraphs become n!ew lines
    { "(%b<>)", "" },	-- all other html elements are completely swapped with ">" (must be done last)
    { "\r", "\n" },	-- return carriage become new lines
    { "[\n\n]+", "\n" },	-- reduce all multiple new lines with a single new line
    { "^\n*", "" },	-- trim new lines from the start...
    { "\n*$", "" },	-- ... and end
    }
   -- clean html from the string
   for i=1, #cleaner do
    local cleans = cleaner[i]
    notes = string.gsub( notes, cleans[1], cleans[2] )
   end
   print('<' .. notes .. '|' .. j[i].title .. '> on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   if who ~= "" then
    print('> Requested by ' .. who .. '\n')
   end
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 652 by @crenfrow in #movies 2 years agoSlack Archive

https://teamup.com/ks07a5d4a88fcb8a4b