A Simple Plugin to Auto-Tweet from K2

At itoctopus, we like to give our readers a really special treat from time to time. Today (well, actually tonight – it’s 2:19 AM here in Montreal now), we have decided to release, for free, a plugin that is used to automatically post tweets whenever you publish a new K2 item. In other words, whenever you publish a new K2 item, a tweet will be automatically posted on the Twitter account for your choice. The tweet will be in the format: “New Post: Item Title [Item Link]”.

Unless you are a Joomla wizard, we recommend you read the following technical points to ensure that the plugin works on your website:

  • The plugin is made for the new Twitter API – which means that you must create a Twitter application here and ensure that the application has read and write access to your Twitter account. We won’t go into the details on how to do this here – please contact us if you need help in this step (note that we charge a fee for our services).
  • Once you create the application, you will need to add the Twitter generated Consumer Key, Consumer Secret, OAuth Token, and OAuth Secret values to their corresponding places in the newly installed plugin.

  • Unfortunately, even after doing the above, you still have some work to do. The plugin forcefully makes use of Google’s URL shortening service (there’s no way around this since some K2 links are very long and Google’s URL shortener is, in our opinion, the best) – which means that you will need to create an API key with Google to use this service. You can easily create one here. Once you do that, copy the API key supplied by Google and paste it in the field Google API Key in the plugin.

  • After doing all the above, you can activate the plugin and watch those tweets magically flow into Twitter every time you add a new item to K2. Note that if your K2 title is longer than 120 characters, then it’ll be trimmed down to 120 characters.

Now (also before downloading) we have a few things to say that are not that technical:

  • By downloading and installing the plugin, you are doing so at your own risk. While we are sure that our work is clean, we are not responsible for any damage that this plugin may cause to your website and/or your business (and/or everything else in this world, for that matter – including global warming!), whether directly or indirectly. In short, we cannot be held responsible for anything because of this plugin. If you don’t trust it, then don’t download it.
  • We have no hidden links anywhere in the plugin – we are totally against this practice.

  • The plugin belongs to us – we have created it from scratch. You have the right to modify it and use it any way you like, but you don’t have the right to remove our credits from the code. In other words, the name “itoctopus” should never be removed from the code.

  • The plugin includes some common PHP libraries. These PHP libraries are open source and are not written by us.

OK – now that you have read the above and that you have agreed to it, please go ahead and download the K2 Auto-Tweet plugin from here. (Compatibility: Joomla 2.5.x)

If you have problems installing the plugin (or if you need help installing it), then feel free to contact us. Please note, however, that our very reasonable fees will apply.

4 Responses to “A Simple Plugin to Auto-Tweet from K2”
  1. Comment by Alberto — September 24, 2013 @ 6:56 am

    Hi there ! Really nice module, worked great !!!

    I just would like to suggest to modify the file “autotweets.php”, the line 1200, more or less, where it says:

    $itemLink = JURI::root().$itemLink;


    $itemLink = K2HelperRoute::getItemRoute($item->id.’:’.urlencode($item->alias),$item->catid.’:’.urlencode($item->catalias));

    This way, user the goes to the real path of the article, although you still won’t get a friendly URL…

    Thanks again!

  2. Pingback by The JED (Joomla Extensions Directory) Need to Be Better Managed | itoctopus — November 19, 2013 @ 5:09 pm

    […] in May, we submitted a simple extension, this one, to the JED. Today is November 19th and the extension still wasn’t approved or disapproved. […]

  3. Comment by Dimitris — October 8, 2015 @ 6:19 am

    Nice plugin, works fine when adding a K2 item from the backend. It doesn’t seem to work when adding a new article directly through the frontend.

  4. Comment by Fadi — October 21, 2015 @ 5:14 am

    Hi Dimitris,

    We only tested this plugin on the backend – so it might not work when adding K2 articles from the frontend. The nice thing about this plugin is that it was built for Joomla 2.5 but it still works on Joomla 3.4.4 and the latest version of K2!

    Note: You can always contact us and we’ll address the issue on the frontend so that you can meet your requirements.

Leave a comment