{"id":32,"date":"2023-01-14T08:37:03","date_gmt":"2023-01-14T08:37:03","guid":{"rendered":"https:\/\/rokbot.xyz\/?p=32"},"modified":"2023-01-14T08:56:25","modified_gmt":"2023-01-14T08:56:25","slug":"hello-php","status":"publish","type":"post","link":"https:\/\/rokbot.xyz\/index.php\/2023\/01\/14\/hello-php\/","title":{"rendered":"hello.php"},"content":{"rendered":"\n<p>This script greets the command user with a randomly picked greeting. A tad useless since this can be achieved via the&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/docs.nightbot.tv\/variables\/user\" target=\"_blank\">Nightbot $(user) variable<\/a>, but this was a good way to practice using&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/docs.nightbot.tv\/variables\/urlfetch#headers\" target=\"_blank\">Nightbot request headers<\/a>. Since the command user is obtained from Nightbot&#8217;s request headers, I&#8217;ve set the script to only allow Nightbot to interact with it. It won&#8217;t work if you try running it in your browser.<\/p>\n\n\n\n<p>The Nightbot command is:<\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/rokbot.xyz\/hello.php\" target=\"_blank\">$(urlfetch https:\/\/rokbot.xyz\/hello.php)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This script greets the command user with a randomly picked greeting. A tad useless since this can be achieved via the&nbsp;Nightbot $(user) variable, but this was a good way to practice using&nbsp;Nightbot request headers. Since the command user is obtained from Nightbot&#8217;s request headers, I&#8217;ve set the script to only allow Nightbot to interact with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/rokbot.xyz\/index.php\/wp-json\/wp\/v2\/posts\/32"}],"collection":[{"href":"https:\/\/rokbot.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rokbot.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rokbot.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rokbot.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=32"}],"version-history":[{"count":4,"href":"https:\/\/rokbot.xyz\/index.php\/wp-json\/wp\/v2\/posts\/32\/revisions"}],"predecessor-version":[{"id":69,"href":"https:\/\/rokbot.xyz\/index.php\/wp-json\/wp\/v2\/posts\/32\/revisions\/69"}],"wp:attachment":[{"href":"https:\/\/rokbot.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rokbot.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rokbot.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}