aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Cleberg <hello@cleberg.net>2023-05-31 21:49:22 -0500
committerChristian Cleberg <hello@cleberg.net>2023-05-31 21:49:22 -0500
commit56fe0065e094d3d75d46c335c10383ca07d87829 (patch)
tree9d4e4196524e1e2b309e38f620202f7f2f7048cc
parentaf59d12f91bd8c3d9adf4c0f539c0454c822f063 (diff)
downloadhn-56fe0065e094d3d75d46c335c10383ca07d87829.tar.gz
hn-56fe0065e094d3d75d46c335c10383ca07d87829.tar.bz2
hn-56fe0065e094d3d75d46c335c10383ca07d87829.zip
reduce API result load
-rw-r--r--index.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/index.php b/index.php
index c9f9a7e..8bd6e40 100644
--- a/index.php
+++ b/index.php
@@ -6,7 +6,7 @@ $elements = explode('/', $path);
if (empty($elements[0])) {
$html_output = get_stories(
- 'https://hacker-news.firebaseio.com/v0/topstories.json?limitToFirst=30&orderBy="$key"',
+ 'https://hacker-news.firebaseio.com/v0/topstories.json?limitToFirst=10&orderBy="$key"',
'Top'
);
echo_html(
@@ -19,7 +19,7 @@ if (empty($elements[0])) {
switch (array_shift($elements)) {
case 'top':
$html_output = get_stories(
- 'https://hacker-news.firebaseio.com/v0/topstories.json?limitToFirst=30&orderBy="$key"',
+ 'https://hacker-news.firebaseio.com/v0/topstories.json?limitToFirst=10&orderBy="$key"',
'Top'
);
echo_html(
@@ -32,7 +32,7 @@ if (empty($elements[0])) {
case 'best':
$html_output = get_stories(
- 'https://hacker-news.firebaseio.com/v0/beststories.json?limitToFirst=30&orderBy="$key"',
+ 'https://hacker-news.firebaseio.com/v0/beststories.json?limitToFirst=10&orderBy="$key"',
'Best'
);
echo_html(
@@ -45,7 +45,7 @@ if (empty($elements[0])) {
case 'new':
$html_output = get_stories(
- 'https://hacker-news.firebaseio.com/v0/newstories.json?limitToFirst=30&orderBy="$key"',
+ 'https://hacker-news.firebaseio.com/v0/newstories.json?limitToFirst=10&orderBy="$key"',
'New'
);
echo_html(
@@ -58,7 +58,7 @@ if (empty($elements[0])) {
case 'ask':
$html_output = get_stories(
- 'https://hacker-news.firebaseio.com/v0/askstories.json?limitToFirst=30&orderBy="$key"',
+ 'https://hacker-news.firebaseio.com/v0/askstories.json?limitToFirst=10&orderBy="$key"',
'Ask'
);
echo_html(
@@ -71,7 +71,7 @@ if (empty($elements[0])) {
case 'show':
$html_output = get_stories(
- 'https://hacker-news.firebaseio.com/v0/showstories.json?limitToFirst=30&orderBy="$key"',
+ 'https://hacker-news.firebaseio.com/v0/showstories.json?limitToFirst=10&orderBy="$key"',
'Show'
);
echo_html(
@@ -84,7 +84,7 @@ if (empty($elements[0])) {
case 'job':
$html_output = get_stories(
- 'https://hacker-news.firebaseio.com/v0/jobstories.json?limitToFirst=30&orderBy="$key"',
+ 'https://hacker-news.firebaseio.com/v0/jobstories.json?limitToFirst=10&orderBy="$key"',
'Job'
);
echo_html(