mirror of https://gitlab.com/octtspacc/staticoso
Fucked up
This commit is contained in:
parent
2c889c581f
commit
01fc1e7278
|
@ -165,12 +165,12 @@ def Main(Args, FeedEntries):
|
||||||
if ActivityPub and MastodonURL and MastodonToken and SiteDomain:
|
if ActivityPub and MastodonURL and MastodonToken and SiteDomain:
|
||||||
print("[I] Mastodon Stuff")
|
print("[I] Mastodon Stuff")
|
||||||
MastodonPosts = MastodonShare(
|
MastodonPosts = MastodonShare(
|
||||||
MastodonURL,
|
InstanceURL=MastodonURL,
|
||||||
MastodonToken,
|
Token=MastodonToken,
|
||||||
Pages,
|
Pages=Pages,
|
||||||
SiteDomain,
|
SiteDomain=SiteDomain,
|
||||||
SiteLang,
|
SiteLang=SiteLang,
|
||||||
Locale,
|
Locale=Locale,
|
||||||
TypeFilter=Args.ActivityPubTypeFilter if Args.ActivityPubTypeFilter else 'Post',
|
TypeFilter=Args.ActivityPubTypeFilter if Args.ActivityPubTypeFilter else 'Post',
|
||||||
CategoryFilter=Args.ActivityPubCategoryFilter if Args.ActivityPubCategoryFilter else 'Blog',
|
CategoryFilter=Args.ActivityPubCategoryFilter if Args.ActivityPubCategoryFilter else 'Blog',
|
||||||
HoursLimit=Args.ActivityPubHoursLimit if Args.ActivityPubHoursLimit else 168)
|
HoursLimit=Args.ActivityPubHoursLimit if Args.ActivityPubHoursLimit else 168)
|
||||||
|
|
|
@ -13,10 +13,10 @@ from Libs.dateutil.parser import parse as date_parse
|
||||||
from Libs.mastodon import Mastodon
|
from Libs.mastodon import Mastodon
|
||||||
from Modules.Utils import *
|
from Modules.Utils import *
|
||||||
|
|
||||||
def MastodonGetSession(MastodonURL, MastodonToken):
|
def MastodonGetSession(InstanceURL, Token):
|
||||||
return Mastodon(
|
return Mastodon(
|
||||||
api_base_url=MastodonURL,
|
api_base_url=InstanceURL,
|
||||||
access_token=MastodonToken)
|
access_token=Token)
|
||||||
|
|
||||||
def MastodonGetMyID(Session):
|
def MastodonGetMyID(Session):
|
||||||
return Session.me()['id']
|
return Session.me()['id']
|
||||||
|
@ -52,8 +52,8 @@ def MastodonGetAllLinkPosts(Session, Domain=None):
|
||||||
return Posts
|
return Posts
|
||||||
|
|
||||||
# TODO: Set a limit/cooldown on how many new posts at a time can be posted, or ignore posts older than date X.. otherwise if someone starts using this after having written 100 blog posts, bad things will happen
|
# TODO: Set a limit/cooldown on how many new posts at a time can be posted, or ignore posts older than date X.. otherwise if someone starts using this after having written 100 blog posts, bad things will happen
|
||||||
def MastodonShare(MastodonURL, MastodonToken, TypeFilter, CategoryFilter, HoursLimit, Pages, SiteDomain, SiteLang, Locale):
|
def MastodonShare(InstanceURL, Token, TypeFilter, CategoryFilter, HoursLimit, Pages, SiteDomain, SiteLang, Locale):
|
||||||
Session = MastodonGetSession(MastodonURL, MastodonToken)
|
Session = MastodonGetSession(InstanceURL, Token)
|
||||||
Posts = MastodonGetAllLinkPosts(Session, SiteDomain)
|
Posts = MastodonGetAllLinkPosts(Session, SiteDomain)
|
||||||
Pages.sort()
|
Pages.sort()
|
||||||
for File, Content, Titles, Meta, ContentHTML, SlimHTML, Description, Image in Pages:
|
for File, Content, Titles, Meta, ContentHTML, SlimHTML, Description, Image in Pages:
|
||||||
|
|
Loading…
Reference in New Issue