/usr/share/doc/python-diaspy-doc/posting.html is in python-diaspy-doc 0.5.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | <h4><code>Post()</code> object and posting</h4>
<p><code>Post</code> object is used to represent a post on D*.</p>
<hr />
<h5>Posting</h5>
<p>Posting is done through a <code>Stream</code> object method <code>post()</code>.
It supports posting just text, images or text and images.</p>
<p><code>Stream().post()</code> returns <code>Post</code> object referring to the post
which have just been created.</p>
<h5>Text</h5>
<p>If you want to post just text you should call <code>post()</code> method with
<code>text</code> argument.</p>
<pre><code>stream.post(text='Your post.')
</code></pre>
<p>It will return <code>Post</code> you have just created.</p>
<h5>Posting images</h5>
<p>Posting images, from back-end point of view, is a two-step process.
First, you have to <em>upload</em> an image to the desired pod.
This is done by <code>_photoupload()</code> method.
It will return <em>id</em> of uploaded image. </p>
<p>Then you have to actually post your image and this is done by appending
<code>photos</code> field containg the id of uploaded image to the data being
sent by request. This is handled by <code>post()</code> method. </p>
<p><code>post()</code> has two very similar arguments used for posting photos.
They are <code>photos</code> - which takes id and <code>photo</code> - which takes filename. </p>
<p>You can post images using either of them. Even passing them side by side
is accepted but remember that <code>photos</code> will overwrite data set by <code>photo</code>.</p>
<p>Example #1: using <code>photo</code></p>
<pre><code>stream.post(photo='./kitten-image.png')
</code></pre>
<p>Example #2: using <code>photos</code></p>
<pre><code>id = stream._photoupload(filename='./kitten-image.png')
stream.post(photos=id)
</code></pre>
<p>The effect will be the same.
To either call you can append <code>text</code> argument which will be posted alongside
the image. </p>
<hr />
<h6>Manual for <code>diaspy</code>, written by Marek Marecki</h6>
|