Final changes before preview release.

This commit is contained in:
marvin8 2023-02-26 13:54:19 +10:00
parent 872e71721a
commit adf6c1ae1f
No known key found for this signature in database
GPG key ID: C29D8D75FCE14912
5 changed files with 33 additions and 11 deletions

View file

@ -14,7 +14,17 @@ Unreleased
See the fragment files in the `changelog.d directory`_.
.. _changelog.d directory: https://codeberg.org/PyYtTools/Playlist2Podcasts/src/branch/main/changelog.d
.. _changelog.d directory: https://codeberg.org/MarvinsMastodonTools/feed2fedi/src/branch/main/changelog.d
.. scriv-insert-here
.. _changelog-0.1.0:
0.1.0 — 2023-02-26
==================
Added
-----
- Initial release of Feed2Fedi for preview.

View file

@ -38,10 +38,18 @@ The developers of Feed2Fedi hold no liability for what you do with this script o
script. Abusing this script *can* get you banned from Fediverse instances, so make sure to read up on proper usage
for each site.
.. TODO: Setup and usage
.. ---------------
..
.. For instructions on setting up and using Feed2Fedi, please visit `the wiki`_
Setup and usage
---------------
Feed2Fedi is available on PyPi.org and I recommend installing it with pipx using the command below:
`pipx install feed2fedi`
Once installed you can start it by issuing the `feed2fedi` command.
During the first run it will prompt for some values and create a `config.ini` file with sensible starting settings.
Then edit the `config.ini` file and add the RSS/ATOM feed in the feeds section and remove the sample feed.
Supporting Feed2Fedi
--------------------

View file

@ -1,4 +0,0 @@
Added
-----
- Initial release of Feed2Fedi for preview.

View file

@ -59,12 +59,18 @@ class Configuration:
"""
parser = ConfigParser()
if not config_file_path.exists():
config_file_path.touch()
with config_file_path.open(mode="r", encoding=FILE_ENCODING) as config_file:
parser.read_file(f=config_file)
parsed_feeds: List[str] = []
for _key, feed in parser.items(section=FEEDS_SECTION):
parsed_feeds.append(feed)
if parser.has_section(section=FEEDS_SECTION):
for _key, feed in parser.items(section=FEEDS_SECTION):
parsed_feeds.append(feed)
else:
parsed_feeds.append("http://feedparser.org/docs/examples/rss20.xml")
instance = parser.get(
section=FEDIVERSE_SECTION,

View file

@ -29,6 +29,8 @@ class Fediverse:
session=session,
access_token=self.config.fedi_access_token,
)
await fediverse.determine_instance_type()
await fediverse.verify_credentials()
for item in items:
if await self.post_recorder.duplicate_check(identifier=item.link):