unlock icon indicating copy to clipboard operation
unlock copied to clipboard

Automatically import posts thru RSS feed

Open julien51 opened this issue 1 year ago • 3 comments

We currently post content to both https://paragraph.xyz/@unlockprotocol and https://unlock-protocol.com/blog We want to avoid having to do that step twice. For this, we should have a mechanism that automatically import posts from Paragraph and adds them automatically to our git repo inside https://github.com/unlock-protocol/unlock/tree/master/unlock-protocol-com/blog

The steps to do that:

  • create a Github action that runs once per day
  • This action will fetch the RSS feed from Paragraph https://paragraph.xyz/api/blogs/rss/@unlockprotocol
  • And for each post, it will create a new file this folder with the right header section (title, subtitle, authorName, publishDate, description and image.
  • the script should also fetch any image in the posts and store them locally in a subfolder of this one and replace the image URL to point to the local images (no hotlinking!)
  • Once done, the script should open a PR automatically to make sure these posts are added to the git repo!

julien51 avatar Mar 13 '24 14:03 julien51

Sorry @njokuScript but that doesn't work :

https://github.com/unlock-protocol/unlock/actions/runs/8302915385

Have you run the script locally?

julien51 avatar Mar 16 '24 11:03 julien51

Sorry @njokuScript but that doesn't work :

https://github.com/unlock-protocol/unlock/actions/runs/8302915385

Have you run the script locally?

Yeah, I can't even see the action on here

njokuScript avatar Mar 16 '24 18:03 njokuScript

Sorry @njokuScript but that doesn't work : https://github.com/unlock-protocol/unlock/actions/runs/8302915385 Have you run the script locally?

Yeah, I can't even see the action on here

Just raised a pr to fix this: https://github.com/unlock-protocol/unlock/pull/13478/

I converted the python script to js and also mocked it. So you can test out the script by uncommenting the mocked rssUrl and updating the blog dir to the blog mock folder.

njokuScript avatar Mar 16 '24 20:03 njokuScript