OpenGarden: A Tool to Open Walled Garden
InternetOpenGardenRSSRSS BrainDigital LifeOpenGarden source code is on Github.
The Walled Garden
The Internet used to be open. Users contributed content to online platforms and were able to access it freely without logging in and with many different clients. It’s not like this anymore. Many platforms like Twitter started to enforce login. Platforms like Reddit closed the API and third party app access. Platforms like TikTok were not even open in any way at the beginning, and you are at the mercy of the algorithm.
To fight back against the algorithm of those platforms, I built RSS Brain to control my feed. However, with more and more platforms closing their doors to third party applications, it’s more and more difficult to have usable RSS feeds. I use RSSHub for many of my feeds, but it’s less and less reliable, and the feed formats often have breaking changes. So I decided to develop my own tool to access the walled garden.
It used to be a tedious job to write a parser for each website. Not anymore, with the help of AI, as long as there is a good foundation and framework. OpenGarden is such a framework I built. I removed all the real website fetchers from the repo, but it’s very easy to build them with the help of AI. You can follow the doc here.
How OpenGarden Works
OpenGarden supports a few features: generate Atom feeds for a website, and get post details including the post content and comments. It does this with a real browser, and does not crawl aggressively. It behaves more like a real user.
In OpenGarden’s admin page (started on a different port), you can configure multiple browser profiles to fetch different websites. For each profile, you can log in to your accounts so that it can see the feeds on that website.
And with the logged in account’s feeds page, we don’t need to fetch aggressively: for each website, we just need to fetch this feeds page, parse the posts, and sort them into different RSS/Atom feeds. For example, it can fetch the Reddit homepage with your account logged in, and put each post into the proper subreddit, save them in the database, and serve them by subreddit when the Atom feed endpoint is requested. This fetch is only triggered when there is a request to the Atom feed endpoint, and a fetch is not needed if the content in the database is fresh enough. The generated Atom feeds can be used in any RSS client. It also exposes OPML, so that you can import all the Atom feeds that are fetched from the website. For example, with a Reddit account logged in, you can import all your subscribed subreddits into your RSS client.
Since we don’t click into each of the posts, the generated feed may miss some detailed info. OpenGarden also exposes APIs to get the detailed content of a post, which is also fetched through the real browser. This fetch is on demand, only when the user wants to see the post details, so the behaviour is like a real user and wouldn’t add additional load to the target websites.
RSS Brain Support
The Atom feeds that OpenGarden generates can be used by any RSS client, but the post detail endpoints need support from the client. I added support to RSS Brain, the RSS client I built. The feature is in the latest release.
I’m very happy with the result. Before that, RSS Brain used another library I built called Somment to fetch the comments from different websites. But it often got blocked. With OpenGarden, the fetch looks like a real user, so it has less chance to be blocked.
Roadmap
There are some other features I want to implement. The main one is supporting fetching from Android apps, since many platforms don’t even provide a web version. But I don’t have a spare Android device or other ARM devices that can run an Android VM efficiently. So I may need to wait for a while to implement it.
Another big one is to support video streaming so that I can just watch videos on my own client. But I haven’t researched enough to see if it can be implemented efficiently or not.