Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export FLASK_ENV=development
export TWOOTFEED_CONFIG_DIR=$(APP_PATH)/
export TWOOTFEED_CONFIG_FILE=$(APP_PATH)/config.yml
export TWOOTFEED_LOG=twootfeed.log
export TWOOTFEED_SETTINGS=DevelopmentConfig

GUNICORN_LOG=gunicorn.log

Expand Down
Binary file removed docs/_images/FreshRSS.png
Binary file not shown.
Binary file removed docs/_images/MastodonFreshRSS.png
Binary file not shown.
Binary file removed docs/_images/MastodonRSSFeed.png
Binary file not shown.
Binary file removed docs/_images/RSSFeed.png
Binary file not shown.
Binary file removed docs/_images/mastodon.png
Binary file not shown.
Binary file removed docs/_images/twitter.png
Binary file not shown.
48 changes: 3 additions & 45 deletions docs/_sources/features.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,49 +20,7 @@ The feed displays only the original tweets (not the retweets) and toots, with:
- location (only for Twitter)
- numbers of retweets and likes for tweets and boosts and favourites for toots

.. warning::


.. danger::

| **twootfeed** is developed for personal use.
| Tweets and toots are displayed for the user associated to API keys, it may expose private items if feeds are publicly available.


Examples
~~~~~~~~

- Search on Twitter

.. figure:: _images/twitter.png
:alt: Twitter search
:figclass: doc-img

Results in RSS Feed:

.. figure:: _images/RSSFeed.png
:alt: RSS Feed
:figclass: doc-img

