PageSourceSearch

https://www.towdium.me/api/

html towdium.me collected 2026-10-03 23:20:25 UTC 17,747 bytes, 576 lines download raw bytes

1<!DOCTYPE html>
2<html lang="en">
3
4<head>
5    <meta charset="utf-8">
6    <meta http-equiv="X-UA-Compatible" content="IE=edge">
7    <meta name="google-site-verification" content="xBT4GhYoi5qRD5tr338pgPM5OWHHIDR6mNg1a3euekI" />
8    <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
9    <meta name="description" content="这里是 Towdium 的个人博客,分享我的一些学习记录,以及日常的碎碎念">
10    <meta name="keywords"  content="Towdium">
11    <meta name="theme-color" content="#000000">
12    
13    <!-- Open Graph -->
14    <meta property="og:title" content="API - Towdium's here | A personal blog">
15    
16    <meta property="og:type" content="website">
17    <meta property="og:description" content="Welcome!">
18    
19    <meta property="og:image" content="http://towdium.github.io/img/site/avatar.jpg">
20    <meta property="og:url" content="http://towdium.github.io/api/">
21    <meta property="og:site_name" content="Towdium's here | A personal blog">
22    
23    <title>API - Towdium's here | A personal blog</title>
24
25    <!-- Web App Manifest -->
26    <link rel="manifest" href="/pwa/manifest.json">
27
28    <!-- Favicon -->
29    <link rel="shortcut icon" href="/img/site/favicon.ico">
30    
31    <!-- Canonical URL -->
32    <link rel="canonical" href="https://towdium.github.io/api/">
33
34    <!-- Bootstrap Core CSS -->
35    <link rel="stylesheet" href="/css/bootstrap.min.css">
36
37    <!-- Custom CSS -->
38    <link rel="stylesheet" href="/css/hux-blog.min.css">
39
40    <!-- Custom Fonts -->
41    <!-- <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> -->
42    <!-- Hux change font-awesome CDN to qiniu -->
43    <link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css">
44
45
46    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
47    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
48    <!--[if lt IE 9]>
49        
49<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
49
50        
50<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
50
51    <![endif]-->
52
53    <!-- ga & ba script hoook -->
54    
54<script></script>
54
55</head>
56
57
58<!-- hack iOS CSS :active style -->
59<body ontouchstart="">
60
61    <!-- Navigation -->
62
63<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
64
65    <div class="container-fluid">
66        <!-- Brand and toggle get grouped for better mobile display -->
67        <div class="navbar-header page-scroll">
68            <button type="button" class="navbar-toggle">
69                <span class="sr-only">Toggle navigation</span>
70                <span class="icon-bar"></span>
71                <span class="icon-bar"></span>
72                <span class="icon-bar"></span>
73            </button>
74            <a class="navbar-brand" href="/">Towdium's here</a>
75        </div>
76
77        <!-- Collect the nav links, forms, and other content for toggling -->
78        <div id="huxblog_navbar">
79            <div class="navbar-collapse">
80                <ul class="nav navbar-nav navbar-right">
81                    <li>
82                        <a href="/">Home</a>
83                    </li>
84                    
85                    
86                    
87                    
88                    <li>
89                        <a href="/about/">About</a>
90                    </li>
91                    
92                    
93                    
94                    <li>
95                        <a href="/api/">API</a>
96                    </li>
97                    
98                    
99                    
100                    <li>
101                        <a href="/archive/">Archive</a>
102                    </li>
103                    
104                    
105                    
106                    
107                    
108                    
109                    
110                    
111                    
112                    
113                    
114                    
115                    
116                    
117                    
118                    
119                    
120                    
121                </ul>
122            </div>
123        </div>
124        <!-- /.navbar-collapse -->
125    </div>
126    <!-- /.container -->
127</nav>
128<script>
129    // Drop Bootstarp low-performance Navbar
130    // Use customize navbar with high-quality material design animation
131    // in high-perf jank-free CSS3 implementation
132    var $body   = document.body;
133    var $toggle = document.querySelector('.navbar-toggle');
134    var $navbar = document.querySelector('#huxblog_navbar');
135    var $collapse = document.querySelector('.navbar-collapse');
136
137    var __HuxNav__ = {
138        close: function(){
139            $navbar.className = " ";
140            // wait until animation end.
141            setTimeout(function(){
142                // prevent frequently toggle
143                if($navbar.className.indexOf('in') < 0) {
144                    $collapse.style.height = "0px"
145                }
146            },400)
147        },
148        open: function(){
149            $collapse.style.height = "auto"
150            $navbar.className += " in";
151        }
152    }
153
154    // Bind Event
155    $toggle.addEventListener('click', function(e){
156        if ($navbar.className.indexOf('in') > 0) {
157            __HuxNav__.close()
158        }else{
159            __HuxNav__.open()
160        }
161    })
162
163    /**
164     * Since Fastclick is used to delegate 'touchstart' globally
165     * to hack 300ms delay in iOS by performing a fake 'click',
166     * Using 'e.stopPropagation' to stop 'touchstart' event from 
167     * $toggle/$collapse will break global delegation.
168     * 
169     * Instead, we use a 'e.target' filter to prevent handler
170     * added to document close HuxNav.  
171     *
172     * Also, we use 'click' instead of 'touchstart' as compromise
173     */
174    document.addEventListener('click', function(e){
175        if(e.target == $toggle) return;
176        if(e.target.className == 'icon-bar') return;
177        __HuxNav__.close();
178    })
179</script>
179
180
181
182    <!-- Page Header -->
183
184
185
186
187
188
189
190<header class="intro-header" style="background-image: url('https://api.towdium.me/unsplash/source/collection/645108/2600x500')">
191<div style="background: rgba(0, 0, 0,0.5);">
192  <div class="container">
193    <div class="row">
194      <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
195        
196        <div class="site-heading">
197        
198          <h1>API</h1>
199          <span class="subheading">Welcome!</span>
200        </div>
201      </div>
202    </div>
203  </div>
204</div>
205</header>
206
207
208<!-- Main Content -->
209<div class="container">
210	<div class="row">
211        
212
213<!-- USE SIDEBAR -->
214    <!-- PostList Container -->
215    		<div class="
216                col-lg-8 col-lg-offset-1
217                col-md-8 col-md-offset-1
218                col-sm-12
219                col-xs-12
220                postlist-container
221            ">
222    			<br/>
223
224<p>这个网站几年以来都有一个十分令我苦恼的问题:背景图片加载困难。你们也知道,我向来懒得为了一篇文章去找标题配图,这对我来说是麻烦而不必要的。于是我就利用了 Unsplash 的随机图片 API 来随机填充网页背景。但是结局你也肯定想到了,不管 Unsplash 的图片质量有多高,都改变不了墙内访问龟速的现状,以至于国内的小伙伴每次只能看到标题处的灰色方框。熟悉我黑历史的人可能知道,我以前曾经尝试过自建缓冲来加载 Unsplash 的内容,但是由于当时技术还太糙,导致一方面部署困难,一方面可靠性又十分堪忧,最后在勉强使用一年之后还是烂尾了。</p>
225
226<p>这一代 T 站的 API 也很简单,也就是我又一次尝试加速 Unsplash 的尝试,你只需要将原来访问 Unsplash API 的链接稍加修改,便可以以镜像的形式在墙内高速地访问 Unsplash 的服务,同时也不用担心这个简陋的镜像站会影响到你的全站 HTTPS。当然,如果你还不知道 Unsplash 是啥,你也可以简单理解为网页上方这个每次刷新都会重置的随机图片服务,同时还自带免费的裁切功能。使用方法极其简单,只要把 Unsplash 的链接:<br />
227<code class="language-plaintext highlighter-rouge">https://source.unsplash.com/collection/645108/2600x500</code><br />
228替换为镜像站的链接:<br />
229<code class="language-plaintext highlighter-rouge">https://api.towdium.me/unsplash/source/collection/645108/2600x500</code><br />
230然后万事大吉。</p>
231
232<p>镜像的使用方法想必是不用我多说了。那么 Unsplash API 文档那里可以领到呢?<a href="https://source.unsplash.com/">点击此处</a> 即可。在这篇臭屁文章的最后,我必须再次表达我对 Unsplash 的喜爱与赞美。</p>
233
234<blockquote>
235  <p>由 Caddy 强力驱动</p>
236</blockquote>
237
238
239
240
241<!-- disqus 评论框 start -->
242<div class="comment">
243    <div id="disqus_thread" class="disqus-thread">
244
245    </div>
246</div>
247<!-- disqus 评论框 end -->
248
249<!-- disqus 公共JS代码 start (一个网页只需插入一次) -->
250<script type="text/javascript">
251    /* * * CONFIGURATION VARIABLES * * */
252    var disqus_shortname = "towdium";
253    var disqus_identifier = "towdium//api/";
254    var disqus_url = "http://towdium.github.io/api/";
255
256    (function() {
257        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
258        dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
259        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
260    })();
261</script>
261
262<!-- disqus 公共JS代码 end -->
263
264
265    		</div>
266    <!-- Sidebar Container -->
267            <div class="
268                col-lg-3 col-lg-offset-0
269                col-md-3 col-md-offset-0
270                col-sm-12
271                col-xs-12
272                sidebar-container
273            ">
274                <!-- Featured Tags -->
275                
276
277
278<section>
279    
280    <h5><a href="/archive/">FEATURED TAGS</a></h5>
281    <div class="tags">
282        
283        
284        
285        </a>
286        
287        
288                <a data-sort="0029" 
289                    href="/archive/?tag=%E6%97%A5%E5%B8%B8"
290                    title="日常"
291                    rel="8">日常</a>
292        
293                <a data-sort="0024" 
294                    href="/archive/?tag=Java"
295                    title="Java"
296                    rel="13">Java</a>
297        
298                <a data-sort="0030" 
299                    href="/archive/?tag=%E5%BC%80%E5%8F%91"
300                    title="开发"
301                    rel="7">开发</a>
302        
303                <a data-sort="0030" 
304                    href="/archive/?tag=JECh"
305                    title="JECh"
306                    rel="7">JECh</a>
307        
308                <a data-sort="0031" 
309                    href="/archive/?tag=Atom"
310                    title="Atom"
311                    rel="6">Atom</a>
312        
313                <a data-sort="0031" 
314                    href="/archive/?tag=LaTeX"
315                    title="LaTeX"
316                    rel="6">LaTeX</a>
317        
318                <a data-sort="0034" 
319                    href="/archive/?tag=%E7%BD%91%E7%BB%9C"
320                    title="网络"
321                    rel="3">网络</a>
322        
323                <a data-sort="0035" 
324                    href="/archive/?tag=C"
325                    title="C"
326                    rel="2">C</a>
327        
328                <a data-sort="0035" 
329                    href="/archive/?tag=Jekyll"
330                    title="Jekyll"
331                    rel="2">Jekyll</a>
332        
333                <a data-sort="0035" 
334                    href="/archive/?tag=OOP"
335                    title="OOP"
336                    rel="2">OOP
337    </div>
338</section>
339
340
341                <!-- Short About -->
342                <section class="visible-md visible-lg">
343  <hr>
344  <h5><a href="/about/">ABOUT ME</a></h5>
345  <div class="short-about">
346    
347    <img src="/img/site/avatar.jpg" />
348    
349    
350    <p>A foolish engineer, a hobbyist programmer and a kindergarden English speaker.</p>
351    
352    <!-- SNS Link -->
353    
354
355
356<ul class="list-inline">
357
358
359  
360  <li>
361    <a href="/feed.xml">
362      <span class="fa-stack fa-lg">
363        <i class="fa fa-circle fa-stack-2x"></i>
364        <i class="fa fa-rss fa-stack-1x fa-inverse"></i>
365      </span>
366    </a>
367  </li>
368  
369  
370  
371  
372  <li>
373    <a target="_blank" href="http://weibo.com/5092127194">
374      <span class="fa-stack fa-lg">
375        <i class="fa fa-circle fa-stack-2x"></i>
376        <i class="fa fa-weibo fa-stack-1x fa-inverse"></i>
377      </span>
378    </a>
379  </li>
380  
381  
382  
383  <li>
384    <a target="_blank" href="https://github.com/towdium">
385      <span class="fa-stack fa-lg">
386        <i class="fa fa-circle fa-stack-2x"></i>
387        <i class="fa fa-github fa-stack-1x fa-inverse"></i>
388      </span>
389    </a>
390  </li>
391  
392  
393</ul>
394  </div>
395</section>
396
397                <!-- Friends Blog -->
398                
399<hr>
400<h5>FRIENDS</h5>
401<ul class="list-inline">
402  
403  <li><a href="http://shellcottage.me/">Shell Cottage</a></li>
404  
405  <li><a href="https://tartaricacid.github.io/">酒石酸菌</a></li>
406  
407</ul>
408
409    		</div>
410        
411	</div>
412</div>
413
414    <!-- Footer -->
415<footer>
416    <div class="container">
417        <div class="row">
418            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
419                <!-- SNS Link -->
420                
421
422
423<ul class="list-inline text-center">
424
425
426  
427  <li>
428    <a href="/feed.xml">
429      <span class="fa-stack fa-lg">
430        <i class="fa fa-circle fa-stack-2x"></i>
431        <i class="fa fa-rss fa-stack-1x fa-inverse"></i>
432      </span>
433    </a>
434  </li>
435  
436  
437  
438  
439  <li>
440    <a target="_blank" href="http://weibo.com/5092127194">
441      <span class="fa-stack fa-lg">
442        <i class="fa fa-circle fa-stack-2x"></i>
443        <i class="fa fa-weibo fa-stack-1x fa-inverse"></i>
444      </span>
445    </a>
446  </li>
447  
448  
449  
450  <li>
451    <a target="_blank" href="https://github.com/towdium">
452      <span class="fa-stack fa-lg">
453        <i class="fa fa-circle fa-stack-2x"></i>
454        <i class="fa fa-github fa-stack-1x fa-inverse"></i>
455      </span>
456    </a>
457  </li>
458  
459  
460</ul>
461
462                <p class="copyright text-muted">
463                    Copyright &copy; Towdium's here 2022
464                    <br>
465                    Powered by <a href="http://huangxuan.me">Hux Blog</a> |
466                    <iframe
467                        style="margin-left: 2px; margin-bottom:-5px;"
468                        frameborder="0" scrolling="0" width="100px" height="20px"
469                        src="https://ghbtns.com/github-btn.html?user=huxpro&repo=huxpro.github.io&type=star&count=true" >
470                    </iframe>
471                </p>
472            </div>
473        </div>
474    </div>
475</footer>
476
477<!-- jQuery -->
478<script src="/js/jquery.min.js "></script>
478
479
480<!-- Bootstrap Core JavaScript -->
481<!-- Currently, only navbar scroll-down effect at desktop still depends on this -->
482<script src="/js/bootstrap.min.js "></script>
482
483
484<!-- Custom Theme JavaScript -->
485<script src="/js/hux-blog.min.js "></script>
485
486
487<!-- Service Worker -->
488
489<script src="/js/snackbar.js "></script>
vendor: 1 bytes, line 489
489
490<script src="/js/sw-registration.js "></script>
490
491
492
493<!-- async load function -->
494<script>
495    function async(u, c) {
496      var d = document, t = 'script',
497          o = d.createElement(t),
498          s = d.getElementsByTagName(t)[0];
499      o.src = u;
500      if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
501      s.parentNode.insertBefore(o, s);
502    }
503</script>
503
504
505<!--
506     Because of the native support for backtick-style fenced code blocks
507     right within the Markdown is landed in Github Pages,
508     From V1.6, There is no need for Highlight.js,
509     so Huxblog drops it officially.
510
511     - https://github.com/blog/2100-github-pages-now-faster-and-simpler-with-jekyll-3-0
512     - https://help.github.com/articles/creating-and-highlighting-code-blocks/
513     - https://github.com/jneen/rouge/wiki/list-of-supported-languages-and-lexers
514-->
515<!--
516    
516<script>
517        async("http://cdn.bootcss.com/highlight.js/8.6/highlight.min.js", function(){
518            hljs.initHighlightingOnLoad();
519        })
520    </script>
520
521    <link href="http://cdn.bootcss.com/highlight.js/8.6/styles/github.min.css" rel="stylesheet">
522-->
523
524
525
526
527
528<!--fastClick.js -->
529<script>
530    async("//cdnjs.cloudflare.com/ajax/libs/fastclick/1.0.6/fastclick.min.js", function(){
531        var $nav = document.querySelector("nav");
532        if($nav) FastClick.attach($nav);
533    })
534</script>
534
535
536
537<!-- Google Analytics -->
538
539<script>
540    // dynamic User by Hux
541    var _gaId = 'UA-73095900-1';
542    var _gaDomain = 'www.towdium.me';
543
544    // Originial
545    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
546    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
547    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
548    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
549
550    ga('create', _gaId, _gaDomain);
551    ga('send', 'pageview');
552</script>
552
553
554
555
556<!-- Baidu Tongji -->
557
558
559
560<!-- Side Catalog -->
561
562
563
564<!-- Multi-Lingual -->
565
566
567
568
569<!-- Image to hack wechat -->
570<img src="/img/site/icon.png" width="0" height="0" />
571<!-- Migrate from head to bottom, no longer block render and still work -->
572
573<script type="module" src="https://static.cloudflareinsights.com/beacon.min.js/v31edd6df95cf4e85bb4c19e7a9bdbcba1788362987495" integrity="sha512-iIg7k2xntmwu6/uSb5tpc/hySgZc4eoL31yB29W6tJFo2akwjPWcEqnCEdJvGexCL0KEQwVYv5BlowfhVz26hg==" data-cf-beacon='{"version":"2024.11.0","token":"cc8aae5433c64f15922ee641785c7a8d","r":1,"spa":2}' crossorigin="anonymous"></script>
573
574</body>
575
576</html>

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.