App.net plugin for WordPress

This is a plugin that will allow you to embed ADN posts and add a App.net widget to your sidebar in WordPress.

Download this plugin from the WordPress Plugin Directory.

Embedding App.net posts

To embed a post from App.net, just add the url to the post in the content, and it will be displayed. Just like you would expect from an oEmbed solution. Below you can see the result and the original link respectively.

@thomasmb
thomasmb The first version of my App.net #WordPress plugin for embedding posts and adding widgets is now available for download. http://cl.ly/K8j1
https://alpha.app.net/thomasmb/post/978899

If you want to embed this with a shortcode instead, there is a “tmb_adn_post” shortcode available, which for now only takes the post ID value. Below you can see an example of this.

[tmb_adn_post id="632713"]

Available settings

With this plugin there are some setting included. You can find these by going to ‘Settings -> TMB ADN’. Here you can make the following changes:

  • Choose whether to display username (@thomasmb) or full name
  • Show what client was used to post to App.net
  • Option for opening links in new tab/window
  • Choose whether you want to disable the styles that are loaded by the plugin – for anyone who wants to theme it.
  • Choose whether cache expires after a certain amount of time, and needs to be reloaded.
  • If cache is set to expire, choose how long it takes before these need to be reloaded.

I have chosen to disable cache-expiration of the posts, as the only thing that can change is either the avatar, or the username. At the same time, if the ADN-post is deleted by the user, if expiration is turned off, it will still be saved in the database.

App.net widget

I have included a simple widget for displaying App.net posts. With this widget, you can choose to show either posts by a user, or posts that have been tagged. Below you can see the settings that I used for the two widgets, which you can see live here: sandbox.bensmann.no

adn-widget

This widget does not have any styles ‘packaged’, and will thus be at the mercy of your theme. The data that is displayed by the widgets is loaded client-side. It waits for the site to be loaded, after which it requests the data from the App.net API. The Widget is populated as soon as the information is returned.

For now it does not have a auto-update solution, and will be loaded at every page-load instead – again client side, so your server does none of the heavy lifting. The reason that no auto-update has been included for now is that with the rate of posts being added to App.net, I simply couldn’t see why it would be worth checking again every second.

Version History

1. March 2013: Updated styles, and added minified stylesheet and script files.

25. October 2012: Added option for opening links in new tab/window

24. October 2012: Small fix for themes that don’t include the widget class

23. October 2012: Fixes the plugin after App.net API changes

14. October 2012: Initial release. It works – for me at least

Coming features

  • Embed latest post for user – updates automatically
  • Widget for showing posts that are starred by a user
  • Optional link to profile or tag after the widget

I’m a webdeveloper based in Oslo, Norway. I currently work with webdevelopment as lead developer and solutions architect at Metronet.

I would like to change the world, but they won’t give me the source…