Using Trello as a CMS

Good idea by Carly:

Trello is a web application I’d used for project organization before, and I realized that with the assistance of the Custom Fields power-up, I could pretty much get every field needed to run a portfolio just from their API. Just on a standard card, I can input a title and description, add image attachments, and tag it with labels; custom fields gave me the ability to add the project completion date and URL.

Phil Hawksworth recently wrote a more extensive post on it too, with an updated API to use.

Have to remember that one when building a new workshop exercise. πŸ™‚

2017 post by Carly: Using Trello as a CMS →
2020 post by Phil: Using Trello as a Super Simple CMS →

This Video Has $viewcount Views

Tom Scott has uploaded a video to YouTube whose title reflects the number of views the video has.

The title of this video should change with the times. But nothing lasts forever: here’s the story of how I made it work, why it used to be easier to make that work, and how it all ties in to the White Cliffs of Dover and the end of the universe.

Extra points for giving me a trip down to memory lane just by mentioning the term “Web 2.0” by name

πŸ€“ Tom has actually done this kind of thing before in his video on why Denmark is a few milliseconds behind the world: that video’s title is constantly updated to accurately represent the current time-difference in Denmark.

IMAP API – Self hosted application to access IMAP and SMTP accounts over REST

IMAP API is a self hosted application for accessing IMAP accounts over REST API. IMAP API daemon connects to user’s IMAP account, translates API requests to IMAP and also sends webhooks for changes like new or deleted emails.

IMAP API →

Prism – Turn any OpenAPI file into an API server with mocking, transformations, validations, and more.

Prism is an open-source HTTP mock server that can mimic your API’s behavior as if you already built it. Mock HTTP servers are generated from your OpenAPI v2/v3 documents.

Installation per NPM/Yarn

# NPM
npm install -g @stoplight/prism-cli

# Yarn
yarn global add @stoplight/prism-cli

Once installed, serve your OpenAPI spec as follows:

prism mock petstore.yml

Prism →
Prism (GitHub) →

πŸ’‘ If you’re using Postman, you can use their built-in Mock Server option

Buiding a JAMstack API with Netlify Functions and Zapier Webhooks

In this tutorial, I’ll show you how to set up webhooks by Zapier to send information to a third-party service and how to integrate them into your JAMstack site using Netlify Functions. This combination allows you to quickly and easily create dynamic functionality on your JAMstack site and create services that do things existing APIs may not even support.

The Cloud Function will call the Zapier webhook, and the webhook – a paid feature of Zapier – is set up to perform an insertion of the data into a Google Spreadsheet.

const axios = require('axios');

exports.handler = async (event, context, callback) => {
  try {
    if(!event.body) {
        return { 
            statusCode: 500, 
            body: 'Name and email are required.'
        };
    }

    const body = JSON.parse(event.body);
    const email = body.email;
    const fullName = body.fullName;
    if(!email) {
        return { 
            statusCode: 500, 
            body: 'email parameter required' 
        };
    }
    if(!fullName) {
        return { 
            statusCode: 500, 
            body: 'name parameter required' 
        };
    }

    return axios({
      method: 'post',
      url: 'https://hooks.zapier.com/hooks/catch/2422393/otw0s6l/',
      data:{
            'email':email,
            'fullName':fullName
      }
    }).then(res => {
      console.log(res);
      return {
        statusCode:200, 
        body: JSON.stringify(res.data)
      }
    })
    .catch(err => {
      return { statusCode: 200, body: JSON.stringify(err.response.data.errors[0]) };
    });

  } catch (err) {[]
    return { statusCode: 500, body: err.toString() };
  }

};

JAMstack API with Netlify Functions and Zapier Webhooks, Part 1 →
Project Code (GitHub) →

Countries, An example GraphQL API

If you’re looking for an example GraphQL API to play with, check out Countries.

A public GraphQL API for information about countries, continents, and languages.

curl 'https://countries.trevorblades.com/' \
  -H 'Content-Type: application/json' \
  -d '{"query":"{ country(code: \"BE\") { name, native, emoji, currency, languages { code, name } } }"}'

The schema’s available on the playground.

Countries Playground →
Countries Source (GitHub) →

JSONbox – Free HTTP based JSON Storage

jsonbox.io lets you store, read & modify JSON data over HTTP APIs for free. Copy the URL below and start sending HTTP requests to play around with your data store.

Oh, this will come in handy for Workshops and quick Proof Of Concepts:

curl -X POST 'https://jsonbox.io/demobox_6d9e326c183fde7b' \
    -H 'content-type: application/json' \
    -d '{"name": "Jon Snow", "age": 25}'

// {"_id":"5d776a25fd6d3d6cb1d45c51","name":"Jon Snow","age":25,"_createdOn":"2019-09-10T09:17:25.607Z"}

Don’t know about the retention policy though πŸ˜‰

jsonbox.io →

Accessing a tweet using only its ID (and without the Twitter API)

Today I learned that Twitter totally ignores the username in the β€œtweet detail route” on their website. This allows you to view details of a (public) tweet when knowing only its ID, without needing to access the Twitter API (which is the default geeky approach I was first going to take).

Twitter’s tweet detail route has the form of https://twitter.com/{userName}/status/{tweetId}. When passing in a tweetId with a non-matching/invalid userName, the Twitter website will automatically redirect to the URL with the correct userName

Example: To see the contents of the tweet with id 932586791953158144 just visit https://twitter.com/anyuser/status/932586791953158144 and you’ll be redirected to its actual URL: https://twitter.com/bramus/status/932586791953158144

Handy 😊

Did this help you out? Like what you see?
Consider donating.

I don’t run ads on my blog nor do I do this for profit. A donation however would always put a smile on my face though. Thanks!

β˜•οΈ Buy me a Coffee ($3)

Nodal – API Services Made Easy With Node.js

nodal

Nodal is a web server for Node.js, optimized for building API services quickly and efficiently.

Boasting its own opinionated, explicit, idiomatic and highly-extensible framework, Nodal takes care of all of the hard decisions for you and your team. This allows you to focus on creating an effective product in a short timespan while minimizing technical debt

Nodal projects are ready to deploy to Heroku right out of the box, so you can have your website live in no time.

Comes with out-of-the-box working Controllers, Entities, Routing, Migrations, etc. This video will get you kickstarted:

Nodal →