Aaron Parecki
“Because I’ve already got webmentions on my site, Brid.gy worked straight out of the gateâa lovely demonstration of some small pieces, loosely joined.” - @adactio on posting notes from his own website: http://adactio.com/journal/6826/
A week ago, I tweeted:
After a long weekend of coding, I’ve got a brand new section on my website.
But that tweet did not originate on Twitter. That tweet is a copy. The original is here.
To be honest, I’ve never been that pushed about having my own bite-sized updates hosted on my own site and syndicated out to Twitter. I’m much more concerned about my photos. Still, I thought it was pretty cool the way that Chloe, Aaron, Amber, and Barnaby have a “notes” section on their sites hosting the canonical URLs of their updates, so I thought I’d give it a shot too.
Michael Bester has written about his online homesteading process. You can also read—or listen to—Chloe’s process.
Creating a new section on my own site is pretty straightforward. My home-rolled CMS is really creaky and ropey but it gets the job done. The notes section is just another kind of post, same as journal, links, and articles. The tricky bit (for me) was figuring out how to post a copy to Twitter.
It was pretty clear which API method I needed to use. The hard part was all the OAuth stuff. I’ve never meddled with that kind of voodoo before.
I signed into dev.twitter.com and created an application called adactio.com. I’m given an API key and an API secret. This application will only never need to post as me, so I was able to take advantage of single-user OAuth to generate my access token and access token secret:
By using a single access token, you don’t need to implement the entire OAuth token acquisition dance.
Now I had the four pieces I needed to send with a status update:
I found a small PHP library that uses Andy’s OAuth code. Looking at the source code, I was able to figure out what I needed to send to Twitter. The OAuth class is doing all the hard work—my PHP code is fairly basic.
Imagine my surprise when it actually worked.
I fiddled around with my site’s crude templating system so that if I’m logged into my little CMS, I’m presented with a simple update form on the front page of adactio.com.
When I type a note into that form and hit “post”, here’s what happens:
Having the ID of the copy on Twitter allows me to provide some Twitter-specific actions from my own site: reply, retweet, fave, etc.
Okay, so now I’m posting to Twitter from my own site. Nifty! But what about receiving notifications from Twitter? If someone replies to, or likes, or favourites the copy of my note on Twitter, it would be nice to get notified about it on adactio.com.
This would be a really complex problem to attempt to solve for myself, but fortunately I don’t have to. Brid.gy is a magical tool written by Ryan Barrett that you can authorise to watch your Twitter profile. It will send a webmention back to the canonical URL on your own site whenever anyone replies to, or retweets or favourites a post.
Because I’ve already got webmentions on my site, Brid.gy worked straight out of the gate—a lovely demonstration of some small pieces, loosely joined.
Like I said, I wasn’t all that pushed about hosting my own short updates but now that I’m doing it, I’m really, really enjoying it. It feels good.
It feels good to be using my own website for “microblogging”. I know that’s a distasteful phrase but it’s a fairly accurate way of describing how I tend to use Twitter. My earliest tweets definitely feel like short blog posts.
Conversely, looking back on how I was blogging very early on, a lot of those short posts feel like tweets. So it feels good to bring those notes back to adactio.com.
“Because I’ve already got webmentions on my site, Brid.gy worked straight out of the gateâa lovely demonstration of some small pieces, loosely joined.” - @adactio on posting notes from his own website: http://adactio.com/journal/6826/
“…now that I’m doing it, I’m really, really enjoying it. It feels good.” — @adactio on posting notes on his own website. http://adactio.com/journal/6826/ #indieweb
Congrats @adactio on implementing #indieweb notes! adactio.com/journal/6826 Who’s next? indiewebcamp.com/note#IndieWeb_Examples
the IFTTT link doesn’t link to the post..
oh, unless that is supposed to link to /notes then it’s fine.. just me being confused
@Wordius This is the form: gist.github.com/adactio/2af1b8… And this is the code that posts to Twitter: gist.github.com/adactio/6ebb32…
Manton Reece recently shared his microblogging setup with WordPress. I have a similar system that was inspired by Jeremy Keith’s example. Like Manton, I had to figure out the quickest way to create a new post. I eventually settled on SMS-to-post thanks (once again) to Twilio. SMS-to-post lets me text my Twilio number which sends the text to WordPress where it becomes a new “note”. Publishing that “note” to Twitter is just a matter of hooking into the WordPress publish_post action and sending the post to Twitter via its API.
Here are a few other implementation notes:
@adactio That link’s not working. Probably my internet, unless your site has gone down or something…
@adactio I feel the same way about people using Less instead of Fewer. Everyone tells me to shut up when I go on about it, though.
@adactio If you’re getting a bit stressed about it have you thought about looking at gifs of puppies? giphy.com/search/puppies