This commit is contained in:
Özcan Oğuz 2020-08-24 13:18:46 +03:00
parent 1929174250
commit 605c4e6477
No known key found for this signature in database
GPG Key ID: 2D33E2BD3D975818
4 changed files with 26 additions and 5 deletions

View File

@ -1,12 +1,23 @@
# pfxposter
![PyPI](https://img.shields.io/pypi/v/pfxposter)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pfxposter)
![GLWTS](https://img.shields.io/badge/license-GLWTS-success)
![PyPI - Status](https://img.shields.io/pypi/status/pfxposter)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/dwyl/esta/issues)
https://img.shields.io/badge/license-GLWTS-success
![PyPI - Format](https://img.shields.io/pypi/format/pfxposter)
![GitHub followers](https://img.shields.io/github/followers/ooguz?label=Follow&style=social)
A PixelFed to Mastodon and Twitter crossposter that is not written as intended. Due to the unknown error on pixelfed.social instance, Atom feeds are used for checking new posts.
In order to post PixelFed entries to Twitter, you will need a Mastodon-Twitter crossposter, you may find them on web.
## Installation
`pip3 install pfxposter`
```
pip3 install pfxposter
```
## Usage

View File

@ -2,6 +2,6 @@
from .pfxposter import *
__version__ = '0.1.0'
__version__ = '0.1.2'

View File

@ -8,8 +8,15 @@ import tempfile
import toml
import os
os_user = os.getenv("USER")
config_file = "/home/{}/.pfxposter".format(os_user)
homedir = os.getenv("HOME")
config_file = "{}/.pfxposter".format(homedir)
if os.path.exists(config_file) == False:
conf_includes = 'updated = 2020-08-24 00:00:00+00:00\n\n[mastodon]\nmastodon_url = "https://oyd.social"\naccess_token = "your_access_token_here"\n\n[pixelfed]\npixelfed_url = "https://pixelfed.social"\nusername = "username"'
with open(config_file, "w") as f:
f.write(conf_includes)
print("Configuration file created please edit")
os._exit(0)
config = toml.load(config_file)

View File

@ -10,10 +10,13 @@ with open("README.md", "r") as fh:
long_description = fh.read()
def _post_install():
conf_includes = 'updated = 2020-08-24 00:00:00+00:00\n\n[mastodon]\n mastodon_url = "https://oyd.social"\naccess_token = "your_access_token_here"\n\n[pixelfed]\npixelfed_url = "https://pixelfed.social"\nusername = "username"'
cron_job = CronTab(user=os.getenv("USER"))
autochecker = cron_job.new(command='pfxposter')
autochecker.minute.every(1)
cron_job.write()
with open("{}/.pfxposter".format(os.getenv("HOME")), "w") as conf:
conf.write(conf_includes)
setup(
name='pfxposter',
@ -43,7 +46,7 @@ setup(
"Topic :: Internet",
],
entry_points={"console_scripts": ["pfxposter = pfxposter.pfxposter:main"]},
data_files=[('/home/{}/.pfxposter', ['data/config.toml'])],
data_files=[('/home/{}/.pfxposter'.format(os.getenv("USER")), ['data/config.toml'])],
python_requires=">=3.6",
install_requires=['Mastodon.py>=1.5.1', 'atoma>=0.0.17', 'toml>=0.10.1', 'python-crontab>=2.5.1']
)