Categories
Digital Learning

Angular test project continues to deliver

Gary Simon @designcoursecom is another excellent online tutor.  I followed his Angular PWA video and expanded the original Joke page to include 50% Dad jokes and 40% otherwise bad jokes.  Gary Simon’s algorithm brings in jokes one at a time from a Chuck Norris RESTful API.  I sought out more joke APIs and found two that I liked.  One told corny dad-jokes.  Another told really awfully bad jokes, but it comes with a filter.  I selected the API to filter out not-safe-for-work, racist, and sexist jokes.  Then I updated the heading to let me know if the PWA drew from the Chuck Norris Joke stack, the Dad Joke stack, or the Bad Joke stack.

Some of the so-called “Bad Jokes” weren’t all that bad, so I went back into it and just finished changing it up a little.  I remembered that the joke API includes a “category” element that I could leverage.  The categories were Miscellaneous, Programming, Dark, Pun, Spooky, and Christmas.  So, if the category was Programming, Dark, Spooky, or Christmas, I just displayed that followed by “Joke”.  But if the category was Pun, well “Pun Joke” is just redundant.  If the category was Miscellaneous, I just reverted back to “Bad”. 

When I tested that, I got a few spooky jokes in a row, meanwhile the radio was playing Christmas music.  That gave me an idea.  Now until Boxing Day, when the randomizer selects “Bad Jokes”, it will show Christmas jokes.  When October rolls around and if the free host lets me keep it that long, the “Bad Jokes” will be filtered for spooky jokes and dark jokes.

Now, the joke page was built to test how to make a PWA, so I downloaded it to my phone.  It still had the Angular icon, the shield with the capital A. 

a black shield with the capital letter A
a red shield with the capital letter A

I didn’t want to look too far removed from the culture, but I wanted to personalise it.  So, I kept the shield, changed the A to P, and now the app looks like a PWA, but one that I made.

a black shield with the capital letter P
a red shield with the capital letter P

So, let me know what you think.  Remember to like and subscribe.  Just kidding. There’s no subscribe button.