Add new functions

master
trémeur 8 months ago
parent 5137914290
commit c60228ab8e

@ -0,0 +1,23 @@
;; does the job for now could be improved!
(defun elon ()
(interactive)
(goto-char (point-min))
(while (re-search-forward " twitter" nil t)
(setq position (random 7))
(if (eq position 0)
(replace-match " xtwittexr")
(if (eq position 1)
(replace-match " txwitter")
(if (eq position 2)
(replace-match " twxitter")
(if (eq position 3)
(replace-match " twixtter")
(if (eq position 4)
(replace-match " twitxter")
(if (eq position 5)
(replace-match " twittxer")
(if (eq position 6)
(replace-match " twittexr")
(if (eq position 7)
(replace-match " twxitterx")))))))))))

@ -0,0 +1,28 @@
;; light mode only not yet sure how to do dark mode in the most sensible way
(defun addtoot ()
(interactive)
(setq dispname (read-string "Display name: "))
(setq avatar (read-string "Avatar URL (with https://): "))
(setq fediname (read-string "Username: "))
(setq instanceurl (read-string "Instance URL (without https://): "))
(setq profileurl (read-string "Profile URL (with https://): "))
(setq toottext (read-string "Text (HTML): "))
(setq csstext (replace-regexp-in-string "<a href" "<a style=\"color: #2b90d9; text-decoration: underline;\" href" toottext))
(setq theurl (read-string "URL of post (with https://): "))
(setq theday (read-string "Day of month: "))
(setq themonth (read-string "Month in words: "))
(setq theyear (read-string "Year: "))
(setq repost (y-or-n-p "Shared by someone else?"))
(if repost
(setq reposter (read-string "Username of reposter: ")))
(insert " <div class=\"item\" style=\"padding: 1rem; display: block; margin: 0; border-top: 1px solid #8494ab;\">\n")
(if repost
(insert (concat "<div class=\"item-title\" style=\"margin: 0 0 0.7rem 0; color: #90a1ba; font-size: 0.9rem; padding: 0; display: block;\">" reposter " shared a status by " fediname "</div>\n")))
(insert (concat "<div class=\"author\" style=\"display: flex; margin-bottom: 1rem; margin: 0; padding: 0;\">\n <a target=\"_top\" class=\"avatar\" href=\"" profileurl "\" style=\"width: 3rem; height: 3rem: border: none; border-radius: 10%; color: #2b90d9; margin: 0; padding: 0; display: block;\">\n <img class=\"avatar\" src=\"" avatar "\" style=\"width: 3rem; height: 3rem: border: none; border-radius: 10%; color: #2b90d9; margin: 0; padding: 0; overflow: clip-margin: content-box; overflow: clip;\">\n </a>\n <div class=\"author-info\" style=\"margin: 0 1rem; display: flex; flex-direction: column; justify-content: space-around; padding: 0; font-size: 0.9rem;\">\n <a target=\"_top\" class=\"author-displayname\" href=\"" profileurl "\" style=\"font-size: 1.2rem; color: #282c37; text-decoration: none; display: block; font-weight: bolder; margin: 0; padding: 0;\">" dispname "</a>\n <div class=\"author-fullname\" style=\"color: #90a1ba; font-size: 0.9rem; margin: 0; padding: 0; display: block;\">@" fediname "@" instanceurl "</div>\n </div>\n </div>\n <div class=\"item-content\" style=\"font-weight: normal; font-size: 1.1rem; margin: 0; padding: 0; display: block;\">\n <p style=\"margin: 1rem 0; line-height: 1.4rem; padding: 0;\">" csstext "</p>\n </div>\n <a class=\"date\" href=\"" theurl "\" style=\"margin: 1rem 0 0 0; text-decoration: none; display: block; color: #90a1ba; font-size: 0.9rem;\">" theday " " themonth ", " theyear "</a>\n </div>\n")))
(defun tootbuild ()
(interactive)
(insert "<div class=\"container\" style=\"font-size: 80%; background-color: #ffffff; font-family: 'Roboto', roboto, Arial, sans-serif; color: #282c37; overflow-x: hidden; word-break: break-word; margin: 10px; padding: 0; width: 300px; border: 1px solid #8494ab;\">\n")
(addtoot)
(insert "</div>"))
Loading…
Cancel
Save