Last edit: @simpleurbanart in #[IM @simpleurbanart] 5 months ago - Slack Archive

{lua}
print("Welcome to <#C2H9G55D1|movies>! :clapper:\n\n")

print("Display today's showings:\n")
print(">:admission_tickets: *!movieschedule*\n")

print("See the full calendar:\n")
print(">:calendar: *!moviecalendar*\n")

print("Request the projector:\n")
print(">:film_projector: *!movierequest*\n")

print("Read the movie room rules:\n")
print(">:page_facing_up: *!movierules*\n")

print("Purchase snacks & support the club:\n")
print(">:popcorn: *!snacks*\n")

print("Donate to support the club:\n")
print(">:yellow_heart: *!donate*\n")

History

Revision: 4277 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua}
print("Welcome to <#C2H9G55D1|movies>! :clapper:\n\n")

print("Display today's showings:\n")
print(">:admission_tickets: *!movieschedule*\n")

print("See the full calendar:\n")
print(">:calendar: *!moviecalendar*\n")

print("Request the projector:\n")
print(">:film_projector: *!movierequest*\n")

print("Read the movie room rules:\n")
print(">:page_facing_up: *!movierules*\n")

print("Purchase snacks & support the club:\n")
print(">:popcorn: *!snacks*\n")

print("Donate to support the club:\n")
print(">:yellow_heart: *!donate*\n")

Revision: 4222 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua}
print("Welcome to <#C2H9G55D1|movies>! :clapper:\n\n")

print("Display today's showings:\n")
print(">:admission_tickets: *!movieschedule*\n")
print("See the full calendar:\n")
print(">:calendar: *!moviecalendar*\n")
print("Request the projector:\n")
print(">:film_projector: *!movierequest*\n")
print("Purchase snacks to support the club:\n")
print(">:popcorn: *!snacks*\n")
print("Donate to support the club:\n")
print(">:yellow_heart: *!donate*\n")

Revision: 4210 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua}
print("Welcome to <#C2H9G55D1|movies>! :clapper:\n\n")

print("Display today's showings:\n")
print(">:admission_tickets: *!movieschedule*\n")
print("See the full calendar:\n")
print(">:calendar: *!moviecalendar*\n")
print("Request the room:\n")
print(">:film_projector: *!movierequest*\n")
print("Purchase snacks to support the club:\n")
print(">:popcorn: *!snacks*\n")
print("Donate to support the club:\n")
print(">:yellow_heart: *!donate*\n")

Revision: 4196 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua}
print("Welcome to <#C2H9G55D1|movies>! :clapper:\n\n")

print("Display today's showings:\n")
print(">:admission_tickets: *!movieschedule*\n")
print("See the full calendar:\n")
print(">:calendar: *!moviecalendar*\n")
print("Request the room:\n")
print(">:film_projector: *!movierequest*\n")
print("Purchase snacks to support the club:\n")
print(">:popcorn: *!snacks*\n")

Revision: 4195 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua}
print("Welcome to <#C2H9G55D1|movies>! :clapper:\n\n")

print("Display today's showings:\n")
print(">:admission_tickets: *!movieschedule*\n")
print("See the full Calendar:\n")
print(">:calendar: *!moviecalendar*\n")
print("Request the #movies room:\n")
print(">:film_projector: *!movierequest*\n")
print("Purchase snacks to support the club:\n")
print(">:popcorn: *!snacks*\n")

Revision: 4194 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua}
print("Welcome to <#C2H9G55D1|movies>! :clapper:\n\n")
print("These are our factoids:\n\n")
print("Display today's showings:\n")
print(">:admission_tickets: *!movieschedule*\n")
print("See the full Calendar:\n")
print(">:calendar: *!moviecalendar*\n")
print("Request the #movies room:\n")
print(">:film_projector: *!movierequest*\n")
print("Purchase snacks to support the club:\n")
print(">:popcorn: *!snacks*\n")

Revision: 4181 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua}
print("Welcome to <#C2H9G55D1|movies>! :clapper:\n\n")
print("These are our factoids:\n\n")
print("• Display today's showings:\n")
print(">:admission_tickets: *!movieschedule*\n")
print("• See the full Calendar:\n")
print(">:calendar: *!moviecalendar*\n")
print("• Request the #movies room:\n")
print(">:film_projector: *!movierequest*\n")
print("• Purchase snacks to support the club:\n")
print(">:popcorn: *!snacks*\n")

