This week’s solutions: export twitter followers, auto anchors for WordPress and shortening urls in twitter badges

Thought I’d share some solutions I’ve found for problems I’ve encountered this week.

Problem: How to export a table (*.xls or *.csv) of twitter followers?
Solution: I first tried which was good because it didn’t ask for twitter account login details, but the results are limited to 100 entries. I then tried which did the job (but does require twitter username and password)

Problem: Adding anchors to WordPress blog?
Solution: This problem was asked by our e-learning accessibility expert, Craig Mill. He wanted to make some of his longer blog posts more accessible by having a table of contents at the top. The solution was very straight forward as MindWireMedia have created the Auto Anchor List plugin which does exactly what we were looking for. The plugin scans though posts and pages looking for headings, automatically creating a navigable contents list at the beginning of the post. To see it in action check out Craig’s e-Inclusion Blog

Problem: How to reformat long urls in twitter badges? We had a problem with urls in the @rsc_ne_scotland twitter badge which we use for News announcements on our site
Solution: Using help from this how-to on Taco Quest and code from sevenofnine on I came up with the code below. If you would like to use it just grab this JavaScript file to replace ‘ blogger.js’ (this method of creating twitter badges has changed but here is an explanation for adding an old widget):

function twitterCallback2(twitters) {
  var statusHTML = [];
  for (var i=0; i<twitters.length; i++){
    var username = twitters[i].user.screen_name;
    var status = twitters[i].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) {
    var lm = 28;
    var strD = url.split("");
    var strB = "";
    var strT = "";
    var breakChar = "...";
    for(var i=0; i < strD.length; i++){
        strB += strD[i] ;
        if(strB.length >= lm){
            strT += strB + breakChar;
            strB = "";
    if(strD.length < lm){
        strT = url;
      return '<a href="'+url+'">'+strT+'</a>';
    }).replace(/\[email protected]([_a-z0-9]+)/ig, function(reply) {
      return  reply.charAt(0)+'<a href="'+reply.substring(1)+'">'+reply.substring(1)+'</a>';
    statusHTML.push('<li><span>'+status+'</span><br/><a style="font-size:85%" href="'+username+'/statuses/'+twitters[i].id+'">'+relative_time(twitters[i].created_at)+'</a></li>');
  document.getElementById('twitter_update_list').innerHTML = statusHTML.join('');

0 Responses to “This week’s solutions: export twitter followers, auto anchors for WordPress and shortening urls in twitter badges”

  • No Comments

Leave a Reply


This blog is authored by Martin Hawksey e-Learning Advisor (Higher Education) at the JISC RSC Scotland N&E.

JISC RSC Scotland North & East logo

If you would like to subscribe to my monthly digest please enter your email address in the box below (other ways are available to subscribe from the button below):

Subscribe to MASHe to monthly email updates


The MASHezine (tabloid)

It's back! A tabloid edition of the latest posts in PDF format (complete with QR Codes). Click here to view the MASHezine

Preview powered by: Webthumb

The MASHezine (eBook)

MASHe is also available in ebook and can be downloaded in the following formats:



Opinions expressed in this blog are not necessarily those of the JISC RSC Scotland North & East.

JISC Advance Logo

JISC Advance is a new organisation that brings together the collective expertise of established JISC services:

For further information visit

Creative Commons Licence
Unless otherwise stated this work is licensed under a Creative Commons Attribution-ShareAlike 2.5 UK: Scotland License