Skip to content

chris-mcdo/django-overcomingbias-api

Repository files navigation

django-overcomingbias-api: an API to Robin Hanson's content

django-overcomingbias-api is a standalone Django app which lets you create and manage an API to (some of) Robin Hanson's content.

It scrapes the overcomingbias blog (and other sites) and presents the data in a structured form via a REST API. (I may add a GraphQL API later, too.)

Basic Usage

A graphical user interface is provided through the Django admin site.

To initialise a database of all overcomingbias posts, use the "pull" button:

Create and update overcomingbias posts from the admin site

Add new posts with "pull", and update modified posts with "sync". (You can also add content from YouTube and Spotify.)

Categorise content according to the "ideas" and "topics" it contains, or by generic "tags". Use the admin site and custom Admin Actions to manage content.

Link the app in your URL config to access the REST API:

# urls.py

urlpatterns = [
    ...
    path("", include("obapi.urls")),
    ...
]

You should then be able to access the automatic API documentation at URL /api/docs.

Alternatively, provide your own views for each post:

# urls.py
from django.urls import path, register_converter
from obapi.converters import OBPostNameConverter
from myapp.views import ob_detail_view

register_converter(OBPostNameConverter, "ob_name")
urlpatterns = [
    ...
    path(
        "content/overcomingbias/<ob_name:item_id>",
        ob_detail_view, # custom view
        name="obcontentitem_detail",
    ),
    ...
]

Features

Currently, content can be scraped from the following sources:

  • The overcomingbias blog (added automatically)
  • Robin Hanson's home page
  • YouTube videos (add videos manually using their URLs)
  • Spotify podcast episodes (add episodes manually using their URLs)

Documentation

Read the full documentation here, including the Installation and Getting Started Guide.

Bugs/Requests

Please use the GitHub issue tracker to submit bugs or request features.

Changelog

See the Changelog for a list of fixes and enhancements at each version.

License

Copyright (c) 2022 Christopher McDonald

Distributed under the terms of the MIT license.

All overcomingbias posts are copyright the original authors.

About

Create and manage an API to Robin Hanson's content

Resources

License

Stars

Watchers

Forks

Packages

No packages published