unlock
unlock copied to clipboard
Automatically import posts thru RSS feed
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,descriptionandimage. - 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!
Sorry @njokuScript but that doesn't work :
https://github.com/unlock-protocol/unlock/actions/runs/8302915385
Have you run the script locally?
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
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.