Skip to content

Instantly share code, notes, and snippets.

View rotten77's full-sized avatar

Jan Zatloukal rotten77

View GitHub Profile
@rotten77
rotten77 / mastodon-wiki.py
Created July 25, 2023 18:16
Send random article from Wiki to Mastodon
# import packages
from mastodon import Mastodon
import wikipedia
# function by Perplexity AI
def truncate_text(text):
if len(text) <= 200:
return text
else:
truncated_text = text[:200]
{{pagelist parent_page_id}}
# see in action: https://codepen.io/rotten77/pen/GRyZopJ
import math
import random
def smooth_array(input_array, output_length):
import numpy as np
points = np.arange(len(input_array))
{{div .row #my_custom_div}}
{{div .col-md-6}}
One
{{enddiv}}
{{div .col-md-6}}
Two
{{enddiv}}
{{gist https://gist.github.com/rotten77/03bb86d0a64a7e6bdcb564be28c26002}}
{{iframe 21x9 https://frame.mapy.cz/s/ravemoraha}}
{{youtube QH2-TGUlwu4}}
{{image image-01.jpg "Title of an image"}}
{{include test}}