Display on FreshRSS, a great free self-hosted aggregator (https://github.com/FreshRSS/FreshRSS):

.. figure:: _images/FreshRSS.png
:alt: FreshRSS
:figclass: doc-img

- Search on Mastodon

.. figure:: _images/mastodon.png
:alt: Mastodon search
:figclass: doc-img

Results in RSS Feed:

.. figure:: _images/MastodonRSSFeed.png
:alt: Mastodon Feed
:figclass: doc-img

Display on FreshRSS:

.. figure:: _images/MastodonFreshRSS.png
:alt: Mastodon FreshRSS
:figclass: doc-img
| **twootfeed** is developed for a personal use.
| Tweets and toots are displayed for the user associated to the API keys (feeds may contain items with **restricted visibility**).
65 changes: 48 additions & 17 deletions docs/_sources/installation.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,45 @@ Installation

Update the `feed and app parameters <parameters.html>`_.

.. versionadded:: 0.7.0

Since **twootfeed** is connected to the user account, feeds may display items with **restricted visibility**.

A token is now mandatory to start the application and access feeds (minimum length: 25 characters).

Some examples for token generation:

> with Python

.. code-block:: bash

$ python
Python 3.10.5 (main, Jun 6 2022, 18:49:26) [GCC 12.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import secrets
>>> secrets.token_urlsafe()
'pgoeS3qOsLHxduzNY_gmn6p5vWZqSzqBgnb_VPupQ7o'
>>>

> with a linux command line

.. code-block:: bash

$ date | sha256sum | base64 | head -c 25; echo
NWU2MzE1ZGM0MmVlZDg5NDNhN



- The files location can be changed with the following environment variables:

========================= =============================================== ===========================================================================================
variable description app default value
========================= =============================================== ===========================================================================================
`TWOOTFEED_CONFIG_DIR` configuration and credentials files directory **'~/.config/twootfeed/'**
`TWOOTFEED_CONFIG_FILE` config file full path config dir + **'config.yml'** => with default value: **'~/.config/twootfeed/config.yml'**
`TWOOTFEED_LOG` application log file _no default value (log printed on the console)_
========================= =============================================== ===========================================================================================
=========================== =============================================== ===========================================================================================
variable description app default value
=========================== =============================================== ===========================================================================================
``TWOOTFEED_CONFIG_DIR`` configuration and credentials files directory **'~/.config/twootfeed/'**
``TWOOTFEED_CONFIG_FILE`` config file full path config dir + **'config.yml'** => with default value: **'~/.config/twootfeed/config.yml'**
``TWOOTFEED_LOG`` application log file `no default value (log printed on the console)`
``TWOOTFEED_SETTINGS`` application settings **'ProductionConfig'**
=========================== =============================================== ===========================================================================================

- Start the app

Expand All @@ -62,33 +91,35 @@ Installation
Usage
~~~~~

The RSS feeds are available on these urls:
The following RSS feeds are available:

- for Twitter search:

- http://localhost:8080/tweets/<keywords>
- http://localhost:8080/<keywords> (*will be deprecated in a next version*)
- http://localhost:8080/tweets/<keywords>?token=XXX
- http://localhost:8080/<keywords>?token=XXX (*will be deprecated in a next version*)

- for Mastodon search:

- keyword as a hashtag:

- http://localhost:8080/toots/<hashtag> (without the leading #)
- http://localhost:8080/toots/<hashtag>?token=XXX (without the leading #)

- query:

- http://localhost:8080/toots/search/<query>
- http://localhost:8080/toot_search/<query> (*will be deprecated in a next version*)
- http://localhost:8080/toots/search/<query>?token=XXX
- http://localhost:8080/toot_search/<query>?token=XXX (*will be deprecated in a next version*)

- for Mastodon connected user favorites:

- http://localhost:8080/toots/favorites
- http://localhost:8080/toot_favorites (*will be deprecated in a next version*)
- http://localhost:8080/toots/favorites?token=XXX
- http://localhost:8080/toot_favorites?token=XXX (*will be deprecated in a next version*)

- for Mastodon connected user bookmarks:

- http://localhost:8080/toots/bookmarks
- http://localhost:8080/toots/bookmarks?token=XXX

- for Mastodon connected user home timeline:

- http://localhost:8080/toots/home_timeline
- http://localhost:8080/toots/home_timeline?token=XXX

where XXX is the token set in configuration.
2 changes: 2 additions & 0 deletions docs/_sources/parameters.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Application parameters are stored in ``config.yml`` file:
timezone: 'Europe/Paris'
text_length_limit: 100
max_items: 20
token: ''
app:
host: '0.0.0.0'
port: '8080'
Expand Down Expand Up @@ -54,6 +55,7 @@ Feed
* **timezone**: Feed timezone
* **text_length_limit:** title length of a Feed item
* **max_items**: maximum number of displayed items
* **token**: token for feeds access

App
~~~
Expand Down
40 changes: 4 additions & 36 deletions docs/features.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Features</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#description">Description</a></li>
<li class="toctree-l2"><a class="reference internal" href="#examples">Examples</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation and usage</a></li>
Expand Down Expand Up @@ -103,45 +102,14 @@ <h2>Description<a class="headerlink" href="#description" title="Permalink to thi
<li><p>location (only for Twitter)</p></li>
<li><p>numbers of retweets and likes for tweets and boosts and favourites for toots</p></li>
</ul>
<div class="admonition danger">
<p class="admonition-title">Danger</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<div class="line-block">
<div class="line"><strong>twootfeed</strong> is developed for personal use.</div>
<div class="line">Tweets and toots are displayed for the user associated to API keys, it may expose private items if feeds are publicly available.</div>
<div class="line"><strong>twootfeed</strong> is developed for a personal use.</div>
<div class="line">Tweets and toots are displayed for the user associated to the API keys (feeds may contain items with <strong>restricted visibility</strong>).</div>
</div>
</div>
</section>
<section id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this heading"></a></h2>
<ul class="simple">
<li><p>Search on Twitter</p></li>
</ul>
<figure class="doc-img align-default">
<img alt="Twitter search" src="_images/twitter.png" />
</figure>
<p>Results in RSS Feed:</p>
<figure class="doc-img align-default">
<img alt="RSS Feed" src="_images/RSSFeed.png" />
</figure>
<p>Display on FreshRSS, a great free self-hosted aggregator (<a class="reference external" href="https://github.com/FreshRSS/FreshRSS">https://github.com/FreshRSS/FreshRSS</a>):</p>
<figure class="doc-img align-default">
<img alt="FreshRSS" src="_images/FreshRSS.png" />
</figure>
<ul class="simple">
<li><p>Search on Mastodon</p></li>
</ul>
<figure class="doc-img align-default">
<img alt="Mastodon search" src="_images/mastodon.png" />
</figure>
<p>Results in RSS Feed:</p>
<figure class="doc-img align-default">
<img alt="Mastodon Feed" src="_images/MastodonRSSFeed.png" />
</figure>
<p>Display on FreshRSS:</p>
<figure class="doc-img align-default">
<img alt="Mastodon FreshRSS" src="_images/MastodonFreshRSS.png" />
</figure>
</section>
</section>


Expand Down
60 changes: 43 additions & 17 deletions docs/installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,36 @@ <h2>Installation<a class="headerlink" href="#installation" title="Permalink to t
</pre></div>
</div>
<p>Update the <a class="reference external" href="parameters.html">feed and app parameters</a>.</p>
<div class="versionadded">
<p><span class="versionmodified added">New in version 0.7.0.</span></p>
</div>
<p>Since <strong>twootfeed</strong> is connected to the user account, feeds may display items with <strong>restricted visibility</strong>.</p>
<p>A token is now mandatory to start the application and access feeds (minimum length: 25 characters).</p>
<p>Some examples for token generation:</p>
<p>&gt; with Python</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ python
Python <span class="m">3</span>.10.5 <span class="o">(</span>main, Jun <span class="m">6</span> <span class="m">2022</span>, <span class="m">18</span>:49:26<span class="o">)</span> <span class="o">[</span>GCC <span class="m">12</span>.1.0<span class="o">]</span> on linux
Type <span class="s2">&quot;help&quot;</span>, <span class="s2">&quot;copyright&quot;</span>, <span class="s2">&quot;credits&quot;</span> or <span class="s2">&quot;license&quot;</span> <span class="k">for</span> more information.
&gt;&gt;&gt; import secrets
&gt;&gt;&gt; secrets.token_urlsafe<span class="o">()</span>
<span class="s1">&#39;pgoeS3qOsLHxduzNY_gmn6p5vWZqSzqBgnb_VPupQ7o&#39;</span>
&gt;&gt;&gt;
</pre></div>
</div>
<p>&gt; with a linux command line</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ date <span class="p">|</span> sha256sum <span class="p">|</span> base64 <span class="p">|</span> head -c <span class="m">25</span><span class="p">;</span> <span class="nb">echo</span>
NWU2MzE1ZGM0MmVlZDg5NDNhN
</pre></div>
</div>
</div></blockquote>
</li>
<li><p>The files location can be changed with the following environment variables:</p></li>
</ul>
<table class="docutils align-default">
<colgroup>
<col style="width: 15%" />
<col style="width: 29%" />
<col style="width: 56%" />
<col style="width: 16%" />
<col style="width: 28%" />
<col style="width: 55%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>variable</p></th>
Expand All @@ -137,17 +158,21 @@ <h2>Installation<a class="headerlink" href="#installation" title="Permalink to t
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><cite>TWOOTFEED_CONFIG_DIR</cite></p></td>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">TWOOTFEED_CONFIG_DIR</span></code></p></td>
<td><p>configuration and credentials files directory</p></td>
<td><p><strong>‘~/.config/twootfeed/’</strong></p></td>
</tr>
<tr class="row-odd"><td><p><cite>TWOOTFEED_CONFIG_FILE</cite></p></td>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">TWOOTFEED_CONFIG_FILE</span></code></p></td>
<td><p>config file full path</p></td>
<td><p>config dir + <strong>‘config.yml’</strong> =&gt; with default value: <strong>‘~/.config/twootfeed/config.yml’</strong></p></td>
</tr>
<tr class="row-even"><td><p><cite>TWOOTFEED_LOG</cite></p></td>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">TWOOTFEED_LOG</span></code></p></td>
<td><p>application log file</p></td>
<td><p>_no default value (log printed on the console)_</p></td>
<td><p><cite>no default value (log printed on the console)</cite></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">TWOOTFEED_SETTINGS</span></code></p></td>
<td><p>application settings</p></td>
<td><p><strong>‘ProductionConfig’</strong></p></td>
</tr>
</tbody>
</table>
Expand All @@ -160,13 +185,13 @@ <h2>Installation<a class="headerlink" href="#installation" title="Permalink to t
</section>
<section id="usage">
<h2>Usage<a class="headerlink" href="#usage" title="Permalink to this heading"></a></h2>
<p>The RSS feeds are available on these urls:</p>
<p>The following RSS feeds are available:</p>
<ul>
<li><p>for Twitter search:</p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference external" href="http://localhost:8080/tweets">http://localhost:8080/tweets</a>/&lt;keywords&gt;</p></li>
<li><p><a class="reference external" href="http://localhost:8080">http://localhost:8080</a>/&lt;keywords&gt; (<em>will be deprecated in a next version</em>)</p></li>
<li><p><a class="reference external" href="http://localhost:8080/tweets">http://localhost:8080/tweets</a>/&lt;keywords&gt;?token=XXX</p></li>
<li><p><a class="reference external" href="http://localhost:8080">http://localhost:8080</a>/&lt;keywords&gt;?token=XXX (<em>will be deprecated in a next version</em>)</p></li>
</ul>
</div></blockquote>
</li>
Expand All @@ -176,15 +201,15 @@ <h2>Usage<a class="headerlink" href="#usage" title="Permalink to this heading">
<li><p>keyword as a hashtag:</p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference external" href="http://localhost:8080/toots">http://localhost:8080/toots</a>/&lt;hashtag&gt; (without the leading #)</p></li>
<li><p><a class="reference external" href="http://localhost:8080/toots">http://localhost:8080/toots</a>/&lt;hashtag&gt;?token=XXX (without the leading #)</p></li>
</ul>
</div></blockquote>
</li>
<li><p>query:</p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference external" href="http://localhost:8080/toots/search">http://localhost:8080/toots/search</a>/&lt;query&gt;</p></li>
<li><p><a class="reference external" href="http://localhost:8080/toot_search">http://localhost:8080/toot_search</a>/&lt;query&gt; (<em>will be deprecated in a next version</em>)</p></li>
<li><p><a class="reference external" href="http://localhost:8080/toots/search">http://localhost:8080/toots/search</a>/&lt;query&gt;?token=XXX</p></li>
<li><p><a class="reference external" href="http://localhost:8080/toot_search">http://localhost:8080/toot_search</a>/&lt;query&gt;?token=XXX (<em>will be deprecated in a next version</em>)</p></li>
</ul>
</div></blockquote>
</li>
Expand All @@ -194,26 +219,27 @@ <h2>Usage<a class="headerlink" href="#usage" title="Permalink to this heading">
<li><p>for Mastodon connected user favorites:</p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference external" href="http://localhost:8080/toots/favorites">http://localhost:8080/toots/favorites</a></p></li>
<li><p><a class="reference external" href="http://localhost:8080/toot_favorites">http://localhost:8080/toot_favorites</a> (<em>will be deprecated in a next version</em>)</p></li>
<li><p><a class="reference external" href="http://localhost:8080/toots/favorites?token=XXX">http://localhost:8080/toots/favorites?token=XXX</a></p></li>
<li><p><a class="reference external" href="http://localhost:8080/toot_favorites?token=XXX">http://localhost:8080/toot_favorites?token=XXX</a> (<em>will be deprecated in a next version</em>)</p></li>
</ul>
</div></blockquote>
</li>
<li><p>for Mastodon connected user bookmarks:</p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference external" href="http://localhost:8080/toots/bookmarks">http://localhost:8080/toots/bookmarks</a></p></li>
<li><p><a class="reference external" href="http://localhost:8080/toots/bookmarks?token=XXX">http://localhost:8080/toots/bookmarks?token=XXX</a></p></li>
</ul>
</div></blockquote>
</li>
<li><p>for Mastodon connected user home timeline:</p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference external" href="http://localhost:8080/toots/home_timeline">http://localhost:8080/toots/home_timeline</a></p></li>
<li><p><a class="reference external" href="http://localhost:8080/toots/home_timeline?token=XXX">http://localhost:8080/toots/home_timeline?token=XXX</a></p></li>
</ul>
</div></blockquote>
</li>
</ul>
<p>where XXX is the token set in configuration.</p>
</section>
</section>

Expand Down
2 changes: 2 additions & 0 deletions docs/parameters.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ <h1>Application and feeds parameters<a class="headerlink" href="#application-and
<span class="w"> </span><span class="nt">timezone</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;Europe/Paris&#39;</span><span class="w"></span>
<span class="w"> </span><span class="nt">text_length_limit</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">100</span><span class="w"></span>
<span class="w"> </span><span class="nt">max_items</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">20</span><span class="w"></span>
<span class="w"> </span><span class="nt">token</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;&#39;</span><span class="w"></span>
<span class="nt">app</span><span class="p">:</span><span class="w"></span>
<span class="w"> </span><span class="nt">host</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;0.0.0.0&#39;</span><span class="w"></span>
<span class="w"> </span><span class="nt">port</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;8080&#39;</span><span class="w"></span>
Expand Down Expand Up @@ -140,6 +141,7 @@ <h2>Feed<a class="headerlink" href="#feed" title="Permalink to this heading">
<li><p><strong>timezone</strong>: Feed timezone</p></li>
<li><p><strong>text_length_limit:</strong> title length of a Feed item</p></li>
<li><p><strong>max_items</strong>: maximum number of displayed items</p></li>
<li><p><strong>token</strong>: token for feeds access</p></li>
</ul>
</section>
<section id="app">
Expand Down
Loading