Revision: 4180 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua}
print("Welcome to <#C2H9G55D1|movies>! :film_frames:\n\n")
print("These are our factoids:\n\n")
print("• Display today's showings:\n")
print(">:admission_tickets: *!movieschedule*\n")
print("• See the full Calendar:\n")
print(">:calendar: *!moviecalendar*\n")
print("• Request the #movies room:\n")
print(">:film_projector: *!movierequest*\n")
print("• Purchase snacks to support the club:\n")
print(">:popcorn: *!snacks*\n")

Revision: 4179 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua}
print("Welcome to <#C2H9G55D1|movies>! :clapper:\n\n")
print("These are our factoids:\n\n")
print("• Display today's showings:\n")
print(">:admission_tickets: *!movieschedule*\n")
print("• See the full Calendar:\n")
print(">:calendar: *!moviecalendar*\n")
print("• Request the #movies room:\n")
print(">:film_projector: *!movierequest*\n")
print("• Purchase snacks to support the club:\n")
print(">:popcorn: *!snacks*\n")

Revision: 4178 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua}
print("Welcome to <#C2H9G55D1|movies>! :clapper:\n\n")
print("These are our factoids:\n\n")
print(">Display today's showings:\n")
print(">>:admission_tickets: *!movieschedule*\n")
print(">See the full Calendar:\n")
print(">>>:calendar: *!moviecalendar*\n")
print(">Request the #movies room:\n")
print(">>>:film_projector: *!movierequest*\n")
print(">Purchase snacks to support the club:\n")
print(">>>:popcorn: *!snacks*\n")

Revision: 4177 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua}
print("Welcome to <#C2H9G55D1|movies>! :clapper:\n\n")
print("These are our factoids:\n\n")
print(">Display today's showings:\n")
print(">>>:admission_tickets: *!movieschedule*\n")
print(">See the full Calendar:\n")
print(">>>:calendar: *!moviecalendar*\n")
print(">Request the #movies room:\n")
print(">>>:film_projector: *!movierequest*\n")
print(">Purchase snacks to support the club:\n")
print(">>>:popcorn: *!snacks*\n")

Revision: 4176 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua}
print("Welcome to <#C2H9G55D1|movies>! :clapper:\n\n")

print("Display today's showings:\n")
print(">:admission_tickets: *!movieschedule*\n")
print("See the full Calendar:\n")
print(">:calendar: *!moviecalendar*\n")
print("Request the #movies room:\n")
print(">:film_projector: *!movierequest*\n")
print("Purchase snacks to support the club:\n")
print(">:popcorn: *!snacks*\n")

Revision: 4175 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua}
print("Welcome to <#C2H9G55D1|movies>! :popcorn:\n\n")

print("Display the today's showings (DOWN for server maintenance):\n")
print(">:admission_tickets: _!movieschedule_\n")
print("See the full Calendar:\n")
print(">:calendar: _!moviecalendar_\n")
print("Request the #movies room:\n")
print(">:calendar: _!movierequest_\n")
print("Purchase snacks to support the club:\n")
print(">:calendar: _!snacks_\n")

Revision: 4174 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua}
print("Welcome to <#C2H9G55D1|movies> :popcorn:\n\n")

print("Display the today's showings (DOWN for server maintenance):\n")
print(">:admission_tickets: _!movieschedule_\n")
print("See the full Calendar:\n")
print(">:calendar: _!moviecalendar_\n")
print("Request the #movies room:\n")
print(">:calendar: _!movierequest_\n")
print("Purchase snacks to support the club:\n")
print(">:calendar: _!snacks_\n")

Revision: 4173 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua}
print("Welcome to <#C2H9G55D1|#movies> :popcorn:\n\n")

print("Display the today's showings (DOWN for server maintenance):\n")
print(">:admission_tickets: _!movieschedule_\n")
print("See the full Calendar:\n")
print(">:calendar: _!moviecalendar_\n")
print("Request the #movies room:\n")
print(">:calendar: _!movierequest_\n")
print("Purchase snacks to support the club:\n")
print(">:calendar: _!snacks_\n")

Revision: 4172 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

print("Welcome to <#C2H9G55D1|#movies> :popcorn:\n\n")

print("Display the today's showings (DOWN for server maintenance):\n")
print(">:admission_tickets: _!movieschedule_\n")
print("See the full Calendar:\n")
print(">:calendar: _!moviecalendar_\n")
print("Request the #movies room:\n")
print(">:calendar: _!movierequest_\n")
print("Purchase snacks to support the club:\n")
print(">:calendar: _!snacks_\n")

