Tweets starting from here
18 Feb 2018
/sites/default/files/styles/large/public/20180219-notes-ui.png?itok=Xp6Vepyy
Tweets starting from here
My previous post inspired Joeri to some improvements on his site. Nice!
I built another step towards POSSE this weekend: tweet-sized notes posted as content on yoroy.com that get pushed to Twitter via RSS and Zapier. Here’s how:
Create a new content type “Note”. This one needs to only have a text area. And here we run into Drupal always requiring a title. We can’t create entities without giving it a title. The title itself is always a text field, so not ideal for writing 280 char bits of text. Two contrib modules to work around this:
- Auto entity label to define an automatic pattern for the title of these Notes. I set it to use a simple timestamp.
- Exclude node title to actually hide the title field on the Note creation form and on display.
Next I defined a new text format that does not use CKEditor but allows tags and automatically transforms URLs into links. I set this to be the default text format for the text area on the Note using the Better Formats module (sadly currently only available as an old development release). This step is optional, it helps remove user interface clutter. This gives me a content creation form with just a single plain text text area, a “published” checkbox and a Save button.
I updated the views that list blog content on this site to also include content of type “Note” and configured a Notes RSS feed as well. I use this feed as an input on Zapier where the Notes body is extracted and posted as a tweet.
Tags