Pushpull had stale data so we changed the endpoints to use Artic Shift which has fresh data

This commit is contained in:
2026-03-10 08:05:44 -05:00
parent 98da601540
commit 5bd9a1649c
3 changed files with 16 additions and 17 deletions

View File

@@ -129,11 +129,10 @@ async def _poll_new_posts_async():
client = create_client() client = create_client()
async with client: async with client:
for sub in subreddits: for sub in subreddits:
data = await fetch_json(client, "/reddit/search/submission/", { data = await fetch_json(client, "/api/posts/search", {
"subreddit": sub["name"], "subreddit": sub["name"],
"sort": "created_utc", "sort": "desc",
"sort_type": "desc", "limit": 100,
"size": 100,
}) })
if not data: if not data:
continue continue
@@ -163,11 +162,11 @@ async def _poll_hot_posts_async():
client = create_client() client = create_client()
async with client: async with client:
for sub in subreddits: for sub in subreddits:
data = await fetch_json(client, "/reddit/search/submission/", { data = await fetch_json(client, "/api/posts/search", {
"subreddit": sub["name"], "subreddit": sub["name"],
"sort": "score", "sort": "desc",
"sort_type": "desc", "sort_by": "score",
"size": 100, "limit": 100,
"after": after_epoch, "after": after_epoch,
}) })
if not data: if not data:
@@ -201,11 +200,10 @@ async def _collect_comments_async():
client = create_client() client = create_client()
async with client: async with client:
for sub in subreddits: for sub in subreddits:
data = await fetch_json(client, "/reddit/search/comment/", { data = await fetch_json(client, "/api/comments/search", {
"subreddit": sub["name"], "subreddit": sub["name"],
"sort": "created_utc", "sort": "desc",
"sort_type": "desc", "limit": 100,
"size": 100,
"after": cutoff_epoch, "after": cutoff_epoch,
}) })
if not data: if not data:
@@ -273,11 +271,10 @@ async def _update_scores_async():
client = create_client() client = create_client()
async with client: async with client:
for sub in subreddits: for sub in subreddits:
data = await fetch_json(client, "/reddit/search/submission/", { data = await fetch_json(client, "/api/posts/search", {
"subreddit": sub["name"], "subreddit": sub["name"],
"sort": "created_utc", "sort": "desc",
"sort_type": "desc", "limit": 100,
"size": 100,
"after": after_epoch, "after": after_epoch,
}) })
if not data: if not data:

View File

@@ -8,7 +8,7 @@ from backend.config import settings
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
BASE_URL = "https://api.pullpush.io" BASE_URL = "https://arctic-shift.photon-reddit.com"
# Simple in-process rate limiter: track request timestamps # Simple in-process rate limiter: track request timestamps
_request_times: list[float] = [] _request_times: list[float] = []

View File

@@ -8,6 +8,8 @@ const ranges = [
{ label: '7d', value: '7' }, { label: '7d', value: '7' },
{ label: '30d', value: '30' }, { label: '30d', value: '30' },
{ label: '90d', value: '90' }, { label: '90d', value: '90' },
{ label: '1y', value: '365' },
{ label: 'All', value: '3650' },
]; ];
export default function TimeRangeSelector({ value, onChange }: Props) { export default function TimeRangeSelector({ value, onChange }: Props) {