paritybit.ca

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 87201c42646e92ce34fd034cdad407c4da3180c2
parent 5a88ea5ad2becd1a75fbf22586d726ef30cfea3b
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Sun,  9 Aug 2020 00:39:23 -0400

Publish new blog post

Diffstat:
Mpages/blog.md | 1+
Apages/blog/posting-statuses-on-pleroma-with-a-shell-script.md | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mpages/home.md | 4++--
Mpublic/feeds/sitewide-feed.xml | 30++++++++++++++++++++++++++++++
Mpublic/sitemap.xml | 1+
5 files changed, 92 insertions(+), 2 deletions(-)

diff --git a/pages/blog.md b/pages/blog.md @@ -27,6 +27,7 @@ href="https://pleroma.paritybit.ca/jbauer">Pleroma</a>. ### 2020 <ul> + <li>2020-08-09 <a href="blog/posting-statuses-on-pleroma-with-a-shell-script">Posting Statuses on Pleroma with a Shell Script</a></li> <li>2020-08-08 <a href="blog/how-to-not-make-an-ass-of-yourself-internet-discussions">How to Not Make an Ass of Yourself in Online Discussions</a></li> <li>2020-08-08 <a href="blog/gentoo-isnt-for-me">Gentoo Isn't for Me</a></li> <li>2020-08-06 <a href="blog/adding-image-optimization-to-my-static-site-generator">Adding Image Optimization to My Static Site Generator</a></li> diff --git a/pages/blog/posting-statuses-on-pleroma-with-a-shell-script.md b/pages/blog/posting-statuses-on-pleroma-with-a-shell-script.md @@ -0,0 +1,58 @@ +## Posting Statuses on Pleroma with a Shell Script + +[//]: # "With the help of @alex@gleasonator.com I was able to figure out how to get an access token through just making API calls so that I could once again automate posting statuses for new blog posts." + +[//]: # "main.min.css" + +[//]: # + +<div class="byline"> +<b>Written By:</b> Jake Bauer | + <b>Posted:</b> 2020-08-09 | + <b>Last Updated:</b> 2020-08-09 +</div> + +With the help of [@alex@gleasonator.com](https://gleasonator.com/@alex), I was +able to figure out finally how to get an OAuth access token so that I could post +status updates whenever I publish a new blog post just like I used to do when I +was running Mastodon. In reality it was actually very simple to do, but I was +missing something that could be done because it was undocumented. + +Everything that I tried is [documented in the issue on the Pleroma +GitLab](https://git.pleroma.social/pleroma/pleroma/-/issues/2031) in case you're +curious. + +The right way to do what I wanted to do was, after creating an app with +something like: + +```bash +curl -s -S -i -X POST \ + -F client_name="Blog Post Publishing Script" \ + -F redirect_uris="urn:ietf:wg:oauth:2.0:oob" \ + -F scopes="read write" \ + https://pleroma.paritybit.ca/api/v1/apps +``` + +Do the following to get an access token: + +```bash +curl -s -S -i -X POST \ + -F client_id="LjLZPKhnDnwwrleqa85ODJXzhOubLF9bSi6TDyW602A" \ + -F client_secret="<secret>" \ + -F redirect_uri="urn:ietf:wg:oauth:2.0:oob" \ + -F scope="read,write" \ + -F grant_type="password" \ + -F username="jbauer" \ + -F password="<account_password>" \ + https://pleroma.paritybit.ca/oauth/token +``` + +As opposed to everything else that I was trying to do with visiting the webpage +and whatnot. It really is this simple. Now I just put this access token into my +[publish script](https://git.paritybit.ca/paritybit.ca/tree/publish) and it will +automatically post a status update whenever I publish a new blog post. + +_This is my eighty-ninth post for the +[#100DaysToOffload](https://social.paritybit.ca/tags/100DaysToOffload) +challenge. You can learn more about this challenge over at +[https://100daystooffload.com](https://100daystooffload.com)._ diff --git a/pages/home.md b/pages/home.md @@ -18,6 +18,8 @@ This site will soon™️ be available over Gopher and Gemini. <a class="rss-icon" href="/feeds/sitewide-feed.xml"> <img src="/img/feed-icon.png" width="15" height="15" alt="Click for RSS Feed"/> </a> </div> +2020-08-09 <a class="feed-item" href="blog/posting-statuses-on-pleroma-with-a-shell-script">Posting Statuses on Pleroma with a Shell Script</a> + 2020-08-08 <a class="feed-item" href="blog/how-to-not-make-an-ass-of-yourself-internet-discussions">How to Not Make an Ass of Yourself in Online Discussions</a> 2020-08-08 <a class="feed-item" href="blog/gentoo-isnt-for-me">Gentoo Isn't for Me</a> @@ -36,8 +38,6 @@ This site will soon™️ be available over Gopher and Gemini. 2020-07-25 <a class="feed-item" href="blog/i-was-wrong">I Was Wrong</a> -2020-07-24 <a class="feed-item" href="blog/switching-to-alacritty">Switching From St to Alacritty</a> - ### What is a Parity Bit? It is a bit (in the 1's and 0's sense) used in checking for errors in digital diff --git a/public/feeds/sitewide-feed.xml b/public/feeds/sitewide-feed.xml @@ -7,6 +7,36 @@ <description>The feed that covers all notable additions, updates, announcements, and other changes for the entire paritybit.ca website.</description> <item> + <title>Posting Statuses on Pleroma with a Shell Script</title> + <link>https://www.paritybit.ca/blog/posting-statuses-on-pleroma-with-a-shell-script</link> + <guid>https://www.paritybit.ca/blog/posting-statuses-on-pleroma-with-a-shell-script</guid> + <pubDate>Sun, 09 Aug 2020 00:39:03 -0400</pubDate> + <description><![CDATA[<h2 id="posting-statuses-on-pleroma-with-a-shell-script">Posting Statuses on Pleroma with a Shell Script</h2> +<div class="byline"> +<p><b>Written By:</b> Jake Bauer | <b>Posted:</b> 2020-08-09 | <b>Last Updated:</b> 2020-08-09</p> +</div> +<p>With the help of <span class="citation" data-cites="alex">[@alex@gleasonator.com]</span>(https://gleasonator.com/<span class="citation" data-cites="alex">@alex</span>), I was able to figure out finally how to get an OAuth access token so that I could post status updates whenever I publish a new blog post just like I used to do when I was running Mastodon. In reality it was actually very simple to do, but I was missing something that could be done because it was undocumented.</p> +<p>Everything that I tried is <a href="https://git.pleroma.social/pleroma/pleroma/-/issues/2031">documented in the issue on the Pleroma GitLab</a> in case you’re curious.</p> +<p>The right way to do what I wanted to do was, after creating an app with something like:</p> +<div class="sourceCode" id="cb1"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true"></a><span class="ex">curl</span> -s -S -i -X POST \</span> +<span id="cb1-2"><a href="#cb1-2" aria-hidden="true"></a> -F client_name=<span class="st">&quot;Blog Post Publishing Script&quot;</span> \</span> +<span id="cb1-3"><a href="#cb1-3" aria-hidden="true"></a> -F redirect_uris=<span class="st">&quot;urn:ietf:wg:oauth:2.0:oob&quot;</span> \</span> +<span id="cb1-4"><a href="#cb1-4" aria-hidden="true"></a> -F scopes=<span class="st">&quot;read write&quot;</span> \</span> +<span id="cb1-5"><a href="#cb1-5" aria-hidden="true"></a> https://pleroma.paritybit.ca/api/v1/apps</span></code></pre></div> +<p>Do the following to get an access token:</p> +<div class="sourceCode" id="cb2"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true"></a><span class="ex">curl</span> -s -S -i -X POST \</span> +<span id="cb2-2"><a href="#cb2-2" aria-hidden="true"></a> -F client_id=<span class="st">&quot;LjLZPKhnDnwwrleqa85ODJXzhOubLF9bSi6TDyW602A&quot;</span> \</span> +<span id="cb2-3"><a href="#cb2-3" aria-hidden="true"></a> -F client_secret=<span class="st">&quot;&lt;secret&gt;&quot;</span> \</span> +<span id="cb2-4"><a href="#cb2-4" aria-hidden="true"></a> -F redirect_uri=<span class="st">&quot;urn:ietf:wg:oauth:2.0:oob&quot;</span> \</span> +<span id="cb2-5"><a href="#cb2-5" aria-hidden="true"></a> -F scope=<span class="st">&quot;read,write&quot;</span> \</span> +<span id="cb2-6"><a href="#cb2-6" aria-hidden="true"></a> -F grant_type=<span class="st">&quot;password&quot;</span> \</span> +<span id="cb2-7"><a href="#cb2-7" aria-hidden="true"></a> -F username=<span class="st">&quot;jbauer&quot;</span> \</span> +<span id="cb2-8"><a href="#cb2-8" aria-hidden="true"></a> -F password=<span class="st">&quot;&lt;account_password&gt;&quot;</span> \</span> +<span id="cb2-9"><a href="#cb2-9" aria-hidden="true"></a> https://pleroma.paritybit.ca/oauth/token</span></code></pre></div> +<p>As opposed to everything else that I was trying to do with visiting the webpage and whatnot. It really is this simple. Now I just put this access token into my <a href="https://git.paritybit.ca/paritybit.ca/tree/publish">publish script</a> and it will automatically post a status update whenever I publish a new blog post.</p> +<p><em>This is my eighty-ninth post for the <a href="https://social.paritybit.ca/tags/100DaysToOffload">#100DaysToOffload</a> challenge. You can learn more about this challenge over at <a href="https://100daystooffload.com">https://100daystooffload.com</a>.</em></p>]]></description> + </item> +<item> <title>How to Not Make an Ass of Yourself in Online Discussions</title> <link>https://www.paritybit.ca/blog/how-to-not-make-an-ass-of-yourself-internet-discussions</link> <guid>https://www.paritybit.ca/blog/how-to-not-make-an-ass-of-yourself-internet-discussions</guid> diff --git a/public/sitemap.xml b/public/sitemap.xml @@ -3,6 +3,7 @@ <url><loc>https://www.paritybit.ca</loc></url> <url><loc>https://www.paritybit.ca/home</loc></url> <url><loc>https://www.paritybit.ca/blog</loc></url> + <url><loc>https://www.paritybit.ca/blog/posting-statuses-on-pleroma-with-a-shell-script</loc></url> <url><loc>https://www.paritybit.ca/blog/how-to-not-make-an-ass-of-yourself-internet-discussions</loc></url> <url><loc>https://www.paritybit.ca/blog/gentoo-isnt-for-me</loc></url> <url><loc>https://www.paritybit.ca/blog/adding-image-optimization-to-my-static-site-generator</loc></url>