Git Product home page Git Product logo

fullstackbulletin / automation Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 1.0 967 KB

Serverless Step Function that generates a draft of a newsletter issue every week

Home Page: https://fullstackbulletin.com

License: MIT License

JavaScript 44.06% HTML 19.45% TypeScript 0.07% Rust 6.54% Nunjucks 29.79% Just 0.09%
automation aws javascript lambda mailchimp mastodon newsletter serverless step-function

automation's People

Contributors

dependabot[bot] avatar lmammino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

fennecdata

automation's Issues

Issue while running the lambda on AWS

{
  "errorMessage": "Cannot find module '/var/task/handler'",
  "errorType": "Error",
  "stackTrace": [
    "Function.Module._load (module.js:276:25)",
    "Module.require (module.js:353:17)",
    "require (internal/module.js:12:17)"
  ]
}

Replace PlaceIMG with something else

Fullstack Bulletin currently uses PlaceIMG as a way to get fallback article images when an image cannot be found.

Unfortunately, PlaceIMG is shutting down.

We need to find and integrate an alternative, for instance Unsplash, through their APIs

Quick PoC

curl "https://api.unsplash.com/photos/random?query=tech&client_id=<SOME_CLIENT_ID>" | jq -r .urls.small

# https://images.unsplash.com/photo-1526374965328-7f61d4dc18c5?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3w0NjYzNjZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2ODc2ODYzMzF8&ixlib=rb-4.0.3&q=80&w=400

Replace Twitter with Mastodon

Twitter has finally killed all our API access 😭

But the good news is that using Mastodon as an alternative seems quite easy!

So we have a profile already: https://mastodon.social/@fstackbulletin

And a snippet on how to get the profile timeline using megalodon:

import { Mastodon } from 'megalodon'

const BASE_URL = 'https://mastodon.social'
const accessToken = 'XXXX'

const client = new Mastodon(BASE_URL, accessToken)

const { data: account } = await client.verifyAccountCredentials()
const { data: posts } = await client.getAccountStatuses(account.id)
const links = posts
  .filter(post => post.card)
  .map(post => ({
    created_at: post.created_at,
    url: post.card.url,
    title: post.card.title,
    description: post.card.description
  }))

console.log(links)

Will output

[
  {
    created_at: '2023-06-26T21:47:15.617Z',
    url: 'https://calibreapp.com/blog/content-delivery-networks-guide',
    title: 'What is a CDN? An Unbiased Guide to Content Delivery Networks - Calibre ',
    description: 'A fast and resilient content delivery network is one of the best ways to improve the performance of your site. Here’s how to make an informed decision when choosing one.'
  },
  {
    created_at: '2023-06-26T21:46:55.835Z',
    url: 'https://cloudfour.com/thinks/animated-gif-alternative/',
    title: 'Is there a viable animated GIF alternative yet or what?',
    description: 'Animated GIFs remain popular in spite of their beefy file sizes. But what are we supposed to use instead?'
  },
  {
    created_at: '2023-06-26T21:46:12.829Z',
    url: 'https://hyperfetch.bettertyped.com/',
    title: 'Data Fetching, Offline First, Caching, Queueing | Hyper Fetch',
    description: 'Framework for requesting and realtime connection'
  },
  {
    created_at: '2023-06-26T21:45:47.820Z',
    url: 'https://sanity-io.github.io/GROQ/GROQ-1.revision1/',
    title: 'GROQ',
    description: ''
  },
  {
    created_at: '2023-06-26T21:45:13.592Z',
    url: 'https://antfu.me/posts/ai-qrcode',
    title: 'Stylistic QR Code with Stable Diffusion',
    description: ''
  },
  {
    created_at: '2023-06-26T21:44:44.559Z',
    url: 'https://kizu.dev/cyclic-toggles/',
    title: 'Cyclic Dependency Space Toggles',
    description: 'Over the past few years, I wanted to be able to select a value from a list in CSS by toggling a single custom property. We have the “space toggle” for booleans, and hopefully, one day, we’ll get style queries, but what about today? In this article, I present you with the technique I recently discovered.'
  }
]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.