Live data from Hacker News

Use Netlify Functions and the Twitter API v2 as a CMS for Your Gatsby Blog

paulie.dev

11–20 of 22 posts

Re: Use Netlify Functions and the Twitter API v2 as a CMS for Your Gatsby Blog

#11

Not sure if using 3rd party services for a CMS is a good idea. What happens if this API or Netlify goes down? Doesn't seem reliable.

You are always relying on a 3rd party somewhere down the stack that's not a reason to dismiss a solution alone.

I can host a blog such that it only requires 2nd parties:

- My ISP

- My power company

Re: Use Netlify Functions and the Twitter API v2 as a CMS for Your Gatsby Blog

#12
Comments so far are negative, but not every solution needs to scale. I recently made a Netlify site where the CMS is just writing JSON out to GitHub. Yes, if GitHub goes down, it will break, but who cares? My site expects to only get a couple of weeks of editing every few years, so I don’t need something with more availability than that.

Re: Use Netlify Functions and the Twitter API v2 as a CMS for Your Gatsby Blog

#13
I would just make a request to Twitter for the profile on build for the two sites. Do you expect to update your profile more frequently than your two sites? ISTM, you can just trigger manual builds when you do update your profile, instead of using a function, which is going to constantly be looking up and returning the same information.

Re: Use Netlify Functions and the Twitter API v2 as a CMS for Your Gatsby Blog

#14

Earlier quoted context omitted.

You are always relying on a 3rd party somewhere down the stack that's not a reason to dismiss a solution alone.

I can host a blog such that it only requires 2nd parties: - My ISP - My power company

What would you use for DNS?

edit: Also they're third party. 1st is you 2nd party is the customer (The blog audience).

Re: Use Netlify Functions and the Twitter API v2 as a CMS for Your Gatsby Blog

#15

In this post I'm going to explain how you can use Netlify Functions to access your Twitter profile data using the Twitter v2 API and display it on your Gatsby blog.

Unrelated, but I love your theme and how snappy your blog is :)

Re: Use Netlify Functions and the Twitter API v2 as a CMS for Your Gatsby Blog

#19

I would just make a request to Twitter for the profile on build for the two sites. Do you expect to update your profile more frequently than your two sites? ISTM, you can just trigger manual builds when you do update your profile, instead of using a function, which is going to constantly be looking up and returning the same information.

Hey, and yes that would also work, as you say, for profile information that doesn't change that often it would perhaps be the better option. However, since this is a tutorial blog post it's aim was to inform readers of "one" way you can use Twitter as a CMS. There are of course many other ways to achieve this.

Re: Use Netlify Functions and the Twitter API v2 as a CMS for Your Gatsby Blog

#20
post #7

Not sure if using 3rd party services for a CMS is a good idea. What happens if this API or Netlify goes down? Doesn't seem reliable.

If the Twitter API is down, then you'll have blank spots on your page where there are supposed to be tweets. If Netlify goes down, you won't be able to publish, but your statically rendered site should still load just fine unless you are using it to make dynamic queries on the fly (which is, I think not generally done for Gatsby, but very possible to do)

A fair point. Also true for any front end that relies on an API to populate its data. Hacker News for instance will use a similar approach. If they concern is that sometimes API's may go down and data won't be displayed you can of course chose not to use API's in your front end. If you're not that bothered like me, that this is just. "one" way you "could" use Twitter as a CMS for you blog.
Post reply on HN