Browse Source

Edit known_api for tags and date

Phyks (Lucas Verney) 4 years ago
parent
commit
03153ed205

+ 45
- 45
blog/2015/01/index.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (138)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>
@@ -45,6 +45,49 @@
45 45
                 <div id="articles">
46 46
 <article>
47 47
 	<aside>
48
+		<p class="day">07</p>
49
+		<p class="month">Janvier</p>
50
+	</aside>
51
+	<div class="article">
52
+		<header><h1 class="article_title"><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></h1></header>
53
+		<!-- 
54
+    @author=Phyks
55
+    @date=07012015-1620
56
+    @title=Publishing through the Known API
57
+    @tags=Known
58
+-->
59
+
60
+<p>As stated in <a href="https://known.phyks.me/2015/thoughts-on-blogging-engine">my last article</a>, I'm considering moving my blog to Known. But I'm not a huge fan of WSIWYG editors. I find it handy sometimes, and can enjoy editing in Markdown on Github, but for a long post, I really prefer writing content on my own text editor and sending it online after. Plus I can maintain drafts this way and benefits from spell checking abilities with my dictionary.</p>
61
+<p>My goal is then to find a way to post to Known from my own PC, using some kind of local app or script.</p>
62
+<p>That's really really easy in fact, as every single URL in Known is also an API endpoint.</p>
63
+<p>But, first, let's talk about a standard way of doing it, that is not Known specific. You can install the <a href="https://github.com/idno/indiepub">IndiePub</a> plugin in Known to enable a <a href="https://indiewebcamp.com/Micropub">MicroPub</a> endpoint in Known.</p>
64
+<p><em>Note</em>: Take care of cloning the repo correctly in <code>IdnoPlugins</code> as the case matters. Indeed, I cloned it as <code>indiepub</code> (lower case) and it took me some time to figure out why it was not working. After having renamed the folder <code>IndiePub</code> everything works fine.</p>
65
+<p>Micropub is a standard way of publishing content to another website, so that, after having received an authorization from you, an app can publish content to your website. Some kind of standard (part of the <a href="https://indiewebcamp.com/">IndieWebCamp</a> stuff) API, like the one used by apps on silos to post things on your page.</p>
66
+<p>Then, you can use anything that speaks the Micropub to publish on your website. The most famous one may be <a href="http://quill.p3k.io/">Quill</a>, a webapp by <a href="http://aaronparecki.com/">aaronparecki</a>. Most of the available tools are written in PHP, but you can also find some libs in <a href="https://indiewebcamp.com/Python">Python</a> to handle this kind of stuff (although there does not seem to be any Micropub publishing libraries at the moment).</p>
67
+<p>But known also offers its own API which may be way easier to use, at least to start with. It can be used in basically the same way, but you don't have to worry as much about authentication and endpoints discovery.</p>
68
+<p>So, every URL endpoint is also an API endpoint. For instance, on your Known homepage, if you click on "status update" to post a new status update, and have a look at the form that appears, you will notice that it posts data to <code>/status/edit</code> (actually, when you click the "status update" button, you will notice there is a link on it to <code>/status/edit</code>, in case you do not have JS enabled). The form is a <code>POST</code> form and you have a <code>body</code> textarea. Let's try to have a look at the page at <code>status/edit</code> (with your browser). As you can see, you have the same form that allows you to publish a new status. But you can also directly send a query to this address, to post a new entry.</p>
69
+<p>For this purpose, you will have to go to your Settings, in the "Tools and apps" menu and get your API key. Then, you must authenticate every query you send to the API. To this purpose, Known uses a HMAC signature, to prevent from sending the API key in plaintext over the network. Your API key is private and should be kept secret on your side. You will have to create a HMAC signature, using sha256, of the URL you query, thanks to your API key. Snippets to do this in many languages are available <a href="http://www.jokecamp.com/blog/examples-of-creating-base64-hashes-using-hmac-sha256-in-different-languages/">here</a>. In these snippets, <code>message</code> is the API endpoint you query (for instance <code>/status/edit</code> in our previous example) and key is your API key.</p>
70
+<p>Then, you have to add specific headers to your query to authenticate. These are <code>X-KNOWN-USERNAME</code> which should be equal to your Known username and <code>X-KNOWN-SIGNATURE</code> which should be set to the previously computed signature. This can be done very easily with <code>curl</code> thanks to the command (updating the values of the headers to the correct one)</p>
71
+<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" http://known.example.org/status/edit</code></p>
72
+<p>For quick tests of the API, you can use the <code>API Tester</code> plugin, which will take care of forging the correct query based on your inputs. Then, you do not have to worry about building a HMAC signature and so on. You can also use it to check that the requests you send have valid signature (by comparing the generated one and yours) and so on.</p>
73
+<p>Then, you have to send a payload beside the headers. This payload will be the actual content that will be posted. You should pass it as a JSON encoded array (but you can also use other formats, see the <code>API Tester</code> plugin or directly the source code), as it is the easiest way. You should send it with <code>POST</code>.</p>
74
+<p>Let's have a look in details at our previous example, status update posting, <em>via</em> <code>/status/edit</code>. As we saw, the basic thing to send is the actual content of the status update, through the <code>body</code> field. Then, to post a "blah" status, the JSON encoded payload would look like</p>
75
+<p><code>{"body": "blah"}</code></p>
76
+<p>And you can post it with the following curl command:</p>
77
+<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" -X POST --data '{"body": "blah"}' http://known.example.org</code></p>
78
+<p>And here we go&nbsp;! Your first status update posted through the API&nbsp;!</p>
79
+<p>Depending on the choosen API endpoint, you might want to pass extra parameters. For example, with "posts" (<code>entry/</code> in the URLs), you have both a title (logically called <code>title</code>) and a body (as previously). Then, the payload for a post with title "blah" and content "blahblah" will look like</p>
80
+<p><code>{"title": "blah", "body": "blahblah"}</code></p>
81
+<p>Most of the endpoints also offer the ability to tweak the <code>created</code> param, to post a content in the paste or in the future (defaults to now). This is what I used to upload the articles from my previous blog to Known, for instance. This parameter is passed to the <a href="http://php.net/manual/fr/function.strtotime.php"><code>strtotime</code></a> PHP function, and should then be in a valid format for this function. Many valid formats are available, including relative ones (see the <a href="http://php.net/manual/fr/function.strtotime.php">doc</a> for more info), but the most straight-forward one, with absolute dating, might be to use ISO 8601, that is <code>YYYY-MM-DD HH:MM:SS</code>.</p>
82
+<p>The common endpoints that I have used so far are <code>/status/edit</code> and <code>/entry/edit</code> to post, respectively, status updates and long posts. A working script example (in Python) can be found <a href="https://git.phyks.me/Phyks/blog/blob/master/known.py">on my blog repository</a> (taking an entry in the format I used to have for my previous blog, and posting it to Known).</p>
83
+<p>Finally, if you want to use extra endpoints, there is no ready to use doc at the moment (see <a href="issue #225">https://github.com/idno/idno/issues/225</a> on Github), but the source code is very easily readable, once you know where to look for the infos&nbsp;:) So, you should know that almost everything in Known is an <code>Entity</code> (which is a common way to describe the content you post). Then, all the specific types of <code>Entities</code> (status, long posts, photos, like etc.) are handled by plugins, located in the <code>IdnoPlugins</code> folder. For instance, status are handled by <code>IdnoPlugins/Status</code> and long posts are handled by <code>IdnoPlugins/Text</code>.</p>
84
+<p>Every plugin declares its routes in the <code>Main.php</code> file. For instance, the <code>Status</code> plugin declares the routes <code>/status/edit</code> (post a new status), <code>/status/edit/([A-Za-z0-9]+)</code> (edit an existing status, the last parameter being the id of the status) and <code>/status/delete/([A-Za-z0-9])</code> (delte a status, same thing as the previous one). Every plugin also declares a content-type which are infos about the type of content it manages, in <code>ContentType.php</code>. Finally, looking in the <code>Pages/</code> folder, you will find scripts to handle the routes. For instance, for <code>/status/edit</code>, you will find in <code>Pages/Edit.php</code> the associated routes, to get and post content. </p>
85
+		<footer><p class="date">Le 07/01/2015 à 16:20</p>
86
+		<p class="tags">Tags : <a href="//phyks.me/tags/Known.html">Known</a></p></footer>
87
+	</div>
88
+</article>
89
+<article>
90
+	<aside>
48 91
 		<p class="day">05</p>
49 92
 		<p class="month">Janvier</p>
50 93
 	</aside>
@@ -107,49 +150,6 @@
107 150
 		<p class="month">Janvier</p>
108 151
 	</aside>
109 152
 	<div class="article">
110
-		<header><h1 class="article_title"><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></h1></header>
111
-		<!-- 
112
-    @author=Phyks
113
-    @date=02012015-1805
114
-    @title=Publishing through the Known API
115
-    @tags=Phyks
116
--->
117
-
118
-<p>As stated in <a href="https://known.phyks.me/2015/thoughts-on-blogging-engine">my last article</a>, I'm considering moving my blog to Known. But I'm not a huge fan of WSIWYG editors. I find it handy sometimes, and can enjoy editing in Markdown on Github, but for a long post, I really prefer writing content on my own text editor and sending it online after. Plus I can maintain drafts this way and benefits from spell checking abilities with my dictionary.</p>
119
-<p>My goal is then to find a way to post to Known from my own PC, using some kind of local app or script.</p>
120
-<p>That's really really easy in fact, as every single URL in Known is also an API endpoint.</p>
121
-<p>But, first, let's talk about a standard way of doing it, that is not Known specific. You can install the <a href="https://github.com/idno/indiepub">IndiePub</a> plugin in Known to enable a <a href="https://indiewebcamp.com/Micropub">MicroPub</a> endpoint in Known.</p>
122
-<p><em>Note</em>: Take care of cloning the repo correctly in <code>IdnoPlugins</code> as the case matters. Indeed, I cloned it as <code>indiepub</code> (lower case) and it took me some time to figure out why it was not working. After having renamed the folder <code>IndiePub</code> everything works fine.</p>
123
-<p>Micropub is a standard way of publishing content to another website, so that, after having received an authorization from you, an app can publish content to your website. Some kind of standard (part of the <a href="https://indiewebcamp.com/">IndieWebCamp</a> stuff) API, like the one used by apps on silos to post things on your page.</p>
124
-<p>Then, you can use anything that speaks the Micropub to publish on your website. The most famous one may be <a href="http://quill.p3k.io/">Quill</a>, a webapp by <a href="http://aaronparecki.com/">aaronparecki</a>. Most of the available tools are written in PHP, but you can also find some libs in <a href="https://indiewebcamp.com/Python">Python</a> to handle this kind of stuff (although there does not seem to be any Micropub publishing libraries at the moment).</p>
125
-<p>But known also offers its own API which may be way easier to use, at least to start with. It can be used in basically the same way, but you don't have to worry as much about authentication and endpoints discovery.</p>
126
-<p>So, every URL endpoint is also an API endpoint. For instance, on your Known homepage, if you click on "status update" to post a new status update, and have a look at the form that appears, you will notice that it posts data to <code>/status/edit</code> (actually, when you click the "status update" button, you will notice there is a link on it to <code>/status/edit</code>, in case you do not have JS enabled). The form is a <code>POST</code> form and you have a <code>body</code> textarea. Let's try to have a look at the page at <code>status/edit</code> (with your browser). As you can see, you have the same form that allows you to publish a new status. But you can also directly send a query to this address, to post a new entry.</p>
127
-<p>For this purpose, you will have to go to your Settings, in the "Tools and apps" menu and get your API key. Then, you must authenticate every query you send to the API. To this purpose, Known uses a HMAC signature, to prevent from sending the API key in plaintext over the network. Your API key is private and should be kept secret on your side. You will have to create a HMAC signature, using sha256, of the URL you query, thanks to your API key. Snippets to do this in many languages are available <a href="http://www.jokecamp.com/blog/examples-of-creating-base64-hashes-using-hmac-sha256-in-different-languages/">here</a>. In these snippets, <code>message</code> is the API endpoint you query (for instance <code>/status/edit</code> in our previous example) and key is your API key.</p>
128
-<p>Then, you have to add specific headers to your query to authenticate. These are <code>X-KNOWN-USERNAME</code> which should be equal to your Known username and <code>X-KNOWN-SIGNATURE</code> which should be set to the previously computed signature. This can be done very easily with <code>curl</code> thanks to the command (updating the values of the headers to the correct one)</p>
129
-<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" http://known.example.org/status/edit</code></p>
130
-<p>For quick tests of the API, you can use the <code>API Tester</code> plugin, which will take care of forging the correct query based on your inputs. Then, you do not have to worry about building a HMAC signature and so on. You can also use it to check that the requests you send have valid signature (by comparing the generated one and yours) and so on.</p>
131
-<p>Then, you have to send a payload beside the headers. This payload will be the actual content that will be posted. You should pass it as a JSON encoded array (but you can also use other formats, see the <code>API Tester</code> plugin or directly the source code), as it is the easiest way. You should send it with <code>POST</code>.</p>
132
-<p>Let's have a look in details at our previous example, status update posting, <em>via</em> <code>/status/edit</code>. As we saw, the basic thing to send is the actual content of the status update, through the <code>body</code> field. Then, to post a "blah" status, the JSON encoded payload would look like</p>
133
-<p><code>{"body": "blah"}</code></p>
134
-<p>And you can post it with the following curl command:</p>
135
-<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" -X POST --data '{"body": "blah"}' http://known.example.org</code></p>
136
-<p>And here we go&nbsp;! Your first status update posted through the API&nbsp;!</p>
137
-<p>Depending on the choosen API endpoint, you might want to pass extra parameters. For example, with "posts" (<code>entry/</code> in the URLs), you have both a title (logically called <code>title</code>) and a body (as previously). Then, the payload for a post with title "blah" and content "blahblah" will look like</p>
138
-<p><code>{"title": "blah", "body": "blahblah"}</code></p>
139
-<p>Most of the endpoints also offer the ability to tweak the <code>created</code> param, to post a content in the paste or in the future (defaults to now). This is what I used to upload the articles from my previous blog to Known, for instance. This parameter is passed to the <a href="http://php.net/manual/fr/function.strtotime.php"><code>strtotime</code></a> PHP function, and should then be in a valid format for this function. Many valid formats are available, including relative ones (see the <a href="http://php.net/manual/fr/function.strtotime.php">doc</a> for more info), but the most straight-forward one, with absolute dating, might be to use ISO 8601, that is <code>YYYY-MM-DD HH:MM:SS</code>.</p>
140
-<p>The common endpoints that I have used so far are <code>/status/edit</code> and <code>/entry/edit</code> to post, respectively, status updates and long posts. A working script example (in Python) can be found <a href="https://git.phyks.me/Phyks/blog/blob/master/known.py">on my blog repository</a> (taking an entry in the format I used to have for my previous blog, and posting it to Known).</p>
141
-<p>Finally, if you want to use extra endpoints, there is no ready to use doc at the moment (see <a href="issue #225">https://github.com/idno/idno/issues/225</a> on Github), but the source code is very easily readable, once you know where to look for the infos&nbsp;:) So, you should know that almost everything in Known is an <code>Entity</code> (which is a common way to describe the content you post). Then, all the specific types of <code>Entities</code> (status, long posts, photos, like etc.) are handled by plugins, located in the <code>IdnoPlugins</code> folder. For instance, status are handled by <code>IdnoPlugins/Status</code> and long posts are handled by <code>IdnoPlugins/Text</code>.</p>
142
-<p>Every plugin declares its routes in the <code>Main.php</code> file. For instance, the <code>Status</code> plugin declares the routes <code>/status/edit</code> (post a new status), <code>/status/edit/([A-Za-z0-9]+)</code> (edit an existing status, the last parameter being the id of the status) and <code>/status/delete/([A-Za-z0-9])</code> (delte a status, same thing as the previous one). Every plugin also declares a content-type which are infos about the type of content it manages, in <code>ContentType.php</code>. Finally, looking in the <code>Pages/</code> folder, you will find scripts to handle the routes. For instance, for <code>/status/edit</code>, you will find in <code>Pages/Edit.php</code> the associated routes, to get and post content. </p>
143
-		<footer><p class="date">Le 02/01/2015 à 18:05</p>
144
-		<p class="tags">Tags : <a href="//phyks.me/tags/Phyks.html">Phyks</a></p></footer>
145
-	</div>
146
-</article>
147
-<article>
148
-	<aside>
149
-		<p class="day">02</p>
150
-		<p class="month">Janvier</p>
151
-	</aside>
152
-	<div class="article">
153 153
 		<header><h1 class="article_title"><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></h1></header>
154 154
 		<!-- 
155 155
     @author=Phyks

+ 7
- 7
blog/2015/01/known_api.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (138)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>
@@ -45,16 +45,16 @@
45 45
                 <div id="articles">
46 46
 <article>
47 47
 	<aside>
48
-		<p class="day">02</p>
48
+		<p class="day">07</p>
49 49
 		<p class="month">Janvier</p>
50 50
 	</aside>
51 51
 	<div class="article">
52 52
 		<header><h1 class="article_title"><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></h1></header>
53 53
 		<!-- 
54 54
     @author=Phyks
55
-    @date=02012015-1805
55
+    @date=07012015-1620
56 56
     @title=Publishing through the Known API
57
-    @tags=Phyks
57
+    @tags=Known
58 58
 -->
59 59
 
60 60
 <p>As stated in <a href="https://known.phyks.me/2015/thoughts-on-blogging-engine">my last article</a>, I'm considering moving my blog to Known. But I'm not a huge fan of WSIWYG editors. I find it handy sometimes, and can enjoy editing in Markdown on Github, but for a long post, I really prefer writing content on my own text editor and sending it online after. Plus I can maintain drafts this way and benefits from spell checking abilities with my dictionary.</p>
@@ -82,8 +82,8 @@
82 82
 <p>The common endpoints that I have used so far are <code>/status/edit</code> and <code>/entry/edit</code> to post, respectively, status updates and long posts. A working script example (in Python) can be found <a href="https://git.phyks.me/Phyks/blog/blob/master/known.py">on my blog repository</a> (taking an entry in the format I used to have for my previous blog, and posting it to Known).</p>
83 83
 <p>Finally, if you want to use extra endpoints, there is no ready to use doc at the moment (see <a href="issue #225">https://github.com/idno/idno/issues/225</a> on Github), but the source code is very easily readable, once you know where to look for the infos&nbsp;:) So, you should know that almost everything in Known is an <code>Entity</code> (which is a common way to describe the content you post). Then, all the specific types of <code>Entities</code> (status, long posts, photos, like etc.) are handled by plugins, located in the <code>IdnoPlugins</code> folder. For instance, status are handled by <code>IdnoPlugins/Status</code> and long posts are handled by <code>IdnoPlugins/Text</code>.</p>
84 84
 <p>Every plugin declares its routes in the <code>Main.php</code> file. For instance, the <code>Status</code> plugin declares the routes <code>/status/edit</code> (post a new status), <code>/status/edit/([A-Za-z0-9]+)</code> (edit an existing status, the last parameter being the id of the status) and <code>/status/delete/([A-Za-z0-9])</code> (delte a status, same thing as the previous one). Every plugin also declares a content-type which are infos about the type of content it manages, in <code>ContentType.php</code>. Finally, looking in the <code>Pages/</code> folder, you will find scripts to handle the routes. For instance, for <code>/status/edit</code>, you will find in <code>Pages/Edit.php</code> the associated routes, to get and post content. </p>
85
-		<footer><p class="date">Le 02/01/2015 à 18:05</p>
86
-		<p class="tags">Tags : <a href="//phyks.me/tags/Phyks.html">Phyks</a></p></footer>
85
+		<footer><p class="date">Le 07/01/2015 à 16:20</p>
86
+		<p class="tags">Tags : <a href="//phyks.me/tags/Known.html">Known</a></p></footer>
87 87
 	</div>
88 88
 </article>
89 89
             </div>

+ 45
- 45
blog/2015/index.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (138)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>
@@ -45,6 +45,49 @@
45 45
                 <div id="articles">
46 46
 <article>
47 47
 	<aside>
48
+		<p class="day">07</p>
49
+		<p class="month">Janvier</p>
50
+	</aside>
51
+	<div class="article">
52
+		<header><h1 class="article_title"><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></h1></header>
53
+		<!-- 
54
+    @author=Phyks
55
+    @date=07012015-1620
56
+    @title=Publishing through the Known API
57
+    @tags=Known
58
+-->
59
+
60
+<p>As stated in <a href="https://known.phyks.me/2015/thoughts-on-blogging-engine">my last article</a>, I'm considering moving my blog to Known. But I'm not a huge fan of WSIWYG editors. I find it handy sometimes, and can enjoy editing in Markdown on Github, but for a long post, I really prefer writing content on my own text editor and sending it online after. Plus I can maintain drafts this way and benefits from spell checking abilities with my dictionary.</p>
61
+<p>My goal is then to find a way to post to Known from my own PC, using some kind of local app or script.</p>
62
+<p>That's really really easy in fact, as every single URL in Known is also an API endpoint.</p>
63
+<p>But, first, let's talk about a standard way of doing it, that is not Known specific. You can install the <a href="https://github.com/idno/indiepub">IndiePub</a> plugin in Known to enable a <a href="https://indiewebcamp.com/Micropub">MicroPub</a> endpoint in Known.</p>
64
+<p><em>Note</em>: Take care of cloning the repo correctly in <code>IdnoPlugins</code> as the case matters. Indeed, I cloned it as <code>indiepub</code> (lower case) and it took me some time to figure out why it was not working. After having renamed the folder <code>IndiePub</code> everything works fine.</p>
65
+<p>Micropub is a standard way of publishing content to another website, so that, after having received an authorization from you, an app can publish content to your website. Some kind of standard (part of the <a href="https://indiewebcamp.com/">IndieWebCamp</a> stuff) API, like the one used by apps on silos to post things on your page.</p>
66
+<p>Then, you can use anything that speaks the Micropub to publish on your website. The most famous one may be <a href="http://quill.p3k.io/">Quill</a>, a webapp by <a href="http://aaronparecki.com/">aaronparecki</a>. Most of the available tools are written in PHP, but you can also find some libs in <a href="https://indiewebcamp.com/Python">Python</a> to handle this kind of stuff (although there does not seem to be any Micropub publishing libraries at the moment).</p>
67
+<p>But known also offers its own API which may be way easier to use, at least to start with. It can be used in basically the same way, but you don't have to worry as much about authentication and endpoints discovery.</p>
68
+<p>So, every URL endpoint is also an API endpoint. For instance, on your Known homepage, if you click on "status update" to post a new status update, and have a look at the form that appears, you will notice that it posts data to <code>/status/edit</code> (actually, when you click the "status update" button, you will notice there is a link on it to <code>/status/edit</code>, in case you do not have JS enabled). The form is a <code>POST</code> form and you have a <code>body</code> textarea. Let's try to have a look at the page at <code>status/edit</code> (with your browser). As you can see, you have the same form that allows you to publish a new status. But you can also directly send a query to this address, to post a new entry.</p>
69
+<p>For this purpose, you will have to go to your Settings, in the "Tools and apps" menu and get your API key. Then, you must authenticate every query you send to the API. To this purpose, Known uses a HMAC signature, to prevent from sending the API key in plaintext over the network. Your API key is private and should be kept secret on your side. You will have to create a HMAC signature, using sha256, of the URL you query, thanks to your API key. Snippets to do this in many languages are available <a href="http://www.jokecamp.com/blog/examples-of-creating-base64-hashes-using-hmac-sha256-in-different-languages/">here</a>. In these snippets, <code>message</code> is the API endpoint you query (for instance <code>/status/edit</code> in our previous example) and key is your API key.</p>
70
+<p>Then, you have to add specific headers to your query to authenticate. These are <code>X-KNOWN-USERNAME</code> which should be equal to your Known username and <code>X-KNOWN-SIGNATURE</code> which should be set to the previously computed signature. This can be done very easily with <code>curl</code> thanks to the command (updating the values of the headers to the correct one)</p>
71
+<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" http://known.example.org/status/edit</code></p>
72
+<p>For quick tests of the API, you can use the <code>API Tester</code> plugin, which will take care of forging the correct query based on your inputs. Then, you do not have to worry about building a HMAC signature and so on. You can also use it to check that the requests you send have valid signature (by comparing the generated one and yours) and so on.</p>
73
+<p>Then, you have to send a payload beside the headers. This payload will be the actual content that will be posted. You should pass it as a JSON encoded array (but you can also use other formats, see the <code>API Tester</code> plugin or directly the source code), as it is the easiest way. You should send it with <code>POST</code>.</p>
74
+<p>Let's have a look in details at our previous example, status update posting, <em>via</em> <code>/status/edit</code>. As we saw, the basic thing to send is the actual content of the status update, through the <code>body</code> field. Then, to post a "blah" status, the JSON encoded payload would look like</p>
75
+<p><code>{"body": "blah"}</code></p>
76
+<p>And you can post it with the following curl command:</p>
77
+<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" -X POST --data '{"body": "blah"}' http://known.example.org</code></p>
78
+<p>And here we go&nbsp;! Your first status update posted through the API&nbsp;!</p>
79
+<p>Depending on the choosen API endpoint, you might want to pass extra parameters. For example, with "posts" (<code>entry/</code> in the URLs), you have both a title (logically called <code>title</code>) and a body (as previously). Then, the payload for a post with title "blah" and content "blahblah" will look like</p>
80
+<p><code>{"title": "blah", "body": "blahblah"}</code></p>
81
+<p>Most of the endpoints also offer the ability to tweak the <code>created</code> param, to post a content in the paste or in the future (defaults to now). This is what I used to upload the articles from my previous blog to Known, for instance. This parameter is passed to the <a href="http://php.net/manual/fr/function.strtotime.php"><code>strtotime</code></a> PHP function, and should then be in a valid format for this function. Many valid formats are available, including relative ones (see the <a href="http://php.net/manual/fr/function.strtotime.php">doc</a> for more info), but the most straight-forward one, with absolute dating, might be to use ISO 8601, that is <code>YYYY-MM-DD HH:MM:SS</code>.</p>
82
+<p>The common endpoints that I have used so far are <code>/status/edit</code> and <code>/entry/edit</code> to post, respectively, status updates and long posts. A working script example (in Python) can be found <a href="https://git.phyks.me/Phyks/blog/blob/master/known.py">on my blog repository</a> (taking an entry in the format I used to have for my previous blog, and posting it to Known).</p>
83
+<p>Finally, if you want to use extra endpoints, there is no ready to use doc at the moment (see <a href="issue #225">https://github.com/idno/idno/issues/225</a> on Github), but the source code is very easily readable, once you know where to look for the infos&nbsp;:) So, you should know that almost everything in Known is an <code>Entity</code> (which is a common way to describe the content you post). Then, all the specific types of <code>Entities</code> (status, long posts, photos, like etc.) are handled by plugins, located in the <code>IdnoPlugins</code> folder. For instance, status are handled by <code>IdnoPlugins/Status</code> and long posts are handled by <code>IdnoPlugins/Text</code>.</p>
84
+<p>Every plugin declares its routes in the <code>Main.php</code> file. For instance, the <code>Status</code> plugin declares the routes <code>/status/edit</code> (post a new status), <code>/status/edit/([A-Za-z0-9]+)</code> (edit an existing status, the last parameter being the id of the status) and <code>/status/delete/([A-Za-z0-9])</code> (delte a status, same thing as the previous one). Every plugin also declares a content-type which are infos about the type of content it manages, in <code>ContentType.php</code>. Finally, looking in the <code>Pages/</code> folder, you will find scripts to handle the routes. For instance, for <code>/status/edit</code>, you will find in <code>Pages/Edit.php</code> the associated routes, to get and post content. </p>
85
+		<footer><p class="date">Le 07/01/2015 à 16:20</p>
86
+		<p class="tags">Tags : <a href="//phyks.me/tags/Known.html">Known</a></p></footer>
87
+	</div>
88
+</article>
89
+<article>
90
+	<aside>
48 91
 		<p class="day">05</p>
49 92
 		<p class="month">Janvier</p>
50 93
 	</aside>
@@ -107,49 +150,6 @@
107 150
 		<p class="month">Janvier</p>
108 151
 	</aside>
109 152
 	<div class="article">
110
-		<header><h1 class="article_title"><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></h1></header>
111
-		<!-- 
112
-    @author=Phyks
113
-    @date=02012015-1805
114
-    @title=Publishing through the Known API
115
-    @tags=Phyks
116
--->
117
-
118
-<p>As stated in <a href="https://known.phyks.me/2015/thoughts-on-blogging-engine">my last article</a>, I'm considering moving my blog to Known. But I'm not a huge fan of WSIWYG editors. I find it handy sometimes, and can enjoy editing in Markdown on Github, but for a long post, I really prefer writing content on my own text editor and sending it online after. Plus I can maintain drafts this way and benefits from spell checking abilities with my dictionary.</p>
119
-<p>My goal is then to find a way to post to Known from my own PC, using some kind of local app or script.</p>
120
-<p>That's really really easy in fact, as every single URL in Known is also an API endpoint.</p>
121
-<p>But, first, let's talk about a standard way of doing it, that is not Known specific. You can install the <a href="https://github.com/idno/indiepub">IndiePub</a> plugin in Known to enable a <a href="https://indiewebcamp.com/Micropub">MicroPub</a> endpoint in Known.</p>
122
-<p><em>Note</em>: Take care of cloning the repo correctly in <code>IdnoPlugins</code> as the case matters. Indeed, I cloned it as <code>indiepub</code> (lower case) and it took me some time to figure out why it was not working. After having renamed the folder <code>IndiePub</code> everything works fine.</p>
123
-<p>Micropub is a standard way of publishing content to another website, so that, after having received an authorization from you, an app can publish content to your website. Some kind of standard (part of the <a href="https://indiewebcamp.com/">IndieWebCamp</a> stuff) API, like the one used by apps on silos to post things on your page.</p>
124
-<p>Then, you can use anything that speaks the Micropub to publish on your website. The most famous one may be <a href="http://quill.p3k.io/">Quill</a>, a webapp by <a href="http://aaronparecki.com/">aaronparecki</a>. Most of the available tools are written in PHP, but you can also find some libs in <a href="https://indiewebcamp.com/Python">Python</a> to handle this kind of stuff (although there does not seem to be any Micropub publishing libraries at the moment).</p>
125
-<p>But known also offers its own API which may be way easier to use, at least to start with. It can be used in basically the same way, but you don't have to worry as much about authentication and endpoints discovery.</p>
126
-<p>So, every URL endpoint is also an API endpoint. For instance, on your Known homepage, if you click on "status update" to post a new status update, and have a look at the form that appears, you will notice that it posts data to <code>/status/edit</code> (actually, when you click the "status update" button, you will notice there is a link on it to <code>/status/edit</code>, in case you do not have JS enabled). The form is a <code>POST</code> form and you have a <code>body</code> textarea. Let's try to have a look at the page at <code>status/edit</code> (with your browser). As you can see, you have the same form that allows you to publish a new status. But you can also directly send a query to this address, to post a new entry.</p>
127
-<p>For this purpose, you will have to go to your Settings, in the "Tools and apps" menu and get your API key. Then, you must authenticate every query you send to the API. To this purpose, Known uses a HMAC signature, to prevent from sending the API key in plaintext over the network. Your API key is private and should be kept secret on your side. You will have to create a HMAC signature, using sha256, of the URL you query, thanks to your API key. Snippets to do this in many languages are available <a href="http://www.jokecamp.com/blog/examples-of-creating-base64-hashes-using-hmac-sha256-in-different-languages/">here</a>. In these snippets, <code>message</code> is the API endpoint you query (for instance <code>/status/edit</code> in our previous example) and key is your API key.</p>
128
-<p>Then, you have to add specific headers to your query to authenticate. These are <code>X-KNOWN-USERNAME</code> which should be equal to your Known username and <code>X-KNOWN-SIGNATURE</code> which should be set to the previously computed signature. This can be done very easily with <code>curl</code> thanks to the command (updating the values of the headers to the correct one)</p>
129
-<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" http://known.example.org/status/edit</code></p>
130
-<p>For quick tests of the API, you can use the <code>API Tester</code> plugin, which will take care of forging the correct query based on your inputs. Then, you do not have to worry about building a HMAC signature and so on. You can also use it to check that the requests you send have valid signature (by comparing the generated one and yours) and so on.</p>
131
-<p>Then, you have to send a payload beside the headers. This payload will be the actual content that will be posted. You should pass it as a JSON encoded array (but you can also use other formats, see the <code>API Tester</code> plugin or directly the source code), as it is the easiest way. You should send it with <code>POST</code>.</p>
132
-<p>Let's have a look in details at our previous example, status update posting, <em>via</em> <code>/status/edit</code>. As we saw, the basic thing to send is the actual content of the status update, through the <code>body</code> field. Then, to post a "blah" status, the JSON encoded payload would look like</p>
133
-<p><code>{"body": "blah"}</code></p>
134
-<p>And you can post it with the following curl command:</p>
135
-<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" -X POST --data '{"body": "blah"}' http://known.example.org</code></p>
136
-<p>And here we go&nbsp;! Your first status update posted through the API&nbsp;!</p>
137
-<p>Depending on the choosen API endpoint, you might want to pass extra parameters. For example, with "posts" (<code>entry/</code> in the URLs), you have both a title (logically called <code>title</code>) and a body (as previously). Then, the payload for a post with title "blah" and content "blahblah" will look like</p>
138
-<p><code>{"title": "blah", "body": "blahblah"}</code></p>
139
-<p>Most of the endpoints also offer the ability to tweak the <code>created</code> param, to post a content in the paste or in the future (defaults to now). This is what I used to upload the articles from my previous blog to Known, for instance. This parameter is passed to the <a href="http://php.net/manual/fr/function.strtotime.php"><code>strtotime</code></a> PHP function, and should then be in a valid format for this function. Many valid formats are available, including relative ones (see the <a href="http://php.net/manual/fr/function.strtotime.php">doc</a> for more info), but the most straight-forward one, with absolute dating, might be to use ISO 8601, that is <code>YYYY-MM-DD HH:MM:SS</code>.</p>
140
-<p>The common endpoints that I have used so far are <code>/status/edit</code> and <code>/entry/edit</code> to post, respectively, status updates and long posts. A working script example (in Python) can be found <a href="https://git.phyks.me/Phyks/blog/blob/master/known.py">on my blog repository</a> (taking an entry in the format I used to have for my previous blog, and posting it to Known).</p>
141
-<p>Finally, if you want to use extra endpoints, there is no ready to use doc at the moment (see <a href="issue #225">https://github.com/idno/idno/issues/225</a> on Github), but the source code is very easily readable, once you know where to look for the infos&nbsp;:) So, you should know that almost everything in Known is an <code>Entity</code> (which is a common way to describe the content you post). Then, all the specific types of <code>Entities</code> (status, long posts, photos, like etc.) are handled by plugins, located in the <code>IdnoPlugins</code> folder. For instance, status are handled by <code>IdnoPlugins/Status</code> and long posts are handled by <code>IdnoPlugins/Text</code>.</p>
142
-<p>Every plugin declares its routes in the <code>Main.php</code> file. For instance, the <code>Status</code> plugin declares the routes <code>/status/edit</code> (post a new status), <code>/status/edit/([A-Za-z0-9]+)</code> (edit an existing status, the last parameter being the id of the status) and <code>/status/delete/([A-Za-z0-9])</code> (delte a status, same thing as the previous one). Every plugin also declares a content-type which are infos about the type of content it manages, in <code>ContentType.php</code>. Finally, looking in the <code>Pages/</code> folder, you will find scripts to handle the routes. For instance, for <code>/status/edit</code>, you will find in <code>Pages/Edit.php</code> the associated routes, to get and post content. </p>
143
-		<footer><p class="date">Le 02/01/2015 à 18:05</p>
144
-		<p class="tags">Tags : <a href="//phyks.me/tags/Phyks.html">Phyks</a></p></footer>
145
-	</div>
146
-</article>
147
-<article>
148
-	<aside>
149
-		<p class="day">02</p>
150
-		<p class="month">Janvier</p>
151
-	</aside>
152
-	<div class="article">
153 153
 		<header><h1 class="article_title"><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></h1></header>
154 154
 		<!-- 
155 155
     @author=Phyks

+ 2
- 2
blog/archives.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (138)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 45
- 45
blog/index.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (138)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>
@@ -45,6 +45,49 @@
45 45
                 <div id="articles">
46 46
 <article>
47 47
 	<aside>
48
+		<p class="day">07</p>
49
+		<p class="month">Janvier</p>
50
+	</aside>
51
+	<div class="article">
52
+		<header><h1 class="article_title"><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></h1></header>
53
+		<!-- 
54
+    @author=Phyks
55
+    @date=07012015-1620
56
+    @title=Publishing through the Known API
57
+    @tags=Known
58
+-->
59
+
60
+<p>As stated in <a href="https://known.phyks.me/2015/thoughts-on-blogging-engine">my last article</a>, I'm considering moving my blog to Known. But I'm not a huge fan of WSIWYG editors. I find it handy sometimes, and can enjoy editing in Markdown on Github, but for a long post, I really prefer writing content on my own text editor and sending it online after. Plus I can maintain drafts this way and benefits from spell checking abilities with my dictionary.</p>
61
+<p>My goal is then to find a way to post to Known from my own PC, using some kind of local app or script.</p>
62
+<p>That's really really easy in fact, as every single URL in Known is also an API endpoint.</p>
63
+<p>But, first, let's talk about a standard way of doing it, that is not Known specific. You can install the <a href="https://github.com/idno/indiepub">IndiePub</a> plugin in Known to enable a <a href="https://indiewebcamp.com/Micropub">MicroPub</a> endpoint in Known.</p>
64
+<p><em>Note</em>: Take care of cloning the repo correctly in <code>IdnoPlugins</code> as the case matters. Indeed, I cloned it as <code>indiepub</code> (lower case) and it took me some time to figure out why it was not working. After having renamed the folder <code>IndiePub</code> everything works fine.</p>
65
+<p>Micropub is a standard way of publishing content to another website, so that, after having received an authorization from you, an app can publish content to your website. Some kind of standard (part of the <a href="https://indiewebcamp.com/">IndieWebCamp</a> stuff) API, like the one used by apps on silos to post things on your page.</p>
66
+<p>Then, you can use anything that speaks the Micropub to publish on your website. The most famous one may be <a href="http://quill.p3k.io/">Quill</a>, a webapp by <a href="http://aaronparecki.com/">aaronparecki</a>. Most of the available tools are written in PHP, but you can also find some libs in <a href="https://indiewebcamp.com/Python">Python</a> to handle this kind of stuff (although there does not seem to be any Micropub publishing libraries at the moment).</p>
67
+<p>But known also offers its own API which may be way easier to use, at least to start with. It can be used in basically the same way, but you don't have to worry as much about authentication and endpoints discovery.</p>
68
+<p>So, every URL endpoint is also an API endpoint. For instance, on your Known homepage, if you click on "status update" to post a new status update, and have a look at the form that appears, you will notice that it posts data to <code>/status/edit</code> (actually, when you click the "status update" button, you will notice there is a link on it to <code>/status/edit</code>, in case you do not have JS enabled). The form is a <code>POST</code> form and you have a <code>body</code> textarea. Let's try to have a look at the page at <code>status/edit</code> (with your browser). As you can see, you have the same form that allows you to publish a new status. But you can also directly send a query to this address, to post a new entry.</p>
69
+<p>For this purpose, you will have to go to your Settings, in the "Tools and apps" menu and get your API key. Then, you must authenticate every query you send to the API. To this purpose, Known uses a HMAC signature, to prevent from sending the API key in plaintext over the network. Your API key is private and should be kept secret on your side. You will have to create a HMAC signature, using sha256, of the URL you query, thanks to your API key. Snippets to do this in many languages are available <a href="http://www.jokecamp.com/blog/examples-of-creating-base64-hashes-using-hmac-sha256-in-different-languages/">here</a>. In these snippets, <code>message</code> is the API endpoint you query (for instance <code>/status/edit</code> in our previous example) and key is your API key.</p>
70
+<p>Then, you have to add specific headers to your query to authenticate. These are <code>X-KNOWN-USERNAME</code> which should be equal to your Known username and <code>X-KNOWN-SIGNATURE</code> which should be set to the previously computed signature. This can be done very easily with <code>curl</code> thanks to the command (updating the values of the headers to the correct one)</p>
71
+<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" http://known.example.org/status/edit</code></p>
72
+<p>For quick tests of the API, you can use the <code>API Tester</code> plugin, which will take care of forging the correct query based on your inputs. Then, you do not have to worry about building a HMAC signature and so on. You can also use it to check that the requests you send have valid signature (by comparing the generated one and yours) and so on.</p>
73
+<p>Then, you have to send a payload beside the headers. This payload will be the actual content that will be posted. You should pass it as a JSON encoded array (but you can also use other formats, see the <code>API Tester</code> plugin or directly the source code), as it is the easiest way. You should send it with <code>POST</code>.</p>
74
+<p>Let's have a look in details at our previous example, status update posting, <em>via</em> <code>/status/edit</code>. As we saw, the basic thing to send is the actual content of the status update, through the <code>body</code> field. Then, to post a "blah" status, the JSON encoded payload would look like</p>
75
+<p><code>{"body": "blah"}</code></p>
76
+<p>And you can post it with the following curl command:</p>
77
+<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" -X POST --data '{"body": "blah"}' http://known.example.org</code></p>
78
+<p>And here we go&nbsp;! Your first status update posted through the API&nbsp;!</p>
79
+<p>Depending on the choosen API endpoint, you might want to pass extra parameters. For example, with "posts" (<code>entry/</code> in the URLs), you have both a title (logically called <code>title</code>) and a body (as previously). Then, the payload for a post with title "blah" and content "blahblah" will look like</p>
80
+<p><code>{"title": "blah", "body": "blahblah"}</code></p>
81
+<p>Most of the endpoints also offer the ability to tweak the <code>created</code> param, to post a content in the paste or in the future (defaults to now). This is what I used to upload the articles from my previous blog to Known, for instance. This parameter is passed to the <a href="http://php.net/manual/fr/function.strtotime.php"><code>strtotime</code></a> PHP function, and should then be in a valid format for this function. Many valid formats are available, including relative ones (see the <a href="http://php.net/manual/fr/function.strtotime.php">doc</a> for more info), but the most straight-forward one, with absolute dating, might be to use ISO 8601, that is <code>YYYY-MM-DD HH:MM:SS</code>.</p>
82
+<p>The common endpoints that I have used so far are <code>/status/edit</code> and <code>/entry/edit</code> to post, respectively, status updates and long posts. A working script example (in Python) can be found <a href="https://git.phyks.me/Phyks/blog/blob/master/known.py">on my blog repository</a> (taking an entry in the format I used to have for my previous blog, and posting it to Known).</p>
83
+<p>Finally, if you want to use extra endpoints, there is no ready to use doc at the moment (see <a href="issue #225">https://github.com/idno/idno/issues/225</a> on Github), but the source code is very easily readable, once you know where to look for the infos&nbsp;:) So, you should know that almost everything in Known is an <code>Entity</code> (which is a common way to describe the content you post). Then, all the specific types of <code>Entities</code> (status, long posts, photos, like etc.) are handled by plugins, located in the <code>IdnoPlugins</code> folder. For instance, status are handled by <code>IdnoPlugins/Status</code> and long posts are handled by <code>IdnoPlugins/Text</code>.</p>
84
+<p>Every plugin declares its routes in the <code>Main.php</code> file. For instance, the <code>Status</code> plugin declares the routes <code>/status/edit</code> (post a new status), <code>/status/edit/([A-Za-z0-9]+)</code> (edit an existing status, the last parameter being the id of the status) and <code>/status/delete/([A-Za-z0-9])</code> (delte a status, same thing as the previous one). Every plugin also declares a content-type which are infos about the type of content it manages, in <code>ContentType.php</code>. Finally, looking in the <code>Pages/</code> folder, you will find scripts to handle the routes. For instance, for <code>/status/edit</code>, you will find in <code>Pages/Edit.php</code> the associated routes, to get and post content. </p>
85
+		<footer><p class="date">Le 07/01/2015 à 16:20</p>
86
+		<p class="tags">Tags : <a href="//phyks.me/tags/Known.html">Known</a></p></footer>
87
+	</div>
88
+</article>
89
+<article>
90
+	<aside>
48 91
 		<p class="day">05</p>
49 92
 		<p class="month">Janvier</p>
50 93
 	</aside>
@@ -144,49 +187,6 @@
144 187
 </article>
145 188
 <article>
146 189
 	<aside>
147
-		<p class="day">02</p>
148
-		<p class="month">Janvier</p>
149
-	</aside>
150
-	<div class="article">
151
-		<header><h1 class="article_title"><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></h1></header>
152
-		<!-- 
153
-    @author=Phyks
154
-    @date=02012015-1805
155
-    @title=Publishing through the Known API
156
-    @tags=Phyks
157
--->
158
-
159
-<p>As stated in <a href="https://known.phyks.me/2015/thoughts-on-blogging-engine">my last article</a>, I'm considering moving my blog to Known. But I'm not a huge fan of WSIWYG editors. I find it handy sometimes, and can enjoy editing in Markdown on Github, but for a long post, I really prefer writing content on my own text editor and sending it online after. Plus I can maintain drafts this way and benefits from spell checking abilities with my dictionary.</p>
160
-<p>My goal is then to find a way to post to Known from my own PC, using some kind of local app or script.</p>
161
-<p>That's really really easy in fact, as every single URL in Known is also an API endpoint.</p>
162
-<p>But, first, let's talk about a standard way of doing it, that is not Known specific. You can install the <a href="https://github.com/idno/indiepub">IndiePub</a> plugin in Known to enable a <a href="https://indiewebcamp.com/Micropub">MicroPub</a> endpoint in Known.</p>
163
-<p><em>Note</em>: Take care of cloning the repo correctly in <code>IdnoPlugins</code> as the case matters. Indeed, I cloned it as <code>indiepub</code> (lower case) and it took me some time to figure out why it was not working. After having renamed the folder <code>IndiePub</code> everything works fine.</p>
164
-<p>Micropub is a standard way of publishing content to another website, so that, after having received an authorization from you, an app can publish content to your website. Some kind of standard (part of the <a href="https://indiewebcamp.com/">IndieWebCamp</a> stuff) API, like the one used by apps on silos to post things on your page.</p>
165
-<p>Then, you can use anything that speaks the Micropub to publish on your website. The most famous one may be <a href="http://quill.p3k.io/">Quill</a>, a webapp by <a href="http://aaronparecki.com/">aaronparecki</a>. Most of the available tools are written in PHP, but you can also find some libs in <a href="https://indiewebcamp.com/Python">Python</a> to handle this kind of stuff (although there does not seem to be any Micropub publishing libraries at the moment).</p>
166
-<p>But known also offers its own API which may be way easier to use, at least to start with. It can be used in basically the same way, but you don't have to worry as much about authentication and endpoints discovery.</p>
167
-<p>So, every URL endpoint is also an API endpoint. For instance, on your Known homepage, if you click on "status update" to post a new status update, and have a look at the form that appears, you will notice that it posts data to <code>/status/edit</code> (actually, when you click the "status update" button, you will notice there is a link on it to <code>/status/edit</code>, in case you do not have JS enabled). The form is a <code>POST</code> form and you have a <code>body</code> textarea. Let's try to have a look at the page at <code>status/edit</code> (with your browser). As you can see, you have the same form that allows you to publish a new status. But you can also directly send a query to this address, to post a new entry.</p>
168
-<p>For this purpose, you will have to go to your Settings, in the "Tools and apps" menu and get your API key. Then, you must authenticate every query you send to the API. To this purpose, Known uses a HMAC signature, to prevent from sending the API key in plaintext over the network. Your API key is private and should be kept secret on your side. You will have to create a HMAC signature, using sha256, of the URL you query, thanks to your API key. Snippets to do this in many languages are available <a href="http://www.jokecamp.com/blog/examples-of-creating-base64-hashes-using-hmac-sha256-in-different-languages/">here</a>. In these snippets, <code>message</code> is the API endpoint you query (for instance <code>/status/edit</code> in our previous example) and key is your API key.</p>
169
-<p>Then, you have to add specific headers to your query to authenticate. These are <code>X-KNOWN-USERNAME</code> which should be equal to your Known username and <code>X-KNOWN-SIGNATURE</code> which should be set to the previously computed signature. This can be done very easily with <code>curl</code> thanks to the command (updating the values of the headers to the correct one)</p>
170
-<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" http://known.example.org/status/edit</code></p>
171
-<p>For quick tests of the API, you can use the <code>API Tester</code> plugin, which will take care of forging the correct query based on your inputs. Then, you do not have to worry about building a HMAC signature and so on. You can also use it to check that the requests you send have valid signature (by comparing the generated one and yours) and so on.</p>
172
-<p>Then, you have to send a payload beside the headers. This payload will be the actual content that will be posted. You should pass it as a JSON encoded array (but you can also use other formats, see the <code>API Tester</code> plugin or directly the source code), as it is the easiest way. You should send it with <code>POST</code>.</p>
173
-<p>Let's have a look in details at our previous example, status update posting, <em>via</em> <code>/status/edit</code>. As we saw, the basic thing to send is the actual content of the status update, through the <code>body</code> field. Then, to post a "blah" status, the JSON encoded payload would look like</p>
174
-<p><code>{"body": "blah"}</code></p>
175
-<p>And you can post it with the following curl command:</p>
176
-<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" -X POST --data '{"body": "blah"}' http://known.example.org</code></p>
177
-<p>And here we go&nbsp;! Your first status update posted through the API&nbsp;!</p>
178
-<p>Depending on the choosen API endpoint, you might want to pass extra parameters. For example, with "posts" (<code>entry/</code> in the URLs), you have both a title (logically called <code>title</code>) and a body (as previously). Then, the payload for a post with title "blah" and content "blahblah" will look like</p>
179
-<p><code>{"title": "blah", "body": "blahblah"}</code></p>
180
-<p>Most of the endpoints also offer the ability to tweak the <code>created</code> param, to post a content in the paste or in the future (defaults to now). This is what I used to upload the articles from my previous blog to Known, for instance. This parameter is passed to the <a href="http://php.net/manual/fr/function.strtotime.php"><code>strtotime</code></a> PHP function, and should then be in a valid format for this function. Many valid formats are available, including relative ones (see the <a href="http://php.net/manual/fr/function.strtotime.php">doc</a> for more info), but the most straight-forward one, with absolute dating, might be to use ISO 8601, that is <code>YYYY-MM-DD HH:MM:SS</code>.</p>
181
-<p>The common endpoints that I have used so far are <code>/status/edit</code> and <code>/entry/edit</code> to post, respectively, status updates and long posts. A working script example (in Python) can be found <a href="https://git.phyks.me/Phyks/blog/blob/master/known.py">on my blog repository</a> (taking an entry in the format I used to have for my previous blog, and posting it to Known).</p>
182
-<p>Finally, if you want to use extra endpoints, there is no ready to use doc at the moment (see <a href="issue #225">https://github.com/idno/idno/issues/225</a> on Github), but the source code is very easily readable, once you know where to look for the infos&nbsp;:) So, you should know that almost everything in Known is an <code>Entity</code> (which is a common way to describe the content you post). Then, all the specific types of <code>Entities</code> (status, long posts, photos, like etc.) are handled by plugins, located in the <code>IdnoPlugins</code> folder. For instance, status are handled by <code>IdnoPlugins/Status</code> and long posts are handled by <code>IdnoPlugins/Text</code>.</p>
183
-<p>Every plugin declares its routes in the <code>Main.php</code> file. For instance, the <code>Status</code> plugin declares the routes <code>/status/edit</code> (post a new status), <code>/status/edit/([A-Za-z0-9]+)</code> (edit an existing status, the last parameter being the id of the status) and <code>/status/delete/([A-Za-z0-9])</code> (delte a status, same thing as the previous one). Every plugin also declares a content-type which are infos about the type of content it manages, in <code>ContentType.php</code>. Finally, looking in the <code>Pages/</code> folder, you will find scripts to handle the routes. For instance, for <code>/status/edit</code>, you will find in <code>Pages/Edit.php</code> the associated routes, to get and post content. </p>
184
-		<footer><p class="date">Le 02/01/2015 à 18:05</p>
185
-		<p class="tags">Tags : <a href="//phyks.me/tags/Phyks.html">Phyks</a></p></footer>
186
-	</div>
187
-</article>
188
-<article>
189
-	<aside>
190 190
 		<p class="day">09</p>
191 191
 		<p class="month">Novembre</p>
192 192
 	</aside>

+ 50
- 50
blog/rss.xml View File

@@ -7,7 +7,56 @@
7 7
 		<language>fr</language>
8 8
 		<copyright>CC BY</copyright>
9 9
 		<webMaster>webmaster@phyks.me (Phyks)</webMaster>
10
-		<lastBuildDate>Wed, 07 Jan 2015 14:19:34 -0000</lastBuildDate>
10
+		<lastBuildDate>Wed, 07 Jan 2015 14:23:41 -0000</lastBuildDate>
11
+		<item>
12
+			<title>Publishing through the Known API</title>
13
+			<link>http://phyks.me/2015/01/known_api.html</link>
14
+			<guid isPermaLink="true">http://phyks.me/2015/01/known_api.html</guid>
15
+			<description>
16
+
17
+
18
+
19
+As stated in my last article, I'm considering moving my blog to Known. But I'm not a huge fan of WSIWYG editor…</description>
20
+			<content:encoded><![CDATA[<div class="article">
21
+<header></header>
22
+<!-- 
23
+    @author=Phyks
24
+    @date=07012015-1620
25
+    @title=Publishing through the Known API
26
+    @tags=Known
27
+-->
28
+<p>As stated in <a href="https://known.phyks.me/2015/thoughts-on-blogging-engine">my last article</a>, I'm considering moving my blog to Known. But I'm not a huge fan of WSIWYG editors. I find it handy sometimes, and can enjoy editing in Markdown on Github, but for a long post, I really prefer writing content on my own text editor and sending it online after. Plus I can maintain drafts this way and benefits from spell checking abilities with my dictionary.</p>
29
+<p>My goal is then to find a way to post to Known from my own PC, using some kind of local app or script.</p>
30
+<p>That's really really easy in fact, as every single URL in Known is also an API endpoint.</p>
31
+<p>But, first, let's talk about a standard way of doing it, that is not Known specific. You can install the <a href="https://github.com/idno/indiepub">IndiePub</a> plugin in Known to enable a <a href="https://indiewebcamp.com/Micropub">MicroPub</a> endpoint in Known.</p>
32
+<p><em>Note</em>: Take care of cloning the repo correctly in <code>IdnoPlugins</code> as the case matters. Indeed, I cloned it as <code>indiepub</code> (lower case) and it took me some time to figure out why it was not working. After having renamed the folder <code>IndiePub</code> everything works fine.</p>
33
+<p>Micropub is a standard way of publishing content to another website, so that, after having received an authorization from you, an app can publish content to your website. Some kind of standard (part of the <a href="https://indiewebcamp.com/">IndieWebCamp</a> stuff) API, like the one used by apps on silos to post things on your page.</p>
34
+<p>Then, you can use anything that speaks the Micropub to publish on your website. The most famous one may be <a href="http://quill.p3k.io/">Quill</a>, a webapp by <a href="http://aaronparecki.com/">aaronparecki</a>. Most of the available tools are written in PHP, but you can also find some libs in <a href="https://indiewebcamp.com/Python">Python</a> to handle this kind of stuff (although there does not seem to be any Micropub publishing libraries at the moment).</p>
35
+<p>But known also offers its own API which may be way easier to use, at least to start with. It can be used in basically the same way, but you don't have to worry as much about authentication and endpoints discovery.</p>
36
+<p>So, every URL endpoint is also an API endpoint. For instance, on your Known homepage, if you click on "status update" to post a new status update, and have a look at the form that appears, you will notice that it posts data to <code>/status/edit</code> (actually, when you click the "status update" button, you will notice there is a link on it to <code>/status/edit</code>, in case you do not have JS enabled). The form is a <code>POST</code> form and you have a <code>body</code> textarea. Let's try to have a look at the page at <code>status/edit</code> (with your browser). As you can see, you have the same form that allows you to publish a new status. But you can also directly send a query to this address, to post a new entry.</p>
37
+<p>For this purpose, you will have to go to your Settings, in the "Tools and apps" menu and get your API key. Then, you must authenticate every query you send to the API. To this purpose, Known uses a HMAC signature, to prevent from sending the API key in plaintext over the network. Your API key is private and should be kept secret on your side. You will have to create a HMAC signature, using sha256, of the URL you query, thanks to your API key. Snippets to do this in many languages are available <a href="http://www.jokecamp.com/blog/examples-of-creating-base64-hashes-using-hmac-sha256-in-different-languages/">here</a>. In these snippets, <code>message</code> is the API endpoint you query (for instance <code>/status/edit</code> in our previous example) and key is your API key.</p>
38
+<p>Then, you have to add specific headers to your query to authenticate. These are <code>X-KNOWN-USERNAME</code> which should be equal to your Known username and <code>X-KNOWN-SIGNATURE</code> which should be set to the previously computed signature. This can be done very easily with <code>curl</code> thanks to the command (updating the values of the headers to the correct one)</p>
39
+<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" http://known.example.org/status/edit</code></p>
40
+<p>For quick tests of the API, you can use the <code>API Tester</code> plugin, which will take care of forging the correct query based on your inputs. Then, you do not have to worry about building a HMAC signature and so on. You can also use it to check that the requests you send have valid signature (by comparing the generated one and yours) and so on.</p>
41
+<p>Then, you have to send a payload beside the headers. This payload will be the actual content that will be posted. You should pass it as a JSON encoded array (but you can also use other formats, see the <code>API Tester</code> plugin or directly the source code), as it is the easiest way. You should send it with <code>POST</code>.</p>
42
+<p>Let's have a look in details at our previous example, status update posting, <em>via</em> <code>/status/edit</code>. As we saw, the basic thing to send is the actual content of the status update, through the <code>body</code> field. Then, to post a "blah" status, the JSON encoded payload would look like</p>
43
+<p><code>{"body": "blah"}</code></p>
44
+<p>And you can post it with the following curl command:</p>
45
+<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" -X POST --data '{"body": "blah"}' http://known.example.org</code></p>
46
+<p>And here we go ! Your first status update posted through the API !</p>
47
+<p>Depending on the choosen API endpoint, you might want to pass extra parameters. For example, with "posts" (<code>entry/</code> in the URLs), you have both a title (logically called <code>title</code>) and a body (as previously). Then, the payload for a post with title "blah" and content "blahblah" will look like</p>
48
+<p><code>{"title": "blah", "body": "blahblah"}</code></p>
49
+<p>Most of the endpoints also offer the ability to tweak the <code>created</code> param, to post a content in the paste or in the future (defaults to now). This is what I used to upload the articles from my previous blog to Known, for instance. This parameter is passed to the <a href="http://php.net/manual/fr/function.strtotime.php"><code>strtotime</code></a> PHP function, and should then be in a valid format for this function. Many valid formats are available, including relative ones (see the <a href="http://php.net/manual/fr/function.strtotime.php">doc</a> for more info), but the most straight-forward one, with absolute dating, might be to use ISO 8601, that is <code>YYYY-MM-DD HH:MM:SS</code>.</p>
50
+<p>The common endpoints that I have used so far are <code>/status/edit</code> and <code>/entry/edit</code> to post, respectively, status updates and long posts. A working script example (in Python) can be found <a href="https://git.phyks.me/Phyks/blog/blob/master/known.py">on my blog repository</a> (taking an entry in the format I used to have for my previous blog, and posting it to Known).</p>
51
+<p>Finally, if you want to use extra endpoints, there is no ready to use doc at the moment (see <a href="issue #225">https://github.com/idno/idno/issues/225</a> on Github), but the source code is very easily readable, once you know where to look for the infos :) So, you should know that almost everything in Known is an <code>Entity</code> (which is a common way to describe the content you post). Then, all the specific types of <code>Entities</code> (status, long posts, photos, like etc.) are handled by plugins, located in the <code>IdnoPlugins</code> folder. For instance, status are handled by <code>IdnoPlugins/Status</code> and long posts are handled by <code>IdnoPlugins/Text</code>.</p>
52
+<p>Every plugin declares its routes in the <code>Main.php</code> file. For instance, the <code>Status</code> plugin declares the routes <code>/status/edit</code> (post a new status), <code>/status/edit/([A-Za-z0-9]+)</code> (edit an existing status, the last parameter being the id of the status) and <code>/status/delete/([A-Za-z0-9])</code> (delte a status, same thing as the previous one). Every plugin also declares a content-type which are infos about the type of content it manages, in <code>ContentType.php</code>. Finally, looking in the <code>Pages/</code> folder, you will find scripts to handle the routes. For instance, for <code>/status/edit</code>, you will find in <code>Pages/Edit.php</code> the associated routes, to get and post content. </p>
53
+<footer>
54
+<p class="tags">Tags : <a href="http://phyks.me/tags/Known.html">Known</a></p></footer>
55
+</div>]]></content:encoded>
56
+			<pubDate>Wed, 07 Jan 2015 14:20:00 -0000</pubDate>
57
+			<category>Known</category>
58
+			<author>webmaster@phyks.me (Phyks)</author>
59
+		</item>
11 60
 		<item>
12 61
 			<title>Thoughts on blogging engine</title>
13 62
 			<link>http://phyks.me/2015/01/known.html</link>
@@ -126,55 +175,6 @@ Lorsqu'on fait de la recherche scientifique (ou de la veille), on est très vite
126 175
 			<author>webmaster@phyks.me (Phyks)</author>
127 176
 		</item>
128 177
 		<item>
129
-			<title>Publishing through the Known API</title>
130
-			<link>http://phyks.me/2015/01/known_api.html</link>
131
-			<guid isPermaLink="true">http://phyks.me/2015/01/known_api.html</guid>
132
-			<description>
133
-
134
-
135
-
136
-As stated in my last article, I'm considering moving my blog to Known. But I'm not a huge fan of WSIWYG editor…</description>
137
-			<content:encoded><![CDATA[<div class="article">
138
-<header></header>
139
-<!-- 
140
-    @author=Phyks
141
-    @date=02012015-1805
142
-    @title=Publishing through the Known API
143
-    @tags=Phyks
144
--->
145
-<p>As stated in <a href="https://known.phyks.me/2015/thoughts-on-blogging-engine">my last article</a>, I'm considering moving my blog to Known. But I'm not a huge fan of WSIWYG editors. I find it handy sometimes, and can enjoy editing in Markdown on Github, but for a long post, I really prefer writing content on my own text editor and sending it online after. Plus I can maintain drafts this way and benefits from spell checking abilities with my dictionary.</p>
146
-<p>My goal is then to find a way to post to Known from my own PC, using some kind of local app or script.</p>
147
-<p>That's really really easy in fact, as every single URL in Known is also an API endpoint.</p>
148
-<p>But, first, let's talk about a standard way of doing it, that is not Known specific. You can install the <a href="https://github.com/idno/indiepub">IndiePub</a> plugin in Known to enable a <a href="https://indiewebcamp.com/Micropub">MicroPub</a> endpoint in Known.</p>
149
-<p><em>Note</em>: Take care of cloning the repo correctly in <code>IdnoPlugins</code> as the case matters. Indeed, I cloned it as <code>indiepub</code> (lower case) and it took me some time to figure out why it was not working. After having renamed the folder <code>IndiePub</code> everything works fine.</p>
150
-<p>Micropub is a standard way of publishing content to another website, so that, after having received an authorization from you, an app can publish content to your website. Some kind of standard (part of the <a href="https://indiewebcamp.com/">IndieWebCamp</a> stuff) API, like the one used by apps on silos to post things on your page.</p>
151
-<p>Then, you can use anything that speaks the Micropub to publish on your website. The most famous one may be <a href="http://quill.p3k.io/">Quill</a>, a webapp by <a href="http://aaronparecki.com/">aaronparecki</a>. Most of the available tools are written in PHP, but you can also find some libs in <a href="https://indiewebcamp.com/Python">Python</a> to handle this kind of stuff (although there does not seem to be any Micropub publishing libraries at the moment).</p>
152
-<p>But known also offers its own API which may be way easier to use, at least to start with. It can be used in basically the same way, but you don't have to worry as much about authentication and endpoints discovery.</p>
153
-<p>So, every URL endpoint is also an API endpoint. For instance, on your Known homepage, if you click on "status update" to post a new status update, and have a look at the form that appears, you will notice that it posts data to <code>/status/edit</code> (actually, when you click the "status update" button, you will notice there is a link on it to <code>/status/edit</code>, in case you do not have JS enabled). The form is a <code>POST</code> form and you have a <code>body</code> textarea. Let's try to have a look at the page at <code>status/edit</code> (with your browser). As you can see, you have the same form that allows you to publish a new status. But you can also directly send a query to this address, to post a new entry.</p>
154
-<p>For this purpose, you will have to go to your Settings, in the "Tools and apps" menu and get your API key. Then, you must authenticate every query you send to the API. To this purpose, Known uses a HMAC signature, to prevent from sending the API key in plaintext over the network. Your API key is private and should be kept secret on your side. You will have to create a HMAC signature, using sha256, of the URL you query, thanks to your API key. Snippets to do this in many languages are available <a href="http://www.jokecamp.com/blog/examples-of-creating-base64-hashes-using-hmac-sha256-in-different-languages/">here</a>. In these snippets, <code>message</code> is the API endpoint you query (for instance <code>/status/edit</code> in our previous example) and key is your API key.</p>
155
-<p>Then, you have to add specific headers to your query to authenticate. These are <code>X-KNOWN-USERNAME</code> which should be equal to your Known username and <code>X-KNOWN-SIGNATURE</code> which should be set to the previously computed signature. This can be done very easily with <code>curl</code> thanks to the command (updating the values of the headers to the correct one)</p>
156
-<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" http://known.example.org/status/edit</code></p>
157
-<p>For quick tests of the API, you can use the <code>API Tester</code> plugin, which will take care of forging the correct query based on your inputs. Then, you do not have to worry about building a HMAC signature and so on. You can also use it to check that the requests you send have valid signature (by comparing the generated one and yours) and so on.</p>
158
-<p>Then, you have to send a payload beside the headers. This payload will be the actual content that will be posted. You should pass it as a JSON encoded array (but you can also use other formats, see the <code>API Tester</code> plugin or directly the source code), as it is the easiest way. You should send it with <code>POST</code>.</p>
159
-<p>Let's have a look in details at our previous example, status update posting, <em>via</em> <code>/status/edit</code>. As we saw, the basic thing to send is the actual content of the status update, through the <code>body</code> field. Then, to post a "blah" status, the JSON encoded payload would look like</p>
160
-<p><code>{"body": "blah"}</code></p>
161
-<p>And you can post it with the following curl command:</p>
162
-<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" -X POST --data '{"body": "blah"}' http://known.example.org</code></p>
163
-<p>And here we go ! Your first status update posted through the API !</p>
164
-<p>Depending on the choosen API endpoint, you might want to pass extra parameters. For example, with "posts" (<code>entry/</code> in the URLs), you have both a title (logically called <code>title</code>) and a body (as previously). Then, the payload for a post with title "blah" and content "blahblah" will look like</p>
165
-<p><code>{"title": "blah", "body": "blahblah"}</code></p>
166
-<p>Most of the endpoints also offer the ability to tweak the <code>created</code> param, to post a content in the paste or in the future (defaults to now). This is what I used to upload the articles from my previous blog to Known, for instance. This parameter is passed to the <a href="http://php.net/manual/fr/function.strtotime.php"><code>strtotime</code></a> PHP function, and should then be in a valid format for this function. Many valid formats are available, including relative ones (see the <a href="http://php.net/manual/fr/function.strtotime.php">doc</a> for more info), but the most straight-forward one, with absolute dating, might be to use ISO 8601, that is <code>YYYY-MM-DD HH:MM:SS</code>.</p>
167
-<p>The common endpoints that I have used so far are <code>/status/edit</code> and <code>/entry/edit</code> to post, respectively, status updates and long posts. A working script example (in Python) can be found <a href="https://git.phyks.me/Phyks/blog/blob/master/known.py">on my blog repository</a> (taking an entry in the format I used to have for my previous blog, and posting it to Known).</p>
168
-<p>Finally, if you want to use extra endpoints, there is no ready to use doc at the moment (see <a href="issue #225">https://github.com/idno/idno/issues/225</a> on Github), but the source code is very easily readable, once you know where to look for the infos :) So, you should know that almost everything in Known is an <code>Entity</code> (which is a common way to describe the content you post). Then, all the specific types of <code>Entities</code> (status, long posts, photos, like etc.) are handled by plugins, located in the <code>IdnoPlugins</code> folder. For instance, status are handled by <code>IdnoPlugins/Status</code> and long posts are handled by <code>IdnoPlugins/Text</code>.</p>
169
-<p>Every plugin declares its routes in the <code>Main.php</code> file. For instance, the <code>Status</code> plugin declares the routes <code>/status/edit</code> (post a new status), <code>/status/edit/([A-Za-z0-9]+)</code> (edit an existing status, the last parameter being the id of the status) and <code>/status/delete/([A-Za-z0-9])</code> (delte a status, same thing as the previous one). Every plugin also declares a content-type which are infos about the type of content it manages, in <code>ContentType.php</code>. Finally, looking in the <code>Pages/</code> folder, you will find scripts to handle the routes. For instance, for <code>/status/edit</code>, you will find in <code>Pages/Edit.php</code> the associated routes, to get and post content. </p>
170
-<footer>
171
-<p class="tags">Tags : <a href="http://phyks.me/tags/Phyks.html">Phyks</a></p></footer>
172
-</div>]]></content:encoded>
173
-			<pubDate>Fri, 02 Jan 2015 16:05:00 -0000</pubDate>
174
-			<category>Phyks</category>
175
-			<author>webmaster@phyks.me (Phyks)</author>
176
-		</item>
177
-		<item>
178 178
 			<title>Getting ipv6 to work with a Kimsufi server</title>
179 179
 			<link>http://phyks.me/2014/11/ipv6_kimsufi.html</link>
180 180
 			<guid isPermaLink="true">http://phyks.me/2014/11/ipv6_kimsufi.html</guid>

+ 2
- 2
blog/tags/Arch.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (138)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 2
- 2
blog/tags/Autohébergement.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (138)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 2
- 2
blog/tags/DIY.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (138)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 2
- 2
blog/tags/Dev.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (138)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 95
- 0
blog/tags/Known.html View File

@@ -0,0 +1,95 @@
1
+<!DOCTYPE html>
2
+<html lang="fr">
3
+    <head>
4
+        <meta charset="utf-8">
5
+        <title>Phyks' blog - tags/Known</title>
6
+		<link rel="stylesheet" href="//phyks.me/design.css"/>
7
+        <link type="text/plain" rel="author" href="//phyks.me/humans.txt"/>
8
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
+        <link rel="alternate" type="application/rss+xml" title="RSS" href="//phyks.me/rss.xml" />
10
+    </head>
11
+    <body>
12
+        <div id="wrapper">
13
+            <!-- Sidebar -->
14
+                <aside id="sidebar-wrapper">
15
+                    <header><h1><a href="//phyks.me">~Phyks</a></h1></header>
16
+
17
+                    <h2>Catégories</h2>
18
+                        <nav id="sidebar-tags">
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20
+                        </nav>
21
+
22
+                    <h2>Derniers articles</h2>
23
+                        <ul id="sidebar-articles">
24
+                            <li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25
+                        </ul>
26
+
27
+                    <h2>Liens</h2>
28
+                        <ul id="sidebar-links">
29
+                            <li><a href="//phyks.me/contact.html" title="Contact">Me contacter</a></li>
30
+                            <li class="monospace"><a href="//links.phyks.me" title="Mon Shaarli">find ~phyks -type l</a></li>
31
+                            <li><a href="https://github.com/phyks/" rel="me" title="Github">Mon Github</a></li>
32
+                            <li><a href="//phyks.me/divers.html" title="Divers">Divers</a></li>
33
+                        </ul>
34
+                </aside>
35
+
36
+            <!-- Page content -->
37
+                <header id="header">
38
+                    <h1><a href="//phyks.me">~Phyks</a></h1>
39
+                </header>
40
+
41
+                <div id="note_responsive">
42
+                    <p><em>Note</em> : Cliquez sur la bande bleue à gauche pour faire apparaître le menu.</p>
43
+                </div>
44
+
45
+                <div id="articles">
46
+<article>
47
+	<aside>
48
+		<p class="day">07</p>
49
+		<p class="month">Janvier</p>
50
+	</aside>
51
+	<div class="article">
52
+		<header><h1 class="article_title"><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></h1></header>
53
+		<!-- 
54
+    @author=Phyks
55
+    @date=07012015-1620
56
+    @title=Publishing through the Known API
57
+    @tags=Known
58
+-->
59
+
60
+<p>As stated in <a href="https://known.phyks.me/2015/thoughts-on-blogging-engine">my last article</a>, I'm considering moving my blog to Known. But I'm not a huge fan of WSIWYG editors. I find it handy sometimes, and can enjoy editing in Markdown on Github, but for a long post, I really prefer writing content on my own text editor and sending it online after. Plus I can maintain drafts this way and benefits from spell checking abilities with my dictionary.</p>
61
+<p>My goal is then to find a way to post to Known from my own PC, using some kind of local app or script.</p>
62
+<p>That's really really easy in fact, as every single URL in Known is also an API endpoint.</p>
63
+<p>But, first, let's talk about a standard way of doing it, that is not Known specific. You can install the <a href="https://github.com/idno/indiepub">IndiePub</a> plugin in Known to enable a <a href="https://indiewebcamp.com/Micropub">MicroPub</a> endpoint in Known.</p>
64
+<p><em>Note</em>: Take care of cloning the repo correctly in <code>IdnoPlugins</code> as the case matters. Indeed, I cloned it as <code>indiepub</code> (lower case) and it took me some time to figure out why it was not working. After having renamed the folder <code>IndiePub</code> everything works fine.</p>
65
+<p>Micropub is a standard way of publishing content to another website, so that, after having received an authorization from you, an app can publish content to your website. Some kind of standard (part of the <a href="https://indiewebcamp.com/">IndieWebCamp</a> stuff) API, like the one used by apps on silos to post things on your page.</p>
66
+<p>Then, you can use anything that speaks the Micropub to publish on your website. The most famous one may be <a href="http://quill.p3k.io/">Quill</a>, a webapp by <a href="http://aaronparecki.com/">aaronparecki</a>. Most of the available tools are written in PHP, but you can also find some libs in <a href="https://indiewebcamp.com/Python">Python</a> to handle this kind of stuff (although there does not seem to be any Micropub publishing libraries at the moment).</p>
67
+<p>But known also offers its own API which may be way easier to use, at least to start with. It can be used in basically the same way, but you don't have to worry as much about authentication and endpoints discovery.</p>
68
+<p>So, every URL endpoint is also an API endpoint. For instance, on your Known homepage, if you click on "status update" to post a new status update, and have a look at the form that appears, you will notice that it posts data to <code>/status/edit</code> (actually, when you click the "status update" button, you will notice there is a link on it to <code>/status/edit</code>, in case you do not have JS enabled). The form is a <code>POST</code> form and you have a <code>body</code> textarea. Let's try to have a look at the page at <code>status/edit</code> (with your browser). As you can see, you have the same form that allows you to publish a new status. But you can also directly send a query to this address, to post a new entry.</p>
69
+<p>For this purpose, you will have to go to your Settings, in the "Tools and apps" menu and get your API key. Then, you must authenticate every query you send to the API. To this purpose, Known uses a HMAC signature, to prevent from sending the API key in plaintext over the network. Your API key is private and should be kept secret on your side. You will have to create a HMAC signature, using sha256, of the URL you query, thanks to your API key. Snippets to do this in many languages are available <a href="http://www.jokecamp.com/blog/examples-of-creating-base64-hashes-using-hmac-sha256-in-different-languages/">here</a>. In these snippets, <code>message</code> is the API endpoint you query (for instance <code>/status/edit</code> in our previous example) and key is your API key.</p>
70
+<p>Then, you have to add specific headers to your query to authenticate. These are <code>X-KNOWN-USERNAME</code> which should be equal to your Known username and <code>X-KNOWN-SIGNATURE</code> which should be set to the previously computed signature. This can be done very easily with <code>curl</code> thanks to the command (updating the values of the headers to the correct one)</p>
71
+<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" http://known.example.org/status/edit</code></p>
72
+<p>For quick tests of the API, you can use the <code>API Tester</code> plugin, which will take care of forging the correct query based on your inputs. Then, you do not have to worry about building a HMAC signature and so on. You can also use it to check that the requests you send have valid signature (by comparing the generated one and yours) and so on.</p>
73
+<p>Then, you have to send a payload beside the headers. This payload will be the actual content that will be posted. You should pass it as a JSON encoded array (but you can also use other formats, see the <code>API Tester</code> plugin or directly the source code), as it is the easiest way. You should send it with <code>POST</code>.</p>
74
+<p>Let's have a look in details at our previous example, status update posting, <em>via</em> <code>/status/edit</code>. As we saw, the basic thing to send is the actual content of the status update, through the <code>body</code> field. Then, to post a "blah" status, the JSON encoded payload would look like</p>
75
+<p><code>{"body": "blah"}</code></p>
76
+<p>And you can post it with the following curl command:</p>
77
+<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" -X POST --data '{"body": "blah"}' http://known.example.org</code></p>
78
+<p>And here we go&nbsp;! Your first status update posted through the API&nbsp;!</p>
79
+<p>Depending on the choosen API endpoint, you might want to pass extra parameters. For example, with "posts" (<code>entry/</code> in the URLs), you have both a title (logically called <code>title</code>) and a body (as previously). Then, the payload for a post with title "blah" and content "blahblah" will look like</p>
80
+<p><code>{"title": "blah", "body": "blahblah"}</code></p>
81
+<p>Most of the endpoints also offer the ability to tweak the <code>created</code> param, to post a content in the paste or in the future (defaults to now). This is what I used to upload the articles from my previous blog to Known, for instance. This parameter is passed to the <a href="http://php.net/manual/fr/function.strtotime.php"><code>strtotime</code></a> PHP function, and should then be in a valid format for this function. Many valid formats are available, including relative ones (see the <a href="http://php.net/manual/fr/function.strtotime.php">doc</a> for more info), but the most straight-forward one, with absolute dating, might be to use ISO 8601, that is <code>YYYY-MM-DD HH:MM:SS</code>.</p>
82
+<p>The common endpoints that I have used so far are <code>/status/edit</code> and <code>/entry/edit</code> to post, respectively, status updates and long posts. A working script example (in Python) can be found <a href="https://git.phyks.me/Phyks/blog/blob/master/known.py">on my blog repository</a> (taking an entry in the format I used to have for my previous blog, and posting it to Known).</p>
83
+<p>Finally, if you want to use extra endpoints, there is no ready to use doc at the moment (see <a href="issue #225">https://github.com/idno/idno/issues/225</a> on Github), but the source code is very easily readable, once you know where to look for the infos&nbsp;:) So, you should know that almost everything in Known is an <code>Entity</code> (which is a common way to describe the content you post). Then, all the specific types of <code>Entities</code> (status, long posts, photos, like etc.) are handled by plugins, located in the <code>IdnoPlugins</code> folder. For instance, status are handled by <code>IdnoPlugins/Status</code> and long posts are handled by <code>IdnoPlugins/Text</code>.</p>
84
+<p>Every plugin declares its routes in the <code>Main.php</code> file. For instance, the <code>Status</code> plugin declares the routes <code>/status/edit</code> (post a new status), <code>/status/edit/([A-Za-z0-9]+)</code> (edit an existing status, the last parameter being the id of the status) and <code>/status/delete/([A-Za-z0-9])</code> (delte a status, same thing as the previous one). Every plugin also declares a content-type which are infos about the type of content it manages, in <code>ContentType.php</code>. Finally, looking in the <code>Pages/</code> folder, you will find scripts to handle the routes. For instance, for <code>/status/edit</code>, you will find in <code>Pages/Edit.php</code> the associated routes, to get and post content. </p>
85
+		<footer><p class="date">Le 07/01/2015 à 16:20</p>
86
+		<p class="tags">Tags : <a href="//phyks.me/tags/Known.html">Known</a></p></footer>
87
+	</div>
88
+</article>
89
+            </div>
90
+            <footer id="rss">
91
+                <p><a href="//phyks.me/rss.xml"><img src="//phyks.me/img/rss.png" alt="RSS"/></a></p>
92
+            </footer>
93
+        </div>
94
+    </body>
95
+</html>

+ 2
- 2
blog/tags/Libre.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (138)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 2
- 2
blog/tags/Linux.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (138)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 2
- 2
blog/tags/Smartphone.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (138)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 2
- 2
blog/tags/Vim.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (138)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 2
- 2
blog/tags/Web.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (138)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 2
- 2
blog/tags/Weechat.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (138)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 2
- 2
blog/tags/Électronique.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (138)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 5
- 5
gen/2015/01/known_api.gen View File

@@ -1,15 +1,15 @@
1 1
 <article>
2 2
 	<aside>
3
-		<p class="day">02</p>
3
+		<p class="day">07</p>
4 4
 		<p class="month">Janvier</p>
5 5
 	</aside>
6 6
 	<div class="article">
7 7
 		<header><h1 class="article_title"><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></h1></header>
8 8
 		<!-- 
9 9
     @author=Phyks
10
-    @date=02012015-1805
10
+    @date=07012015-1620
11 11
     @title=Publishing through the Known API
12
-    @tags=Phyks
12
+    @tags=Known
13 13
 -->
14 14
 
15 15
 <p>As stated in <a href="https://known.phyks.me/2015/thoughts-on-blogging-engine">my last article</a>, I'm considering moving my blog to Known. But I'm not a huge fan of WSIWYG editors. I find it handy sometimes, and can enjoy editing in Markdown on Github, but for a long post, I really prefer writing content on my own text editor and sending it online after. Plus I can maintain drafts this way and benefits from spell checking abilities with my dictionary.</p>
@@ -37,7 +37,7 @@
37 37
 <p>The common endpoints that I have used so far are <code>/status/edit</code> and <code>/entry/edit</code> to post, respectively, status updates and long posts. A working script example (in Python) can be found <a href="https://git.phyks.me/Phyks/blog/blob/master/known.py">on my blog repository</a> (taking an entry in the format I used to have for my previous blog, and posting it to Known).</p>
38 38
 <p>Finally, if you want to use extra endpoints, there is no ready to use doc at the moment (see <a href="issue #225">https://github.com/idno/idno/issues/225</a> on Github), but the source code is very easily readable, once you know where to look for the infos&nbsp;:) So, you should know that almost everything in Known is an <code>Entity</code> (which is a common way to describe the content you post). Then, all the specific types of <code>Entities</code> (status, long posts, photos, like etc.) are handled by plugins, located in the <code>IdnoPlugins</code> folder. For instance, status are handled by <code>IdnoPlugins/Status</code> and long posts are handled by <code>IdnoPlugins/Text</code>.</p>
39 39
 <p>Every plugin declares its routes in the <code>Main.php</code> file. For instance, the <code>Status</code> plugin declares the routes <code>/status/edit</code> (post a new status), <code>/status/edit/([A-Za-z0-9]+)</code> (edit an existing status, the last parameter being the id of the status) and <code>/status/delete/([A-Za-z0-9])</code> (delte a status, same thing as the previous one). Every plugin also declares a content-type which are infos about the type of content it manages, in <code>ContentType.php</code>. Finally, looking in the <code>Pages/</code> folder, you will find scripts to handle the routes. For instance, for <code>/status/edit</code>, you will find in <code>Pages/Edit.php</code> the associated routes, to get and post content. </p>
40
-		<footer><p class="date">Le 02/01/2015 à 18:05</p>
41
-		<p class="tags">Tags : <a href="//phyks.me/tags/Phyks.html">Phyks</a></p></footer>
40
+		<footer><p class="date">Le 07/01/2015 à 16:20</p>
41
+		<p class="tags">Tags : <a href="//phyks.me/tags/Known.html">Known</a></p></footer>
42 42
 	</div>
43 43
 </article>

+ 2
- 2
gen/header.gen View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (138)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></li><li><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></li><li><a href="//phyks.me/2014/11/ipv6_kimsufi.html">Getting ipv6 to work with a Kimsufi server</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 1
- 0
gen/tags/Known.tmp View File

@@ -0,0 +1 @@
1
+2015/01/known_api.md

+ 0
- 138
gen/tags/Phyks.tmp View File

@@ -1,138 +0,0 @@
1
-2014/08/synchronisation_backups_1.md
2
-2014/08/free_mobile_fluctuant.html
3
-2014/02/news.html
4
-2014/07/notification_sms_free.md
5
-2014/04/out.html
6
-2013/11/first.html
7
-2013/12/nawel_shaarli.html
8
-2014/11/ipv6_kimsufi.md
9
-2014/08/synchronisation_backups_1.md
10
-2014/08/free_mobile_fluctuant.html
11
-2014/02/news.html
12
-2014/07/notification_sms_free.md
13
-2014/04/out.html
14
-2013/11/first.html
15
-2013/12/nawel_shaarli.html
16
-2014/11/ipv6_kimsufi.md
17
-2014/08/synchronisation_backups_1.md
18
-2014/08/free_mobile_fluctuant.html
19
-2014/02/news.html
20
-2014/07/notification_sms_free.md
21
-2014/04/out.html
22
-2013/11/first.html
23
-2013/12/nawel_shaarli.html
24
-2014/11/ipv6_kimsufi.md
25
-2014/08/synchronisation_backups_1.md
26
-2014/08/free_mobile_fluctuant.html
27
-2014/02/news.html
28
-2014/07/notification_sms_free.md
29
-2014/04/out.html
30
-2013/11/first.html
31
-2013/12/nawel_shaarli.html
32
-2014/11/ipv6_kimsufi.md
33
-2015/01/bmc.md
34
-2014/08/synchronisation_backups_1.md
35
-2014/08/free_mobile_fluctuant.html
36
-2014/02/news.html
37
-2014/07/notification_sms_free.md
38
-2014/04/out.html
39
-2013/11/first.html
40
-2013/12/nawel_shaarli.html
41
-2014/11/ipv6_kimsufi.md
42
-2014/08/synchronisation_backups_1.md
43
-2014/08/free_mobile_fluctuant.html
44
-2014/02/news.html
45
-2014/07/notification_sms_free.md
46
-2014/04/out.html
47
-2013/11/first.html
48
-2013/12/nawel_shaarli.html
49
-2014/11/ipv6_kimsufi.md
50
-2014/08/synchronisation_backups_1.md
51
-2014/08/free_mobile_fluctuant.html
52
-2014/02/news.html
53
-2014/07/notification_sms_free.md
54
-2014/04/out.html
55
-2013/11/first.html
56
-2013/12/nawel_shaarli.html
57
-2014/11/ipv6_kimsufi.md
58
-2014/08/synchronisation_backups_1.md
59
-2014/08/free_mobile_fluctuant.html
60
-2014/02/news.html
61
-2014/07/notification_sms_free.md
62
-2014/04/out.html
63
-2013/11/first.html
64
-2013/12/nawel_shaarli.html
65
-2014/11/ipv6_kimsufi.md
66
-2015/01/bmc.md
67
-2015/01/vcsh.md
68
-2015/01/known.md
69
-2015/01/known_api.md
70
-2014/08/synchronisation_backups_1.md
71
-2014/08/free_mobile_fluctuant.html
72
-2014/02/news.html
73
-2014/07/notification_sms_free.md
74
-2014/04/out.html
75
-2013/11/first.html
76
-2013/12/nawel_shaarli.html
77
-2014/11/ipv6_kimsufi.md
78
-2014/08/synchronisation_backups_1.md
79
-2014/08/free_mobile_fluctuant.html
80
-2014/02/news.html
81
-2014/07/notification_sms_free.md
82
-2014/04/out.html
83
-2013/11/first.html
84
-2013/12/nawel_shaarli.html
85
-2014/11/ipv6_kimsufi.md
86
-2014/08/synchronisation_backups_1.md
87
-2014/08/free_mobile_fluctuant.html
88
-2014/02/news.html
89
-2014/07/notification_sms_free.md
90
-2014/04/out.html
91
-2013/11/first.html
92
-2013/12/nawel_shaarli.html
93
-2014/11/ipv6_kimsufi.md
94
-2014/08/synchronisation_backups_1.md
95
-2014/08/free_mobile_fluctuant.html
96
-2014/02/news.html
97
-2014/07/notification_sms_free.md
98
-2014/04/out.html
99
-2013/11/first.html
100
-2013/12/nawel_shaarli.html
101
-2014/11/ipv6_kimsufi.md
102
-2015/01/bmc.md
103
-2014/08/synchronisation_backups_1.md
104
-2014/08/free_mobile_fluctuant.html
105
-2014/02/news.html
106
-2014/07/notification_sms_free.md
107
-2014/04/out.html
108
-2013/11/first.html
109
-2013/12/nawel_shaarli.html
110
-2014/11/ipv6_kimsufi.md
111
-2014/08/synchronisation_backups_1.md
112
-2014/08/free_mobile_fluctuant.html
113
-2014/02/news.html
114
-2014/07/notification_sms_free.md
115
-2014/04/out.html
116
-2013/11/first.html
117
-2013/12/nawel_shaarli.html
118
-2014/11/ipv6_kimsufi.md
119
-2014/08/synchronisation_backups_1.md
120
-2014/08/free_mobile_fluctuant.html
121
-2014/02/news.html
122
-2014/07/notification_sms_free.md
123
-2014/04/out.html
124
-2013/11/first.html
125
-2013/12/nawel_shaarli.html
126
-2014/11/ipv6_kimsufi.md
127
-2014/08/synchronisation_backups_1.md
128
-2014/08/free_mobile_fluctuant.html
129
-2014/02/news.html
130
-2014/07/notification_sms_free.md
131
-2014/04/out.html
132
-2013/11/first.html
133
-2013/12/nawel_shaarli.html
134
-2014/11/ipv6_kimsufi.md
135
-2015/01/bmc.md
136
-2015/01/vcsh.md
137
-2015/01/known.md
138
-2015/01/known_api.md

+ 2
- 2
raw/2015/01/known_api.md View File

@@ -1,8 +1,8 @@
1 1
 <!--
2 2
 	@author=Phyks
3
-	@date=02012015-1805
3
+	@date=07012015-1620
4 4
 	@title=Publishing through the Known API
5
-	@tags=Phyks
5
+	@tags=Known
6 6
 -->
7 7
 
8 8
 As stated in [my last article](https://known.phyks.me/2015/thoughts-on-blogging-engine), I'm considering moving my blog to Known. But I'm not a huge fan of WSIWYG editors. I find it handy sometimes, and can enjoy editing in Markdown on Github, but for a long post, I really prefer writing content on my own text editor and sending it online after. Plus I can maintain drafts this way and benefits from spell checking abilities with my dictionary.