Blog/20131109 Blogging Twitter Facebook

From Bjoern Hassler's website
Jump to: navigation, search

More from B's blog:

Some older entries are here.

1 Blogging using MediaWiki, with Twitter and Facebook

Just a quick blog post about blogging, and some technical stuff about MediaWiki. This website is built in MediaWiki, and I've always resisted having a separate blog (or a separate website content management system). Wordpress (etc) obviously makes for better blogging, but you can get a certain way just within MediaWiki. The way it's done on my site is using templates that indicate that a certain page is a blog post. The templates create a list of recent posts on each blog post (implemented through the Semantic extension, which keeps track of pages that are supposed to be blog posts). There's also an rss feed, that's bolted onto the wiki (which was a feature considered essential for a blog a few years back, though -- see below).

With all that in place, creating a blog post on the wiki is fairly straight forward: I'd installed the page creation extension, and then when a new blog page is created, some text (with the needed templates) to copy and paste is offered, that turns that page into a blogpost (such as some semantic stuff). Unfortunately it wasn't possible to put the (dynamic) information into a template to pre-populate the page. So overall, this became a bit cumbersome. Yes, I agree, I am bending the MediaWiki system to my will here, and yes, it's not a blogging environment, but once it's all set up, it actually it works. But it's just a little cumbersome in terms of having to copy and paste some text to set up a new blog page. So how to make it less cumbersome?

2 Connecting the wiki to the command line

As you can see from my Mediawiki musings, I've always been a great fan of editing mediawiki pages offline, i.e. downloading a page, doing something, and then re-uploading it. This allows you to find certain pages, or to do a global search and replace. Of course this could do fatal damage to a site (e.g. Wikipedia!), but when using a wiki for our projects, it's sometimes really convenient. I'm also able to upload files automatically, which helps to speed things up too. These are great features, and I wished they were a bit better supported by the MediaWiki community. I can see how e.g. for Wikipedia you would want people to hand-craft each edit. However, for our site, sometimes stuff need be changed globally (such as management of our YouTube videos as mentioned in the previous blog post).

So it was then simple to adapt the offline tools for blogposts: Write the blogpost offline, wrap it in all the needed templates, and the post it:

blogpost some_wiki_text_file

So far so good.

3 Connecting to social media

What's missing? Well, as mentioned above, an rss feed used to be pretty standard for blogs. However, now social networks (e.g. tweeting, Facebook updates, etc) are the new blogs. So I'll need to connect my blogging system with social media.

Let's first look at how to notify other servies about new blog posts.

3.1 Twitter to Facebook

I used to use TweetDeck to post to several Twitter accounts (including my personal account, and where appropriate a project account) as well as Facebook (but only posting to personal Facebook pages was supported, rather than project or group pages). But at some stage TweetDeck discontinued integration with Facebook. However, it is possible to connect Twitter with Facebook, which I had done a while back, but needed setting up again. So that's not a bad start.

3.2 Posting to Twitter

Posting to Twitter, there's an API (e.g. for python and perl). It's just a few lines of code to write something that posts from the command line

tweet my_update

and can thus work inconjunction with the blog posting tool above. It's of course possible to update Facebook via the graph api as well, but that won't catch anything that I tweet via other websites. It would be nice to have this on Facebook, and hence the choice to connect Twitter to Facebook, rather than using the API for both.

3.3 Posting elsewhere

It would be nice to post to LinkedIn as well, but this isn't directly possible (thought it used to be) from Twitter to LinkedIn (though from LinkedIn to Twitter it seems). It might be best to solve this through the API or maybe IFTTT. Higher priority would be posting to Google+, and I need to find a solution for that as well.

3.4 Share This

I should also add a "Share This" button. A simple implementation can be seen below!

2013-11-09 | Leave a comment | Back to blog Share on Twitter Share on Facebook