Skip to content

Commit

Permalink
Web|Builder: Fine-tuning
Browse files Browse the repository at this point in the history
Fetch only a small number of posts from the blog. Describe download
and signature links with titles.

[ci skip]
  • Loading branch information
skyjake committed Mar 8, 2017
1 parent 9701b00 commit 3fcac50
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions webapi/1/.htaccess
@@ -0,0 +1,2 @@
Header set Access-Control-Allow-Origin "http://dengine.net"

6 changes: 4 additions & 2 deletions webapi/1/builds.php
Expand Up @@ -66,6 +66,7 @@ function download_file($filename, $mirror)

function generate_header($page_title)
{
header("Cache-Control: max-age=3600");
header('Content-Type: text/html;charset=UTF-8');

cache_echo("<!DOCTYPE html>\n");
Expand Down Expand Up @@ -146,7 +147,7 @@ function generate_build_page($number)
."<div class='fileinfo'>"
."<div class='filesize'>$mb_size MB</div>");
if (!empty($bin['signature'])) {
cache_echo("<a class='signature' href='".DENG_API_URL."/builds?signature=$bin[name]'>Sig &#x21E3;</a> ");
cache_echo("<a title='Get PGP Signature' class='signature' href='".DENG_API_URL."/builds?signature=$bin[name]'>Sig &#x21E3;</a> ");
}
cache_echo("<div class='hash'>MD5: <span class='digits'>$bin[md5]</span></div>");
cache_echo("</div>\n");
Expand All @@ -157,7 +158,7 @@ function generate_build_page($number)
$bits = ' '.$plat['cpu_bits'].'-bit ';
}
cache_echo("</td><td class='button'><a class='download' href='$main_url'>$fext$bits<span class='downarrow'>&#x21E3;</span></a>");
cache_echo("</td><td class='button'><a class='download mirror' href='$mirror_url'>Mirror <span class='downarrow'>&#x21E3;</span></a>");
cache_echo("</td><td class='button'><a title='Download from a SourceForge mirror' class='download mirror' href='$mirror_url'>Mirror <span class='downarrow'>&#x21E3;</span></a>");
cache_echo("</td></tr>\n");
}
}
Expand Down Expand Up @@ -294,6 +295,7 @@ function generate_build_index_page()

function generate_build_feed()
{
header("Cache-Control: max-age=10800");
header('Content-Type: application/rss+xml');

$ckey = cache_key('builds', 'feed');
Expand Down
3 changes: 2 additions & 1 deletion webapi/1/news.php
Expand Up @@ -20,9 +20,10 @@

function fetch_blog_feed($category)
{
header("Cache-Control: max-age=900");
header('Content-Type: application/json');

$json_url = "http://dengine.net/blog/category/$category/?json=true";
$json_url = "http://dengine.net/blog/category/$category/?json=true&count=3";
$ckey = cache_key('news', $category);
if (cache_try_load($ckey)) {
cache_dump();
Expand Down

0 comments on commit 3fcac50

Please sign in to comment.