19 lines
497 B
Python
19 lines
497 B
Python
from flask import abort, Blueprint
|
|
from .openalex import APIClient
|
|
from .feed import construct_rss
|
|
|
|
|
|
def create_blueprint(config):
|
|
"""Create an OpenAlex endpoint blueprint."""
|
|
client = APIClient(config["email"])
|
|
openalex = Blueprint("openalex", __name__)
|
|
|
|
@openalex.route("/<string:name>", methods=["GET", "HEAD"])
|
|
def get(name: str):
|
|
return (
|
|
construct_rss(client, name),
|
|
{"Content-Type": "application/rss+xml"},
|
|
)
|
|
|
|
return openalex
|