Hi, how can I import RSS feed from one website, to my website? In a similiar way as if I’d create new posts in my blog, it’d add new post from rss in my website, like a blog I’d create. Also, if there is no RSS feed on their website, is it even possible to import their posts to my website?
Is this something you want to do once off, or every time you post on your other blog you want to pull content into your other blog?
Have you read the docs? Your question is already covered there.
That links to a Jekyll Import tool website including RSS capabilities
You can put that in a Ruby script instead of as a shell command
I want it to update every time the other website adds new post. I read docs, the other website is not mine, so that’s why I’m asking how I can use RSS to import from it to my website. Also, I think that the other website doesn’t even have RSS feed, so is there even any other way?
Your question started off with how to import RSS feed, but now it’s a different direction of how to import without using RSS. Which is not a well-defined or easy question and not really a Jekyll question anymore.
And also be sure there is no feed. Does “atom”, “rss” or “feed” appear anywhere in the page or source? If not the author didnt implement a feed probably and does not want to share their content through an RSS button.
Does /feed.xml or /feed.rss etc. exist?
I would avoid duplicating content from someone else’s site. Your content will get seen by Google as duplicated and you’re also at risk of copyright issues.
If you do really want to duplicate the content…
Well firstly is the site built on Jekyll? And is the content on GitHub? In that case you can fork the repo or copy the content in your site on schedule and commit the content and build the site. At the risk of page being moved or renamed or whatever and breaking your own site.
If the site is not built on Jekyll or it is not a public repo, then your question is generic. It then becomes how can I copy the content from any website on the web into mine? And that gets very messy because you can’t separate out content from templating like if you had the source markdown pages. And you have to use web scraping tools.
If all you want to do is have a live feed of a couple of their recent posts on your site and link to their original site for each post, then that is fine without content duplication issues.
And you could even use JS to pull in content from their site in real time. This works without Jekyll. like adding a tweet widget any site.
But since there is no RSS, it becomes impractical to pull in the data.
I guess you could pick up their post data from GitHub instead but that I’ve not seen before.
Why don’t you ask the author if they will add RSS?
If the external site has a blog post page, you could use an iframe to embed their content to yours. You need like 2 lines if code.
If would help if you explained why you want to pull this content in and how it will look. And a screen shot of what you’ve seen elsewhere. I can’t tell if you are trying to embed a couple of posts as previews on your site, or you want to copy their entire website. Also what is the point of doing a preview? You can link to their posts page and your website visitors can visit the other authors site for the full experience without having to see it through your site and that saves you a lot of trouble.
I tried looking into source code or trying /feed.xml etc. in url, but it didn’t work. Basically I want to show posts from their website on the one I’m working on rn, they’d just redirect to the original post on their website. Also, it’s for a company that sells their products in my country, the original company is from a different country.
Or even if it’d be possible, I’d want to import the post and just use google translate api to automatically translate it to my language
Okay thanks for the info.
Well maybe they have an API?
Open the site with the Network tab open in the browser dev tools. Maybe there is a request to /products.json or similar on the frontend to build the items up on the page.
And you can hit that directly on your frontend or when your site builds.
The Jekyll migrate plug-in didn’t do what I wanted, so I wrote a Ruby script that pulls in RSS feeds and saves the entries as custom Jekyll collections.
It currently has to be triggered manually, but I’m planning to set up a cron job to run the script daily and commit the results back to the repo. Probably could also become a proper plugin with a bit more work.
I know you were saying that the site might not have a feed at all, but I thought you might find this approach useful.
If you use GitHub Actions, you can easily set up a nightly job that runs shell commands to pull in RSS data and commit it
I have recipes here with and without an action to commit the files
Ah that’s cool, I’ll look into that. Thanks, much appreciated.