Wednesday, October 5, 2016

Wednesday: I don't feel like drawing more stick figures today.

I also didn't wait around to find this Lickitung.
I automated the tldr Lovecraft stuff over the weekend, so all I have to do is run the script and it dumps out the html for that day.

  • Title:  The Quest of Iranon
  • Date:  1921
  • Summary:  One of Lovecraft's fantasy stories, in which Iranon wanders around talking about his home, where's he's the prince, and how wonderful it is, but no one has ever heard of the place until the end, when Iranon meets someone who knew him when he was a homeless orphan kid making up crazy stories.
  • Real Villain:  Being a deluded asshole.  Also bullies, now that I've reread it.
  • Last line in italics?  No.
  • Writer writes instead of fleeing?  No.
  • Rating:  3/10.
  • Read it:  Here.
But having things automatically generated gave me an idea yesterday.  My usual blogging strategy involves:

  1. Reading all the internets, largely via my RSS reader.
  2. Loading all the interesting items into tabs.
  3. Running the script that scans my auto-copied phone images for ones taken today, and then displays them so I can choose which ones to use, at which point they're resized to not use so much space.
  4. Opening blogger to type everything in, followed my copy/pasting all the links as appropriate.
This is fine, but it seems like it wouldn't be too hard to automate the boring stuff.  Blogger has an API that supports posting.  I thought it supported images, but I guess Blogger images are shuffled into Picasa (which is deprecated) and now into Google+.  I assume there's an API for that as well, but setting up images is not the hardest part.

Links are the worst part.  If I understand things correctly, it should be possible to extract a list of currently open tabs from chrome's Current Tabs and Current Session files.  I've found this documentation describing the format, and other than the generic "I hate binary files," it doesn't look too hard to pull information out.  I also discovered this fact about the History database:  "its timestamp is formatted as the number of microseconds since January, 1601".  Because that's a sane way to do it.

In any case, this suggests that I could add a new script to scrape the tab information, format it into appropriate link format, create a new draft post with that information in it (possibly with images already included), and then dump out the link to edit the post with words.  This would probably save me a bunch of time.
Based on today's links, it takes about 3 minutes to reread and choose the text blurbs, and another minute to do the linking.

No comments:

Post a Comment