Skip to content

Commit

Permalink
Merge pull request #3050 from metabrainz/remove-blog
Browse files Browse the repository at this point in the history
Delete unused Blog component and /blog-data route
  • Loading branch information
anshg1214 authored Nov 28, 2024
2 parents 640e25d + 51fac36 commit 9d56ae0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 106 deletions.
85 changes: 0 additions & 85 deletions frontend/js/src/home/Blog.tsx

This file was deleted.

21 changes: 0 additions & 21 deletions listenbrainz/webserver/views/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,6 @@ def index():
return jsonify(props)


@index_bp.route("/blog-data/")
def blog_data():
"""Proxy to the MetaBrainz blog to get recent posts so that user IP addresses are not leaked to wordpress"""

cache_key = "blog-feed"
cache_blog_expires = 60*60
cached_blog = cache.get(cache_key)
if cached_blog:
return jsonify(cached_blog)

url = "https://public-api.wordpress.com/rest/v1.1/sites/blog.metabrainz.org/posts/"
try:
r = requests.get(url, timeout=5)
r.raise_for_status()
blog_data = r.json()
cache.set(cache_key, blog_data, cache_blog_expires)
return jsonify(blog_data)
except (requests.exceptions.HTTPError, requests.exceptions.ConnectionError):
return jsonify({}), 503


@index_bp.route("/current-status/", methods=['POST'])
@web_listenstore_needed
def current_status():
Expand Down

0 comments on commit 9d56ae0

Please sign in to comment.