Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release-v0.7.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
SamR1 committed Aug 27, 2022
2 parents 70b44cd + 5c3ebf9 commit 7d5ff0d
Show file tree
Hide file tree
Showing 38 changed files with 477 additions and 222 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change log

## Version 0.7.2 (2022/08/27)

#### Bugs Fixed

* [Issue 32](https://github.com/SamR1/python-twootfeed/issues/32) - GIFs not showing

In this release 1 issue was closed.


## Version 0.7.1 (2022/07/16)

#### Misc
Expand Down Expand Up @@ -34,7 +43,7 @@ Note: **twootfeed** still using **Twitter** API v1.1
* [Issue 27](https://github.com/SamR1/python-twootfeed/issues/27) - generate documentation with sphinx
* [Issue 26](https://github.com/SamR1/python-twootfeed/issues/26) - [Mastodon] add feed with user's bookmarks

In this release 2 issue were closed.
In this release 2 issues were closed.


## Version 0.6.6 (2019/10/20)
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ serve:
$(FLASK) run --with-threads -h $(HOST) -p $(PORT)

run:
echo 'Running on http://$(HOST):$(PORT)'
FLASK_ENV=production && $(GUNICORN) -b 127.0.0.1:5000 "$(FLASK_APP):create_app()" --error-logfile $(GUNICORN_LOG)
echo 'Running on http://localhost:$(PORT)'
FLASK_ENV=production && $(GUNICORN) -b 127.0.0.1:$(PORT) "$(FLASK_APP):create_app()" --error-logfile $(GUNICORN_LOG)

venv:
test -d $(VENV) || $(PYTHON_VERSION) -m venv $(VENV)
Expand Down
2 changes: 1 addition & 1 deletion Makefile.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PORT = 5000
APP_PATH = $(PWD)/twootfeed

export FLASK_APP = twootfeed
export FLASK_ENV=development
export FLASK_DEBUG=1
export TWOOTFEED_CONFIG_DIR=$(APP_PATH)/
export TWOOTFEED_CONFIG_FILE=$(APP_PATH)/config.yml
export TWOOTFEED_LOG=twootfeed.log
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![PyPI version](https://img.shields.io/pypi/v/twootfeed.svg)](https://pypi.org/project/twootfeed/)
[![Downloads](https://pepy.tech/badge/twootfeed)](https://pepy.tech/project/twootfeed)
[![Python Version](https://img.shields.io/badge/python-3.7+-brightgreen.svg)](https://python.org)
[![Flask Version](https://img.shields.io/badge/flask-2.1-brightgreen.svg)](http://flask.pocoo.org/)
[![Flask Version](https://img.shields.io/badge/flask-2.2-brightgreen.svg)](http://flask.pocoo.org/)
[![code style: black](https://img.shields.io/badge/code%20style-black-black)](https://black.readthedocs.io/en/stable/)
[![type check: mypy](https://img.shields.io/badge/type%20check-mypy-blue)](http://mypy-lang.org/)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/14d1c00121c04cd2b81453c597639ca6)](https://www.codacy.com/app/SamR1/python-twootfeed)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.1
0.7.2
2 changes: 1 addition & 1 deletion docs/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: a60a5b8ce7a38d3ffa6039003e56360f
config: 7075c05ace5d0aeb460624acaa55bf96
tags: 645f666f9bcd5a90fca523b33c5a78b7
11 changes: 10 additions & 1 deletion docs/_sources/changelog.md.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change log

## Version 0.7.2 (2022/08/27)

#### Bugs Fixed

* [Issue 32](https://github.com/SamR1/python-twootfeed/issues/32) - GIFs not showing

In this release 1 issue was closed.


## Version 0.7.1 (2022/07/16)

#### Misc
Expand Down Expand Up @@ -34,7 +43,7 @@ Note: **twootfeed** still using **Twitter** API v1.1
* [Issue 27](https://github.com/SamR1/python-twootfeed/issues/27) - generate documentation with sphinx
* [Issue 26](https://github.com/SamR1/python-twootfeed/issues/26) - [Mastodon] add feed with user's bookmarks

In this release 2 issue were closed.
In this release 2 issues were closed.


## Version 0.6.6 (2019/10/20)
Expand Down
7 changes: 4 additions & 3 deletions docs/_sources/features.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Features
Description
~~~~~~~~~~~

**twootfeed** generate an RSS feed from **Twitter** or **Mastodon** search and from **Mastodon** bookmarks/favorites/home timeline.
**twootfeed** generates an RSS feed from **Twitter** or **Mastodon** search and from **Mastodon** bookmarks/favorites/home timeline.

The feed displays only the original tweets (not the retweets) and toots, with:

Expand All @@ -15,8 +15,9 @@ The feed displays only the original tweets (not the retweets) and toots, with:
- usernames

- URLs
- images
- source
- images, video (mp4) and animated gif (as mp4 video)
- image description (only for Mastodon)
- source if available
- location (only for Twitter)
- visibility (only for Mastodon)
- numbers of retweets and likes for tweets and boosts and favourites for toots
Expand Down
2 changes: 1 addition & 1 deletion docs/_sources/how-to-developers.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Dependencies

- `Flask <http://flask.pocoo.org/>`_
- `Feedgenerator <https://pypi.python.org/pypi/feedgenerator)>`_
- `Tweepy <https://github.com/tweepy/tweepy>`_ (only tested with the `Twitter Standard API <https://developer.twitter.com/en/docs/tweets/search/overview/standard.html>`_)
- `Tweepy <https://github.com/tweepy/tweepy>`_ (only tested with the `Twitter Standard v1.1 API <https://developer.twitter.com/en/docs/tweets/search/overview/standard.html>`_)
- `Mastodon.py <https://github.com/halcy/Mastodon.py>`_
- `pytz <https://pypi.python.org/pypi/pytz/>`_
- `pyYAML <https://github.com/yaml/pyyaml>`_
Expand Down
2 changes: 1 addition & 1 deletion docs/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Welcome to twootfeed's documentation!
=====================================

**twootfeed** generate an rss feed from parsed Twitter or Mastodon search and from Mastodon bookmarks, favorites and home timeline.
**twootfeed** generates an RSS feed from parsed Twitter or Mastodon search and from Mastodon bookmarks, favorites and home timeline.

.. toctree::
:maxdepth: 1
Expand Down
19 changes: 14 additions & 5 deletions docs/_sources/installation.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,23 @@ Installation

- Create and activate a virtualenv

.. code-block:: bash
$ python -m venv .venv
$ source .venv/bin/activate
- Install from pip

.. code-block:: bash
$ pip install twootfeed
(.venv) $ pip install twootfeed
- Initialize the configuration file

.. code-block:: bash
$ twootfeed_init
(.venv) $ twootfeed_init
- Fill in fields for the client(s) you want to use in **'~/.config/twootfeed/config.yml'** :
Expand Down Expand Up @@ -82,7 +87,7 @@ After generation, copy the value into **'config.yml'**.
.. warning::
| If the token is missing or invalid, **twootfeed** will not start.
- The files location and settings can be changed with the following environment variables:
- The files location and settings can be changed by exporting the following environment variables:

=========================== =============================================== ===========================================================================================
variable description app default value
Expand All @@ -97,19 +102,23 @@ After generation, copy the value into **'config.yml'**.

.. code-block:: bash
$ twootfeed
(.venv) $ twootfeed
Upgrade
~~~~~~~

- Activate the virtualenv

.. code-block:: bash
$ source .venv/bin/activate
- Upgrade with pip

.. code-block:: bash
$ pip install -U twootfeed
(.venv) $ pip install -U twootfeed
- Restart the application

Expand Down
31 changes: 1 addition & 30 deletions docs/_static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,6 @@ ol.simple p,
ul.simple p {
margin-bottom: 0;
}

/* Docutils 0.17 and older (footnotes & citations) */
dl.footnote > dt,
dl.citation > dt {
float: left;
Expand All @@ -627,33 +625,6 @@ dl.citation > dd:after {
clear: both;
}

/* Docutils 0.18+ (footnotes & citations) */
aside.footnote > span,
div.citation > span {
float: left;
}
aside.footnote > span:last-of-type,
div.citation > span:last-of-type {
padding-right: 0.5em;
}
aside.footnote > p {
margin-left: 2em;
}
div.citation > p {
margin-left: 4em;
}
aside.footnote > p:last-of-type,
div.citation > p:last-of-type {
margin-bottom: 0em;
}
aside.footnote > p:last-of-type:after,
div.citation > p:last-of-type:after {
content: "";
clear: both;
}

/* Footnotes & citations ends */

dl.field-list {
display: grid;
grid-template-columns: fit-content(30%) auto;
Expand All @@ -665,11 +636,11 @@ dl.field-list > dt {
padding-left: 0.5em;
padding-right: 5px;
}

dl.field-list > dt:after {
content: ":";
}


dl.field-list > dd {
padding-left: 0.5em;
margin-top: 0em;
Expand Down
4 changes: 2 additions & 2 deletions docs/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '0.7.1',
VERSION: '0.7.2',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand All @@ -10,5 +10,5 @@ var DOCUMENTATION_OPTIONS = {
SOURCELINK_SUFFIX: '.txt',
NAVIGATION_WITH_KEYS: false,
SHOW_SEARCH_SUMMARY: true,
ENABLE_SEARCH_SHORTCUTS: false,
ENABLE_SEARCH_SHORTCUTS: true,
};
17 changes: 8 additions & 9 deletions docs/_static/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const _displayItem = (item, highlightTerms, searchTerms) => {
linkEl.href = linkUrl + "?" + params.toString() + anchor;
linkEl.innerHTML = title;
if (descr)
listItem.appendChild(document.createElement("span")).innerText =
listItem.appendChild(document.createElement("span")).innerHTML =
" (" + descr + ")";
else if (showSearchSummary)
fetch(requestUrl)
Expand Down Expand Up @@ -155,10 +155,8 @@ const Search = {
_pulse_status: -1,

htmlToText: (htmlString) => {
const htmlElement = document
.createRange()
.createContextualFragment(htmlString);
_removeChildren(htmlElement.querySelectorAll(".headerlink"));
const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html');
htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() });
const docContent = htmlElement.querySelector('[role="main"]');
if (docContent !== undefined) return docContent.textContent;
console.warn(
Expand Down Expand Up @@ -504,21 +502,22 @@ const Search = {
* latter for highlighting it.
*/
makeSearchSummary: (htmlText, keywords, highlightWords) => {
const text = Search.htmlToText(htmlText).toLowerCase();
const text = Search.htmlToText(htmlText);
if (text === "") return null;

const textLower = text.toLowerCase();
const actualStartPosition = [...keywords]
.map((k) => text.indexOf(k.toLowerCase()))
.map((k) => textLower.indexOf(k.toLowerCase()))
.filter((i) => i > -1)
.slice(-1)[0];
const startWithContext = Math.max(actualStartPosition - 120, 0);

const top = startWithContext === 0 ? "" : "...";
const tail = startWithContext + 240 < text.length ? "..." : "";

let summary = document.createElement("div");
let summary = document.createElement("p");
summary.classList.add("context");
summary.innerText = top + text.substr(startWithContext, 240).trim() + tail;
summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;

highlightWords.forEach((highlightWord) =>
_highlightText(summary, highlightWord, "highlighted")
Expand Down
Loading

0 comments on commit 7d5ff0d

Please sign in to comment.