27.xhtml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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/27.xhtml" />
  27. <title>I think that my website cleaning is finally finished &lt;https://y.st./en/weblog/2015/12-December/27.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/27.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/26.xhtml">&lt;Previous</a>
  60. <a rel="next" href="/en/weblog/2015/12-December/28.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>I think that my website cleaning is finally finished</h1>
  67. <p>Day 00295: Sunday, 2015 December 27</p>
  68. </header>
  69. <p>
  70. It turns out that my efforts to create a <abbr title="PHP: Hypertext Preprocessor">PHP</abbr>-based Web page downloader for my onion search engine may have been wasted.
  71. There is already a library available that might have worked.
  72. <a href="https://docs.guzzlephp.org/en/latest/">Guzzle</a> is available under the <abbr title="Massachusetts Institute of Technology">MIT</abbr> license and has even been coded to be appropriately-namespaced.
  73. I will use my own classes that I built yesterday for three reasons though, despite their dependency on <code>php5-curl</code>.
  74. First, I know that my classes work.
  75. Guzzle probably works, but there is a chance that it would fail to appropriately proxy the <abbr title="Domain Name System">DNS</abbr> queries like <a href="https://php.net/manual/en/function.file-get-contents.php"><code>file_get_contents()</code></a> does.
  76. Second, I know <strong>*how*</strong> my classes work.
  77. I know how to use my classes, as I had to figure out how to build them, but I will need to start learning from scratch if I use Guzzle instead.
  78. I would like to get my onion search engine up as soon as is feasible, so learning how to use other projects that I do not need is low on my priority list.
  79. But third, and perhaps most importantly, I think that my classes can download files from more <abbr title="Uniform Resource Identifier">URI</abbr>s than Guzzle.
  80. Guzzle works over <abbr title="Hypertext Transfer Protocol">HTTP</abbr> and its encrypted counterpart, <abbr title="Hypertext Transfer Protocol Secure">HTTPS</abbr>.
  81. My classes however, are backed by <abbr title="Client for URLs/Client URL Request Library/Curl URL Request Library">cURL</abbr>.
  82. I have not looked into all the protocols that <abbr title="Client for URLs/Client URL Request Library/Curl URL Request Library">cURL</abbr> can use, but I did see <a href="https://en.wikipedia.org/wiki/File_Transfer_Protocol"><abbr title="File Transfer Protocol">FTP</abbr></a>, <a href="https://en.wikipedia.org/wiki/File_Transfer_Protocol#FTPS"><abbr title="File Transfer Protocol Secure">FTPS</abbr></a>, and <a href="https://en.wikipedia.org/wiki/Gopher_%28protocol%29">Gopher</a> on the list, all three of which might be useful if I decide to expand my search engine to include more than just <abbr title="Hypertext Transfer Protocol">HTTP</abbr> and <abbr title="Hypertext Transfer Protocol Secure">HTTPS</abbr>.
  83. </p>
  84. <p>
  85. I fixed up the hyperlinks in the weblog navigation bar that cause all weblog pages to be recompiled daily.
  86. My first thought today was to keep the most recent weblog entry at <code>/en/weblog/latest.xhtml</code> <strong>*instead of*</strong> in its appropriate place.
  87. This would have fixed the issue while also not causing duplicated content across the website.
  88. However, it would mean that weblog entries would end up pointing their &quot;Next&gt;&quot; hyperlink at this address for a day, meaning that each entry page would be compiled three times: once on the first day it was posted (with no &quot;Next&gt;&quot; or &quot;Latest&gt;&gt;&quot; links), once on the second day (with both links added and pointing to <code>/en/weblog/latest.xhtml</code>), and once in its final form (with the &quot;Next&gt;&quot; hyperlink modified to point to the appropriate page).
  89. I decided instead to deal with the duplicate content and just copy the latest entry to <code>/en/weblog/latest.xhtml</code>.
  90. Each entry is still compiled twice, once with the &quot;Next&gt;&quot; and &quot;Latest&gt;&gt;&quot; links and once without.
  91. </p>
  92. <p>
  93. Having finished what I believe to be the last of my urgent website maintenance, I decided to clean up my <a href="https://notabug.org/y.st./php"><abbr title="PHP: Hypertext Preprocessor">PHP</abbr> library</a> a bit.
  94. The problem was that it was too specific to me.
  95. Parts of it were not generalized enough.
  96. </p>
  97. <p>
  98. First, I fixed up the <code>\st\y\abbr</code> class.
  99. This class used to hold abbreviations that I use on my websites.
  100. This set of abbreviations can never be completed though, due to clashes such as &quot;GB&quot; (United Kingdom of Great Britain and Northern Ireland) and &quot;GB&quot; (gigabyte).
  101. Instead, it basically is just a list of all the abbreviations that I have used at least once on one of my websites since <a href="https://authorednansyxlu.onion/en/weblog/2015/03-March/07.xhtml">2015-03-07</a>.
  102. That set is extremely arbitrary and will likely not fit most people&apos;s needs, so it should not be built into a reusable class.
  103. I have now stripped all abbreviations from the class itself, and instead programmed some simple logic that allows the class to parse the needed abbreviations out of either a file or an array.
  104. Due to the data format that I want to use, abbreviations needed to be accessed via keys that are sometimes not allowed in function names, meaning that my old method of accessing abbreviations would not do.
  105. I reprogrammed the class to allow access via array-like indexes, which broke every page that uses abbreviations on both of my websites.
  106. It was a major pain to go through every page fixing all the errors, but two good things came of this.
  107. First, instead of containing arbitrary abbreviations that may or may not be of help, the class now allows the user to specify any abbreviation that is needed.
  108. Second, the <abbr title="PHP: Hypertext Preprocessor">PHP</abbr> library will not have to be updated with each little abbreviation I need to add.
  109. As an added bonus, setting up alternate abbreviation translations for use on other-language sections of the website should be a breeze now, when the time comes.
  110. It will take some time getting used to the new abbreviation syntax that I need to use in my weblog entries though.
  111. </p>
  112. <p>
  113. Second, I worked on tuning up the <code>\st\y\weblogentry()</code> function.
  114. This function treats an arbitrary date that is related only to this one weblog as somehow special.
  115. It needed to be generalized better.
  116. This was impossible to accomplish cleanly in a function, so I upgraded it to a class.
  117. The function name has been bothering me for a while, as it does not match the style of my other function/class names, so because changing the function into a class would break all direct references to it anyway, I changed the name to <code>\st\y\day_number</code>.
  118. This class now takes a year, month, day, and zero-padding level to use when instantiating.
  119. Due to a glitch in the initial programming of this class, many pages may have been recompiled needlessly.
  120. However, once I had the error fixed, only the reference to the old function in the main compile script needed to be fixed.
  121. No other direct references to that function exist, and an object of this class is a drop-in replacement for the string variable I had been using to call the function previously.
  122. I have a feeling that this class will need to be modified slightly to accommodate translations to other languages later.
  123. </p>
  124. <p>
  125. Greatly needing a break, I took a short walk looking for an open Wi-Fi connection that I could use to root my secondary device.
  126. I quickly found that because the Web browser was disabled, I could not use captive portals.
  127. This ruled out practically ruled out all the open Wi-Fi connections that are run by businesses and <strong>*want*</strong> guests using their Wi-Fi as a way to draw in customers, so I instead focused my efforts on finding a residential hot spot that someone had not bothered to secure.
  128. After all, if they really wanted people to stay off their Wi-Fi connection, they would have put in place either a password or a <abbr title="media access control">MAC</abbr> address whitelist.
  129. It is not hard to do either.
  130. Sure enough, I found one, and quickly rooted the device.
  131. I will save further work on the device for another day, quite possibly tomorrow.
  132. </p>
  133. <p>
  134. My <a href="/a/canary.txt">canary</a> still sings the tune of freedom and transparency.
  135. </p>
  136. <hr/>
  137. <p>
  138. Copyright © 2015 Alex Yst;
  139. 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>.
  140. If for some reason you would prefer to modify and/or distribute this document under other free copyleft terms, please ask me via email.
  141. My address is in the source comments near the top of this document.
  142. This license also applies to embedded content such as images.
  143. For more information on that, see <a href="/en/a/licensing.xhtml">licensing</a>.
  144. </p>
  145. <p>
  146. <abbr title="World Wide Web Consortium">W3C</abbr> standards are important.
  147. This document conforms to the <a href="https://validator.w3.org./nu/?doc=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2015%2F12-December%2F27.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%2F27.xhtml"><abbr title="Cascading Style Sheets">CSS</abbr>3</a> specification.
  148. </p>
  149. </body>
  150. </html>