diff options
author | Christian Cleberg <hello@cleberg.net> | 2023-05-31 21:49:22 -0500 |
---|---|---|
committer | Christian Cleberg <hello@cleberg.net> | 2023-05-31 21:49:22 -0500 |
commit | 56fe0065e094d3d75d46c335c10383ca07d87829 (patch) | |
tree | 9d4e4196524e1e2b309e38f620202f7f2f7048cc | |
parent | af59d12f91bd8c3d9adf4c0f539c0454c822f063 (diff) | |
download | hn-56fe0065e094d3d75d46c335c10383ca07d87829.tar.gz hn-56fe0065e094d3d75d46c335c10383ca07d87829.tar.bz2 hn-56fe0065e094d3d75d46c335c10383ca07d87829.zip |
reduce API result load
-rw-r--r-- | index.php | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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( |