26.xhtml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. h t t :: / / t /
  4. h t t :: // // t //
  5. h ttttt ttttt ppppp sssss // // y y sssss ttttt //
  6. hhhh t t p p s // // y y s t //
  7. h hh t t ppppp sssss // // yyyyy sssss t //
  8. h h t t p s :: / / y .. s t .. /
  9. h h t t p sssss :: / / yyyyy .. sssss t .. /
  10. <https://y.st./>
  11. Copyright © 2015 Alex Yst <mailto:copyright@y.st>
  12. This program is free software: you can redistribute it and/or modify
  13. it under the terms of the GNU General Public License as published by
  14. the Free Software Foundation, either version 3 of the License, or
  15. (at your option) any later version.
  16. This program is distributed in the hope that it will be useful,
  17. but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. GNU General Public License for more details.
  20. You should have received a copy of the GNU General Public License
  21. along with this program. If not, see <https://www.gnu.org./licenses/>.
  22. -->
  23. <!DOCTYPE html>
  24. <html xmlns="http://www.w3.org/1999/xhtml">
  25. <head>
  26. <base href="https://y.st./en/weblog/2015/12-December/26.xhtml" />
  27. <title>Work on my onion search engine begins &lt;https://y.st./en/weblog/2015/12-December/26.xhtml&gt;</title>
  28. <link rel="icon" type="image/png" href="/link/CC_BY-SA_4.0/y.st./icon.png" />
  29. <link rel="stylesheet" type="text/css" href="/link/basic.css" />
  30. <link rel="stylesheet" type="text/css" href="/link/site-specific.css" />
  31. <script type="text/javascript" src="/script/javascript.js" />
  32. <meta name="viewport" content="width=device-width" />
  33. </head>
  34. <body>
  35. <nav>
  36. <p>
  37. <a href="/en/">Home</a> |
  38. <a href="/en/a/about.xhtml">About</a> |
  39. <a href="/en/a/contact.xhtml">Contact</a> |
  40. <a href="/a/canary.txt">Canary</a> |
  41. <a href="/en/URI_research/"><abbr title="Uniform Resource Identifier">URI</abbr> research</a> |
  42. <a href="/en/opinion/">Opinions</a> |
  43. <a href="/en/coursework/">Coursework</a> |
  44. <a href="/en/law/">Law</a> |
  45. <a href="/en/a/links.xhtml">Links</a> |
  46. <a href="/en/weblog/2015/12-December/26.xhtml.asc">{this page}.asc</a>
  47. </p>
  48. <hr/>
  49. <p>
  50. Weblog index:
  51. <a href="/en/weblog/"><abbr title="American Standard Code for Information Interchange">ASCII</abbr> calendars</a> |
  52. <a href="/en/weblog/index_ol_ascending.xhtml">Ascending list</a> |
  53. <a href="/en/weblog/index_ol_descending.xhtml">Descending list</a>
  54. </p>
  55. <hr/>
  56. <p>
  57. Jump to entry:
  58. <a href="/en/weblog/2015/03-March/07.xhtml">&lt;&lt;First</a>
  59. <a rel="prev" href="/en/weblog/2015/12-December/25.xhtml">&lt;Previous</a>
  60. <a rel="next" href="/en/weblog/2015/12-December/27.xhtml">Next&gt;</a>
  61. <a href="/en/weblog/latest.xhtml">Latest&gt;&gt;</a>
  62. </p>
  63. <hr/>
  64. </nav>
  65. <header>
  66. <h1>Work on my onion search engine begins</h1>
  67. <p>Day 00294: Saturday, 2015 December 26</p>
  68. </header>
  69. <p>
  70. <a href="/en/weblog/2015/12-December/23.xhtml">Three days ago</a>, I added a new navigation bar to my weblog pages.
  71. At that time, my compile script rebuilt all of my weblog pages.
  72. The next day, my compile script rebuilt all the pages again.
  73. Confused, I figured that I had messed something up, and that the initial rebuild had not happened for some reason.
  74. But last night, it happened again, and I now know what happened.
  75. Because I added a link to the latest weblog entry to every weblog page, every weblog page will now be recompiled every day.
  76. This is not what I wanted, but it is what I asked the computer to do.
  77. And now, being that my website is composed entirely of static files, I do not know how to remedy this.
  78. If I had dynamic files, I could have the &quot;latest page&quot; link always point to a single page that I update daily, one that always redirects to the latest weblog entry.
  79. I do not want to break my policy of only using static files here though.
  80. If this is the future of this website, it means two things.
  81. First, the approaching deadline of the first of next month no longer has meaningful context, and is therefor invalid, as signatures on weblog pages will be updated daily.
  82. In other words, I now have no deadline.
  83. Second, there is going to be an increasing number of disk writes done daily.
  84. It will grow to ridiculous levels.
  85. I cannot allow this to be.
  86. I need to find a way to fix this, and I need to do it by the first of the month as to not miss the deadline that fixing this preserves.
  87. </p>
  88. <p>
  89. So far, I have come up with three ways to accomplish my goal of not rebuilding the entire weblog each day.
  90. The first, is to set up that redirect page that always points to the latest weblog entry.
  91. This is suboptimal because it involves adding a scripted page to a website otherwise composed of only static files.
  92. The second is to create a new page that always displays a second copy of the latest weblog entry.
  93. This is suboptimal because it involves adding a redundant page.
  94. The third idea is to use the <code>&lt;object/&gt;</code> tag in the navigation to display the ever-changing &quot;latest entry&quot; hyperlink.
  95. This is suboptimal because it not only stupidly puts a single hyperlink in a window in the otherwise-clean navigation, but it also will not display in text-based Web browsers.
  96. Of course, there is always the option of generating the hyperlink via JavaScript, but JavaScript should never be used for something as important as navigation.
  97. JavaScript use must <strong>*always*</strong> be optional for the user, while navigation should <strong>*always*</strong> be usable by any client that can understand basic <code>&lt;a/&gt;</code> tags.
  98. </p>
  99. <p>
  100. While trying to work through what to do about my weblog pages and their incessant recompilation, I started work on my onion search engine.
  101. I could not get <abbr title="PHP: Hypertext Preprocessor">PHP</abbr> to use a the assigned proxy for its <abbr title="Domain Name System">DNS</abbr> queries when using functions such as <a href="https://secure.php.net/manual/en/function.file-get-contents.php"><code>file_get_contents()</code></a>.
  102. Nate from <a href="ircs://irc.oftc.net:6697/%23php">#php</a> recommended instead using <abbr title="PHP: Hypertext Preprocessor">PHP</abbr>&apos;s <a href="https://php.net/manual/en/ref.curl.php"><abbr title="Client for URLs/Client URL Request Library/Curl URL Request Library">cURL</abbr> functions</a>.
  103. Accessing these functions required installing Debian&apos;s <a href="apt:php5-curl"><code>php5-curl</code></a> package.
  104. While these functions worked the first time without any struggle whatsoever, they involve passing around a resource handle, which I have always thought of as a messy way to do things.
  105. Additionally, retrieving multiple Web pages requires modifying the resource handle between each Web request, which seems even more messy.
  106. The obvious answer seemed to me to build a wrapper class for the whole thing.
  107. Most of the way through, I realized that having my wrapper class behave exactly as I needed it to for today&apos;s use case was short-sighted.
  108. I had thrown in a method that behaved oddly if you were not expecting it, as it modified the resource handle in the same function call as returning data from a Web request, and I had created a strange constructor method that made for less work for me, but did not behave as the regular <abbr title="Client for URLs/Client URL Request Library/Curl URL Request Library">cURL</abbr> resource handle initiation function did.
  109. I decided that the best option was to split my class into two different classes.
  110. The first class does all the <abbr title="Client for URLs/Client URL Request Library/Curl URL Request Library">cURL</abbr> resource handle wrapping.
  111. It seems though that the <abbr title="Client for URLs/Client URL Request Library/Curl URL Request Library">cURL</abbr> <abbr title="PHP: Hypertext Preprocessor">PHP</abbr> module adds three types of resource handles, each with their own functions, so one class should not handle them all.
  112. This class handles only the main type, and if other resource handles are needed later, I can build more classes.
  113. The second class I built extends the first class, modifies the constructor to do what I want it to, and adds the function to modify the resource handle and retrieve a Web page.
  114. </p>
  115. <p>
  116. My <a href="/a/canary.txt">canary</a> still sings the tune of freedom and transparency.
  117. </p>
  118. <hr/>
  119. <p>
  120. Copyright © 2015 Alex Yst;
  121. You may modify and/or redistribute this document under the terms of the <a rel="license" href="/license/gpl-3.0-standalone.xhtml"><abbr title="GNU&apos;s Not Unix">GNU</abbr> <abbr title="General Public License version Three or later">GPLv3+</abbr></a>.
  122. If for some reason you would prefer to modify and/or distribute this document under other free copyleft terms, please ask me via email.
  123. My address is in the source comments near the top of this document.
  124. This license also applies to embedded content such as images.
  125. For more information on that, see <a href="/en/a/licensing.xhtml">licensing</a>.
  126. </p>
  127. <p>
  128. <abbr title="World Wide Web Consortium">W3C</abbr> standards are important.
  129. This document conforms to the <a href="https://validator.w3.org./nu/?doc=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2015%2F12-December%2F26.xhtml"><abbr title="Extensible Hypertext Markup Language">XHTML</abbr> 5.1</a> specification and uses style sheets that conform to the <a href="http://jigsaw.w3.org./css-validator/validator?uri=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2015%2F12-December%2F26.xhtml"><abbr title="Cascading Style Sheets">CSS</abbr>3</a> specification.
  130. </p>
  131. </body>
  132. </html>