|
|
|
@ -3,8 +3,11 @@
|
|
|
|
|
(setq dw-username "tobli")
|
|
|
|
|
(setq dw-pin "0397")
|
|
|
|
|
(setq dw-defaultlocation "🔺")
|
|
|
|
|
(setq dw-tagslist "~/Documents/drive/admin/emacs/tags.txt")
|
|
|
|
|
(setq dw-iconfile "~/Documents/drive/admin/emacs/iconchoose.el")
|
|
|
|
|
(setq lastfm-login t) ;; boolean
|
|
|
|
|
(setq log t)
|
|
|
|
|
(setq logfile "~/Documents/drive/org/calendar/habit.org")
|
|
|
|
|
(setq lastfm-user "litrovers")
|
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
@ -45,16 +48,14 @@
|
|
|
|
|
(defun dwsecurity ()
|
|
|
|
|
"Set security level for DW post"
|
|
|
|
|
(setq security (completing-read "Security (public, access, private): " '("public" "access" "private")))
|
|
|
|
|
(if (equal security "")
|
|
|
|
|
(sleep-for 0)
|
|
|
|
|
(unless (equal security "")
|
|
|
|
|
(insert (concat "post-security: " security "\n")))))
|
|
|
|
|
|
|
|
|
|
(unless (string-equal system-type "android")
|
|
|
|
|
(defun dwmood ()
|
|
|
|
|
"Set mood for DW post"
|
|
|
|
|
(setq mood (completing-read "Mood: " '("accomplished" "aggravated" "amused" "angry" "annoyed" "anxious" "apathetic" "artistic" "awake" "bitchy" "blah" "blank" "bored" "bouncy" "busy" "calm" "cheerful" "chipper" "cold" "complacent" "confused" "contemplative" "content" "cranky" "crappy" "crazy" "creative" "crushed" "curious" "cynical" "depressed" "determined" "devious" "dirty" "disappointed" "discontent" "distressed" "ditzy" "dorky" "drained" "drunk" "ecstatic" "embarrassed" "energetic" "enraged" "enthralled" "envious" "exanimate" "excited" "exhausted" "flirty" "frustrated" "full" "geeky" "giddy" "giggly" "gloomy" "good" "grateful" "groggy" "grumpy" "guilty" "happy" "high" "hopeful" "horny" "hot" "hungry" "hyper" "impressed" "indescribable" "indifferent" "infuriated" "intimidated" "irate" "irritated" "jealous" "jubilant" "lazy" "lethargic" "listless" "lonely" "loved" "melancholy" "mellow" "mischievous" "moody" "morose" "naughty" "nauseated" "nerdy" "nervous" "nostalgic" "numb" "okay" "optimistic" "peaceful" "pensive" "pessimistic" "pissed off" "pleased" "predatory" "productive" "quixotic" "recumbent" "refreshed" "rejected" "rejuvenated" "relaxed" "relieved" "restless" "rushed" "sad" "satisfied" "scared" "shocked" "sick" "silly" "sleepy" "sore" "stressed" "surprised" "sympathetic" "thankful" "thirsty" "thoughtful" "tired" "touched" "uncomfortable" "weird" "working" "worried")))
|
|
|
|
|
(if (equal mood "")
|
|
|
|
|
(sleep-for 0)
|
|
|
|
|
(unless (equal mood "")
|
|
|
|
|
(insert (concat "post-mood: " mood "\n")))))
|
|
|
|
|
|
|
|
|
|
(unless (string-equal system-type "android")
|
|
|
|
@ -63,10 +64,7 @@
|
|
|
|
|
(setq music (lastfm-user-get-recent-tracks :user lastfm-user :from 1 :to 1))
|
|
|
|
|
(setq music (replace-regexp-in-string (regexp-quote "\" \"") " – " (format "%S" music) nil 'literal))
|
|
|
|
|
(sleep-for 1)
|
|
|
|
|
(if (not music)
|
|
|
|
|
(setq music "nil"))
|
|
|
|
|
(if (equal music "nil")
|
|
|
|
|
(sleep-for 0)
|
|
|
|
|
(unless (not music)
|
|
|
|
|
(insert (concat "post-music: "
|
|
|
|
|
(let* ((musicjunk
|
|
|
|
|
(format "%S" music))
|
|
|
|
@ -84,27 +82,33 @@
|
|
|
|
|
(sleep-for 0)
|
|
|
|
|
(insert (concat "post-icon: "icon "\n")))))
|
|
|
|
|
|
|
|
|
|
(unless (string-equal system-type "android")
|
|
|
|
|
(defun dwtags ()
|
|
|
|
|
"Set tags for DW post"
|
|
|
|
|
(setq basetags (s-split "\n" (f-read dw-tagslist) t))
|
|
|
|
|
(setq tagslist (completing-read-multiple "Tags: " basetags))
|
|
|
|
|
(setq tags (s-join "," tagslist))
|
|
|
|
|
(insert (concat "post-tags: org-export," tags "\n"))))
|
|
|
|
|
|
|
|
|
|
(unless (string-equal system-type "android")
|
|
|
|
|
(defun dwlocation ()
|
|
|
|
|
"Set location for DW post"
|
|
|
|
|
(setq location (read-string "Location: " dw-defaultlocation))
|
|
|
|
|
(if (equal location "")
|
|
|
|
|
(sleep-for 0)
|
|
|
|
|
(unless (equal location "")
|
|
|
|
|
(insert (concat "post-location: " location "\n")))))
|
|
|
|
|
|
|
|
|
|
(unless (string-equal system-type "android")
|
|
|
|
|
(defun dwmusic-manual ()
|
|
|
|
|
"Set current music for DW post if lastfm.el not set up"
|
|
|
|
|
(setq music (read-string "Music: "))
|
|
|
|
|
(if (equal music "")
|
|
|
|
|
(sleep-for 0)
|
|
|
|
|
(unless (equal music "")
|
|
|
|
|
(insert (concat "post-music: " music "\n")))))
|
|
|
|
|
|
|
|
|
|
(unless (string-equal system-type "android")
|
|
|
|
|
(defun dw-posted ()
|
|
|
|
|
"Log DW post"
|
|
|
|
|
(find-file-noselect "~/Documents/drive/org/calendar/habit.org")
|
|
|
|
|
(with-current-buffer "habit.org"
|
|
|
|
|
(find-file-noselect logfile)
|
|
|
|
|
(with-current-buffer (file-name-nondirectory logfile)
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(re-search-forward "RECUR dw posts")
|
|
|
|
|
(org-shiftright)
|
|
|
|
@ -112,14 +116,14 @@
|
|
|
|
|
(save-buffer))))
|
|
|
|
|
|
|
|
|
|
(unless (string-equal system-type "android")
|
|
|
|
|
(defun dwpost (psubject tags)
|
|
|
|
|
(defun dwpost ()
|
|
|
|
|
"Post to DW"
|
|
|
|
|
(interactive (list (read-string "Post title (REQUIRED): ")
|
|
|
|
|
(read-string "Tags (comma-separated): ")))
|
|
|
|
|
(interactive)
|
|
|
|
|
(setq psubject (read-string "Post title (REQUIRED): "))
|
|
|
|
|
(dwexport)
|
|
|
|
|
(compose-mail (concat dw-username "+" dw-pin "@post.dreamwidth.org") psubject)
|
|
|
|
|
(with-current-buffer (concat "*unsent mail to " dw-username "*")
|
|
|
|
|
(insert (concat "post-tags: org-export, " tags "\n"))
|
|
|
|
|
(dwtags)
|
|
|
|
|
(dwsecurity)
|
|
|
|
|
(dwlocation)
|
|
|
|
|
(dwicon newname)
|
|
|
|
@ -134,4 +138,5 @@
|
|
|
|
|
(kill-buffer (concat "*sent mail to " dw-username "*"))
|
|
|
|
|
(with-current-buffer oldname
|
|
|
|
|
(delete-file newname))
|
|
|
|
|
(dw-posted)))
|
|
|
|
|
(cond
|
|
|
|
|
(log t (dw-posted)))))
|
|
|
|
|