Load Hatena Blog posts into LlamaIndex for RAG
Hatena Blog Loader fetches articles from your Hatena Blog posts via the AtomPub API to load content into LlamaIndex.
Why it matters
Fetch and load article content from your Hatena Blog using the AtomPub API so you can index your blog posts for retrieval-augmented generation and semantic search applications.
Outcomes
What it gets done
Connect to Hatena Blog via AtomPub API with credentials
Fetch all blog post articles from your Hatena Blog account
Transform blog content into LlamaIndex document format
Load structured documents ready for indexing and RAG workflows
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/li-reader-readers-hatena-blog | bash Overview
Hatena Blog Loader
Hatena Blog Loader is a Python reader that fetches article content from your Hatena Blog using the AtomPub API. It converts posts into LlamaIndex documents. Use this when you need to load your own Hatena Blog content into LlamaIndex applications. It requires your personal AtomPub credentials from the Hatena Blog admin page.
What it does
Hatena Blog Loader retrieves article content from your personal Hatena Blog using the AtomPub API and converts it into documents for LlamaIndex.
When to use - and when NOT to
Use this loader when you need to load your own Hatena Blog content into LlamaIndex applications. You can get AtomPub credentials from the admin page after logging into Hatena Blog.
Do NOT use this loader if you need to fetch content from other people's blogs, as it requires AtomPub credentials from your own Hatena Blog admin page.
Inputs and outputs
You provide three authentication parameters: your AtomPub root endpoint, API key, and Hatena Blog username. All credentials are obtained from the Hatena Blog admin page after logging in.
The loader returns a collection of LlamaIndex documents containing your blog post content.
Integrations
This loader integrates with LlamaIndex, the data framework for building LLM applications. It's specifically designed as a data reader component within the LlamaIndex ecosystem.
It connects to Hatena Blog via the AtomPub API, the standard protocol for publishing and editing web resources on the Hatena blogging platform.
Installation and usage
Install the package:
pip install llama-index-readers-hatena-blog
Basic implementation:
import os
from llama_index.readers.hatena_blog import HatenaBlogReader
root_endpoint = os.getenv("ATOM_PUB_ROOT_ENDPOINT")
api_key = os.getenv("ATOM_PUB_API_KEY")
username = os.getenv("HATENA_BLOG_USERNAME")
reader = HatenaBlogReader(
root_endpoint=root_endpoint, api_key=api_key, username=username
)
documents = reader.load_data()
Who it's for
This loader serves Hatena Blog authors who want to load their published content into LlamaIndex applications.
Source README
Hatena Blog Loader
pip install llama-index-readers-hatena-blog
This loader fetches article from your own Hatena Blog blog posts using the AtomPub API.
You can get AtomPub info from the admin page after logging into Hatena Blog.
Usage
Here's an example usage of the HatenaBlogReader.
import os
from llama_index.readers.hatena_blog import HatenaBlogReader
root_endpoint = os.getenv("ATOM_PUB_ROOT_ENDPOINT")
api_key = os.getenv("ATOM_PUB_API_KEY")
username = os.getenv("HATENA_BLOG_USERNAME")
reader = HatenaBlogReader(
root_endpoint=root_endpoint, api_key=api_key, username=username
)
documents = reader.load_data()
This loader is designed to be used as a way to load data into LlamaIndex.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.