{"type":"rich","version":"1.0","provider_name":"phorkie","provider_url":"https:\/\/p.cweiske.de\/","title":"Slack: Set profile status to \"office\"","author_name":"Christian Weiske","cache_age":86400,"width":900,"height":900,"html":"<!-- embedding all files of https:\/\/p.cweiske.de\/905 -->\n<link rel=\"stylesheet\" href=\"https:\/\/p.cweiske.de\/css\/embed.css\"\/>\n<div class=\"phork\" id=\"905\">\n    <div class=\"phork-file\">\n <div class=\"phork-content\">\n  \n<div class=\"document\">\n\n\n<p>Sets the Slack status to &quot;office&quot; for this day. Useful to start this when your office computer boots.<\/p>\n<p>Get a user token at <a class=\"reference external\" href=\"https:\/\/api.slack.com\/tutorials\/tracks\/getting-a-token\">https:\/\/api.slack.com\/tutorials\/tracks\/getting-a-token<\/a><\/p>\n<\/div>\n\n <\/div>\n <div class=\"phork-meta\">\n  <a href=\"https:\/\/p.cweiske.de\/905\/rev-raw\/aad3fc6491c654ab26d2fc3383c5d6db540527f0\/README.rst\" style=\"float: right\">view raw source<\/a>\n  <a href=\"https:\/\/p.cweiske.de\/905#README.rst\">README.rst<\/a>\n <\/div>\n<\/div>\n    <div class=\"phork-file\">\n <div class=\"phork-content\">\n  <style type=\"text\/css\">\/**\n * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2014 Benny Baumann\n * (http:\/\/qbnz.com\/highlighter\/ and http:\/\/geshi.org\/)\n *\/\n.bash .de1, .bash .de2 {font: normal normal 1em\/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}\n.bash  {font-family:monospace;}\n.bash .imp {font-weight: bold; color: red;}\n.bash li, .bash .li1 {color: #DDD;}\n.bash .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}\n.bash .kw1 {color: #000000; font-weight: bold;}\n.bash .kw2 {color: #c20cb9; font-weight: bold;}\n.bash .kw3 {color: #7a0874; font-weight: bold;}\n.bash .co0 {color: #666666; font-style: italic;}\n.bash .co1 {color: #800000;}\n.bash .co2 {color: #cc0000; font-style: italic;}\n.bash .co3 {color: #000000; font-weight: bold;}\n.bash .co4 {color: #666666;}\n.bash .es1 {color: #000099; font-weight: bold;}\n.bash .es2 {color: #007800;}\n.bash .es3 {color: #007800;}\n.bash .es4 {color: #007800;}\n.bash .es5 {color: #780078;}\n.bash .es_h {color: #000099; font-weight: bold;}\n.bash .br0 {color: #7a0874; font-weight: bold;}\n.bash .sy0 {color: #000000; font-weight: bold;}\n.bash .st0 {color: #ff0000;}\n.bash .st_h {color: #ff0000;}\n.bash .nu0 {color: #000000;}\n.bash .re0 {color: #007800;}\n.bash .re1 {color: #007800;}\n.bash .re2 {color: #007800;}\n.bash .re4 {color: #007800;}\n.bash .re5 {color: #660033;}\n.bash span.xtra { display:block; }\n<\/style><div class=\"code\"><table class=\"bash\"><tbody><tr class=\"li1\"><td class=\"ln\"><pre class=\"de1\">1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n<\/pre><\/td><td class=\"de1\"><pre class=\"de1\"><span class=\"co0\">#!\/bin\/sh<\/span>\n<span class=\"kw1\">set<\/span> <span class=\"re5\">-e<\/span>\n<span class=\"re2\">token<\/span>=xoxp-my-token\n<span class=\"re2\">tsEndofday<\/span>=$<span class=\"br0\">&#40;<\/span><span class=\"kw2\">date<\/span> <span class=\"re5\">-d<\/span> <span class=\"st_h\">'tomorrow 00:00'<\/span> +<span class=\"sy0\">%<\/span>s<span class=\"br0\">&#41;<\/span>\ncurl -XPOST\\\n&#160; &#160; &#160;<span class=\"re5\">-H<\/span> <span class=\"st_h\">'Content-Type: application\/json'<\/span>\\\n&#160; &#160; &#160;<span class=\"re5\">-H<\/span> <span class=\"st0\">&quot;Authorization: Bearer <span class=\"es2\">$token<\/span>&quot;<\/span>\\\n&#160; &#160; &#160;<span class=\"re5\">--data-raw<\/span> <span class=\"st_h\">'{&quot;profile&quot;:{&quot;status_emoji&quot;:&quot;:office:&quot;,&quot;status_expiration&quot;:'<\/span><span class=\"re1\">$tsEndofday<\/span><span class=\"st_h\">'}}'<\/span>\\\n&#160; &#160; &#160;<span class=\"re5\">-s<\/span> <span class=\"re5\">--output<\/span> <span class=\"sy0\">\/<\/span>dev<span class=\"sy0\">\/<\/span>null\\\n&#160; &#160; &#160;https:<span class=\"sy0\">\/\/<\/span>slack.com<span class=\"sy0\">\/<\/span>api<span class=\"sy0\">\/<\/span>users.profile.set\n&#160;<\/pre><\/td><\/tr><\/tbody><\/table><\/div>\n <\/div>\n <div class=\"phork-meta\">\n  <a href=\"https:\/\/p.cweiske.de\/905\/rev-raw\/aad3fc6491c654ab26d2fc3383c5d6db540527f0\/slack-status-office.sh\" style=\"float: right\">view raw source<\/a>\n  <a href=\"https:\/\/p.cweiske.de\/905#slack-status-office.sh\">slack-status-office.sh<\/a>\n <\/div>\n<\/div>\n<\/div>\n"}