Revision: 4149 by @simpleurbanart in #[IM @simpleurbanart] 5 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: 4148 by @simpleurbanart in #[IM @simpleurbanart] 5 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   if who ~= "" then
    --print(string.format("> Requested by \60@%s\62\n", who))
    print('> Requested by ' .. who .. '\n')
   end   
   print('> ' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4147 by @simpleurbanart in #[IM @simpleurbanart] 5 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   
   print('> ' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4146 by @simpleurbanart in #[IM @simpleurbanart] 5 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   
   print('> ' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4145 by @simpleurbanart in #[IM @simpleurbanart] 5 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 = "Error."
   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: 4144 by @simpleurbanart in #[IM @simpleurbanart] 5 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 = ""
   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: 4143 by @simpleurbanart in #[IM @simpleurbanart] 5 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   
   print('> ' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4060 by @simpleurbanart in #[IM @simpleurbanart] 5 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   if who ~= "" then
    --print(string.format("> Requested by \60@%s\62\n", who))
    print('> Requested by ' .. who .. '\n')
   end   
   print('> ' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4059 by @simpleurbanart in #[IM @simpleurbanart] 5 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')
 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   if who ~= "" then
    --print(string.format("> Requested by \60@%s\62\n", who))
    print('> Requested by ' .. who .. '\n')
   end   
   print('> ' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4058 by @simpleurbanart in #[IM @simpleurbanart] 5 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')
 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   if who ~= "" then
    --print(string.format("> Requested by \60@%s\62\n", who))
    print('> Requested by @' .. who .. '\n')
   end   
   print('> ' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4057 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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 notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   
   if who ~= "" then
    --print(string.format("> Requested by \60@%s\62\n", who))
    print('> Requested by @' .. who .. '\n')
   end
   
   print('> ' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4051 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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')

 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 notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   
   if who ~= "" then
    --print(string.format("> Requested by \60@%s\62\n", who))
    print('> Requested by @' .. who .. '\n')
   end
   
   print('> ' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4050 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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')

 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 notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   
   if who ~= "" then
    --print(string.format("> Requested by \60@%s\62\n", who))
    print('> Requested by @' .. who .. '\n')
   end
   
   print('> ' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4044 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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')

 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 notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   
   if who ~= "" then
    print(string.format("> Requested by \60@%s\62\n", who))
   end
   
   print('> ' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4043 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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')

 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 notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   
   if who ~= "" then
    print(string.format("> \60@simpleurbanart\62 Requested by \60@%s\62\n", who))
   end
   
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4042 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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:')

 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 notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   
   if who ~= "" then
    print(string.format("> \60@simpleurbanart\62 Requested by \60@%s\62\n", who))
   end
   
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4041 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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:)

 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 notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   
   if who ~= "" then
    print(string.format("> \60@simpleurbanart\62 Requested by \60@%s\62\n", who))
   end
   
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4040 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

<#C2H9G55D1|movies> :admission_tickets:
{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 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 notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}:admission_tickets: 
   local notes = notesTable[math.random( #notesTable )]

   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   
   if who ~= "" then
    print(string.format("> \60@simpleurbanart\62 Requested by \60@%s\62\n", who))
   end
   
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4039 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 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 notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   
   if who ~= "" then
    print(string.format("> \60@simpleurbanart\62 Requested by \60@%s\62\n", who))
   end
   
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4038 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 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 notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   
   if who ~= "" then
    print(string.format("> \60@chrsilva\62 Requested by \60@%s\62\n", who))
   end
   
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4037 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 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 notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   
   if who ~= "" then
    print(string.format("> \60@jadawson\62 Requested by \60@%s\62\n", who))
   end
   
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4036 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 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 notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   
   if who ~= "" then
    print(string.format("> @jadawson Requested by \60@%s\62\n", who))
   end
   
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4035 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 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 notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   
   if who ~= "" then
    print(string.format(">Requested by \60@%s\62\n", who))
   end
   
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4034 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 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 notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   
   if who ~= "" then
    print(string.format(">Requested by \59@%s\62\n", who))
   end
   
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4033 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 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 notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   
   if who ~= "" then
    print(string.format(">Requested by \60@%s\63\n", who))
   end
   
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4032 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 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 notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   
   if who ~= "" then
    print(string.format(">Requested by \60@%s\62\n", who))
   end
   
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('\nSee the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4031 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 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 notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   
   if who ~= "" then
    print(string.format(">Requested by \60@%s\62\n", who))
   end
   
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4030 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   
   if who ~= "" then
    print(string.format(">Requested by \60@%s\62\n", who))
   end
   
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4029 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   
   if who ~= "" then
    print(string.format(">Requested by \60@%s\62\n", who))
   end
   
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4028 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 = 'brtucker'
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]
   print(who)
   if j[i].who ~= "" then 
    who = j[i].who 
   end
   print(who)
   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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print(string.format(">Requested by \60@%s\62\n", who))
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4027 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 = 'brtucker'
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print(string.format(">Requested by \60@%s\62\n", who))
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4026 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   if j[i].who ~= "" then 
    who = '\60@' .. j[i].who .. '\62'
   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   --print(string.format(">Requested by \60@%s\62\n", who))
   print('>Requested by ' .. who .. '\n')
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4025 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print(string.format(">Requested by \60@%s\62\n", who))
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4024 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 -- TEST
 user = '@brtucker'
 print(user)

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print(string.format(">Requested by \60@%s\62\n", who))
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4023 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 -- TEST
 print(user)

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print(string.format(">Requested by \60@%s\62\n", who))
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4022 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 -- TEST
 print(user .. '\n')

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print(string.format(">Requested by \60@%s\62\n", who))
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4021 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print(string.format(">Requested by \60@%s\62\n", who))
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4020 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   user = who
   print(string.format(">Requested by \60@%s\62\n", user.id))
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4019 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print(string.format(">Requested by \60@%s\62\n", who))
   print('>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4018 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4017 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 

if ((user.id ~= movie_members[1] or user.id ~= movie_members[2]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4016 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', 'UANAKA332' } 
print(user.id)
if ((user.id ~= movie_members[1] or user.id ~= movie_members[2]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4015 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', '<@DCU9F999D>' } 
print(user.id)
if (user.id == movie_members[1]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4014 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { 'UA74M7VPF', '<@DCU9F999D>' } 
print(user.id)
if ((user.id == movie_members[1] or user.id ~= movie_members[2]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4013 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { '<@UA74M7VPF>', '<@DCU9F999D>' } 
print(user.id)
if ((user.id == movie_members[1] or user.id ~= movie_members[2]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4012 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { '<@DA6P8116G>', '<@DCU9F999D>' } 
print(user.id)
if (user.id == movie_members[1]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4011 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { '<@DA6P8116G>', '<@DCU9F999D>' } 
if (user.id == movie_members[1]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4010 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { '<@DA6P8116G>', '<@DCU9F999D>' } 
if ((user.id == movie_members[1]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4009 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { '<@DA6P8116G>', '<@DCU9F999D>' } 
if ((user.id ~= movie_members[1] or user.id ~= movie_members[2]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4008 by @simpleurbanart in #ft_movies 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { '<@DA6P8116G>', '<@DCU9F999D>' } 
if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) or 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4007 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { '<@DA6P8116G>', '<@DCU9F999D>' } 
if ((user.id ~= movie_members[1] and user.id ~= movie_members[2]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4006 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { '<@DA6P8116G>', '<@DCU9F999D>' } 
if ((user.id ~= movie_members[1] or user.id ~= movie_members[2]) 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4005 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { '<@DA6P8116G>', '<@DCU9F999D>' } 
if ((user.id ~= movie_members[1] or user.id ~= movie_members[2]) or 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4004 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { '<@DA6P8116G>', '<@DCU9F999D>' } 
if ((user.id ~= movie_members[1] or user.id ~= movie_members[2]) or 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
  else 
   break 
  end
 end
 print('See the full schedule here https://teamup.com/' .. public_calid)
end

Revision: 4003 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { '<@DA6P8116G>', '<@DCU9F999D>' } 
if ((user.id ~= movie_members[1] or user.id ~= movie_members[2]) or 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
  else 
   break 
  end
 end
end

print('See the full schedule here https://teamup.com/' .. public_calid)

Revision: 4002 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { '<@DA6P8116G>', '<@DCU9F999D>' } 
if ((user.id ~= movie_member[1] or user.id ~= movie_member[2]) or 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
  else 
   break 
  end
 end
end

print('See the full schedule here https://teamup.com/' .. public_calid)

Revision: 4001 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
local movie_members = { '<@DA6P8116G>', '<@DCU9F999D>' } 
if ((user.id ~= movie_member[1] or user.id ~= movie_member[2]) or 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

 if daycount == 1 or daycount == 2 then
  print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
 else
  print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
   local who = whoTable[math.random( #whoTable )]
   local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
   local notes = notesTable[math.random( #notesTable )]

   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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
   print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
  else 
   break 
  end
 end
end

print('See the full schedule here https://teamup.com/' .. public_calid)

Revision: 4000 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
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

if daycount == 1 or daycount == 2 then
 print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
else
 print('Upcoming ' .. thing_name .. ' for the next ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
  local who = whoTable[math.random( #whoTable )]
  local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
  local notes = notesTable[math.random( #notesTable )]

  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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
  print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
 else 
  break 
 end
end

print('See the full schedule here https://teamup.com/' .. public_calid)

Revision: 3999 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
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', '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

if daycount == 1 or daycount == 2 then
 print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
else
 print('Upcoming ' .. thing_name .. ' for ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
  local who = whoTable[math.random( #whoTable )]
  local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
  local notes = notesTable[math.random( #notesTable )]

  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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
  print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
 else 
  break 
 end
end

print('See the full schedule here https://teamup.com/' .. public_calid)

Revision: 3998 by @simpleurbanart in #[IM @simpleurbanart] 5 months agoSlack Archive

{lua} 
-- API Docs (http://apidocs.teamup.com/)
-- Originally by jkrause
-- Use: !movies 2
-- Showings only URL (https://teamup.com/ksiwskm4anhkfc5h92)
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[4])	-- Days to display movies of
local whenTable = { '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

if daycount == 1 or daycount == 2 then
 print('Upcoming ' .. thing_name .. ' for ' .. whenTable[daycount] ..':\n') 
else
 print('Upcoming ' .. thing_name .. ' for ' .. daycount .. ' days' .. ':\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 whoTable = { 'chrsilva', 'brtucker', 'a̴̤͇̜̺͊͐͒̇̅͒̇̽̂͘ͅn͕͙͙͓̖̩̒́͋̃̓̎̑̍́͝õ̴͈̘̖͉͉̹̱͔̟̱͒́̈͌͊̽͞n͙̱̩̝̭̻͗̉̐̑͐̓̇ỵ̢̪̗̖̹̦̿̃̾̈̚m̷̗̝̲͍͖̔͑̀̋̈̓̚o̶̮͕̙̮̟̓͛̊̽̓͊͑ų̵̺̪̰̗̫̪͙̝̆̏̉̒͂̽͟s̴͙̦̹̣̜̒̽̉̓̍̀̈́̀̕͢ͅ'}
  local who = whoTable[math.random( #whoTable )]
  local notesTable = { 'A good movie!', 'No description.', 'm̛̙̩̜͎͓͇̳̿̉̾̓͊͐͟͜͡i̫̗̟͕͇͈̊̋̏̎̔͋͟͞ş̴̩͍̹͔̬͈̟̅̇͐̒͐̓̆͢͠ş̴͔̫̇̔͆͊͐̀̊͟͜͝í̶̧̬̱̮̜͎̮͉͐̇͂̂̆͜ͅn̳̪̙͖̜̰̉̿̅̏͆̽͢͡ġ̨̱̫̳͈̰̫͎̤̀̐̑͛́̋͋͋͢͡'}
  local notes = notesTable[math.random( #notesTable )]

  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 new 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('*' .. j[i].title .. '* on ' .. stime:format("Mon 02 Jan from 3:04pm") .. etime:format(" to 3:04pm") .. '\n')
  print('>Requested by ' .. who .. '\n' .. '>' .. notes .. '\n')
 else 
  break 
 end
end

print('See the full schedule here https://teamup.com/' .. public_calid)

Revision: 3876 by @bryce.tucker.0598 in #ft_movies 5 months agoSlack Archive

{alias}ft_showtimes

Revision: 3875 by @bryce.tucker.0598 in #ft_movies 5 months agoSlack Archive

:admission_tickets: https://tinyurl.com/ft-showtimes

Revision: 3874 by @bryce.tucker.0598 in #ft_movies 5 months agoSlack Archive

admission_tickets: https://tinyurl.com/ft-showtimes

Revision: 976 by @crenfrow in #[IM @crenfrow] 2 years agoSlack Archive

{alias}movie_schedule