It's that time of year again lads. Time to NESTLE comfortably in the cyber bosom and spend too much time tinkering with the toys and building unnecessary new ones.
I wanted to add a DW crosspost feature to my gameblog frontend thingy, and realized mobile posting could be leveraged for that using Python's SMTP library.
Mobile posting is pretty cool actually! If you attach images to the email, they're uploaded and added to the end of the post with a line break, which makes adding images marginally less fussy. Downside is you have no control over the size or placement.
Dreamwidth chooses a numeric filename based (I think) on total images uploaded across the site, so I don't know any way to anticipate the attachment image urls and include size/placement html in the body of the post.
For the convenience of all, I include a cut-tag at the end of the body and attach thumbnails instead of the full screenshots. Since the images are automatically added at the bottom of the post, I cannot programmatically add anything after it (like, say, a closing cut-tag). Thankfully, Dreamwidth graciously accepts my rube lack of formal </cut> and the cut-tag handler accommodates this.
Don't Panic
Nor despair, I intend to xpost selectively. Probably first thoughts game posts, or longer ones that will be of general interest, and I'll spare you all my mundane "look I reorganized my cow pasture for the 1234th time" posts.
That being said, if I can infect anyone with the Farm Together virus, I will consider all the above time well spent. There will be rainbow llamas in your future. Yes, I am threatening you.
Bonus: Github fun
I can never leave well enough alone, so I crawled around in the the Dreamwidth source code for a bit, which was educational and amusing. I'd like to pay my respects to whoever did all the mobile carrier handling to make sure email posts from various carriers didn't post a bunch of JUNK.
Witness this valiant battle in dreamwidth/cgi-bin/DW/EmailPost/Entry.pm:
# tmobile hell.
# if there is a message, then they send text/plain and text/html,
# with a slew of their tmobile specific images. If no message
# is attached, there is no text/plain piece, and the journal is
# polluted with their advertising. (The tmobile images (both good
# and junk) are posted to scrapbook either way.)
# gross. do our best to strip out the nasty stuff.
cleanup_mobile_carriers includes special cases for Sprint PCS, T-Mobile, Alltel, Verizon, Virgin Mobile, and UK service 02 whatever the heck that is.
Bless. 🙏