mirror of
https://gitlab.com/octtspacc/staticoso
synced 2025-06-05 22:09:23 +02:00
Allow a page to be excluded from feeds, + some minor tweaks
This commit is contained in:
@@ -51,7 +51,6 @@ def MastodonGetAllLinkPosts(Session, Domain=None):
|
||||
Posts += [Post]
|
||||
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
|
||||
def MastodonShare(InstanceURL, Token, TypeFilter, CategoryFilter, HoursLimit, Pages, SiteDomain, SiteLang, Locale):
|
||||
SaidPosting = False
|
||||
Session = MastodonGetSession(InstanceURL, Token)
|
||||
@@ -81,7 +80,7 @@ def MastodonShare(InstanceURL, Token, TypeFilter, CategoryFilter, HoursLimit, Pa
|
||||
if not SaidPosting:
|
||||
print("[I] Posting to Mastodon")
|
||||
SaidPosting = True
|
||||
time.sleep(5)
|
||||
time.sleep(5) # Prevent flooding
|
||||
Post = MastodonGetLinkFromPost(
|
||||
Post=MastodonDoPost(
|
||||
Session,
|
||||
|
@@ -25,7 +25,7 @@ def MakeFeed(CategoryFilter, Pages, SiteName, SiteTagline, SiteDomain, MaxEntrie
|
||||
|
||||
DoPages = []
|
||||
for e in Pages:
|
||||
if FullSite or (not FullSite and MaxEntries != 0 and e[3]['Type'] == 'Post'): # No entry limit if site feed
|
||||
if FullSite or (not FullSite and MaxEntries != 0 and e[3]['Type'] == 'Post' and e[3]['Feed'] == 'True'): # No entry limit if site feed
|
||||
DoPages += [e]
|
||||
MaxEntries -= 1
|
||||
DoPages.reverse()
|
||||
|
@@ -62,7 +62,7 @@ def MakeContentHeader(Meta, Locale, Categories=''):
|
||||
Header += '{} {} \n'.format(Locale[i], Meta[i])
|
||||
if Categories:
|
||||
Header += '{}: {} \n'.format(Locale['Categories'], Categories)
|
||||
return markdown(Header)
|
||||
return markdown(Header.rstrip())
|
||||
|
||||
def MakeCategoryLine(File, Meta):
|
||||
Categories = ''
|
||||
|
Reference in New Issue
Block a user