Skip to content

Instantly share code, notes, and snippets.

@johnbocook
Created September 28, 2017 06:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnbocook/9ad5a1779f6c4e3eff27b4a86f670b39 to your computer and use it in GitHub Desktop.
Save johnbocook/9ad5a1779f6c4e3eff27b4a86f670b39 to your computer and use it in GitHub Desktop.
LunchBot is a little slack integration that randomly chooses where to have lunch.
<cfoutput>
<cfif #StructKeyExists(FORM, "token")#>
<cfif #FORM.token# NEQ '#PUBLICKEY##'>
Sorry, Authentication Failed
<cfelse>
<cfset resturants = "BW3, Roosters, Wendys, Gibbys, Tuscan Table, El Palmor, Goodwins Family
Resturant, Cardo's Pizza, Zanzy's Pizza, High Court Cafe, Arby's, Grand Buffett, McDonalds, KFC, Richie's New York Corner Deli, ">
<cfset objRandomReport=ArrayNew(1)>
<cfset objRandomReport=ListToArray(resturants)>
<cfset ArraySort(objRandomReport,"textnocase","ASC")>
<!--- random number b/n 1 and length of list/array --->
<cfset resturant=objRandomReport[RandRange(1,ArrayLen(objRandomReport))]>
<cfoutput>Team, Lunch Roulette has spoken: *#resturant#* is the spot.</cfoutput>
</cfif>
</cfif>
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment