Browsed by
Tag: Twitter

What does your Twitter followers look like

What does your Twitter followers look like

I like Twitter. It’s the virtual world’s answer to Post-it notes, well not really, but the nature of the site constrains people from droning on-and-on about a topic. The restrictions in the number of characters a user may put into a tweet causes brevity, which is ideal when the total number of people who you follow is increasing and the live-feed of Tweets is updated several times per minute. This restrictions in the number of characters have fostered a certain repurposing of signs. The @ (at-sign) is working as a reference to users and the # (hash-sign) is used to concentrate commentaries about a topic.

From a programming-wise perceptive the decoupled nature of Twitter is interesting. While and other Facebook-created applications are the favourite place to access Facebook-data, Twitter is built around a more open model. Facebook is complicated with several ways of interacting, many modalities, third-party applications and a requirement to login to get access. Twitter is opposite, it has very simple and easy to understand structure and is open (though user may protect their feed to accepted followers this is not default and luckily not widely spread). These differences leads, at least for me, to Facebook being a personal and private social network and Twitter being used more for interests, both professional and private.

The decoupled nature of Twitter has led to an abundance of third-party applications which interact with the Twitter API. It’s easy to access Twitter data, and more importantly, easy to understand what it all does. Twitter is in that sense a good place to start if you want to play more around with data, Internet protocols and programming. A couple of posts ago I wrote about Mining the Social Web and Screen Scraping with Python (in Norwegian). The post you now is reading goes into the same category. This code example does not however mine any of the data from Twitter, it is just finding the ID of your followers, then get data about each of them and download their pictures. The code here may be used for further data-analysis though if you save the data gathered by the requests to somewhere instead of doing like I do store them in the heap while the script executes and hence automatically remove them when it terminates. Writing the data to file takes just two lines of code, writing them to a database probably four or five.

[sourcecode language=”ruby”]

#encoding: utf-8

dependencies = %w(net/http active_support open-uri uri)
dependencies.each {|m| require m}

class Follower
attr_accessor :name, :created_at, :profile_image_url, :location, :url, :lang, :geo_enabled, :description
def initialize(id)
@id = id

def say_hi
puts "Hello, my name is #{@name}, and I have the id #{@id}. Oh, by the way. I was created at #{@created_at}"

def download_picture
puts "downloading #{@id} : #{@name} from #{@profile_image_url} \n"
unless @profile_image_url.nil?
open(URI.escape(@profile_image_url)) {|f|"pictures/#{@id}.jpg","wb") do |file|



class TwitterGetter

def initialize(name)
@name = name
#@followers =
Dir.mkdir("pictures", 0755)

def get_follower_list
response = Net::HTTP.get("" , "/1/followers/ids.json?cursor=-1&screen_name=#{@name}" )
@followers = ActiveSupport::JSON.decode(response)
sleep_time = ((60*60)/ 75) + 2
puts "set sleeptime to: ", sleep_time, "\n"

@followers[‘ids’].each do |id|


def lookup_user(id)
response = Net::HTTP.get("", "/1/users/show.json?user_id=#{id}&include_entities=true")
info = ActiveSupport::JSON.decode(response)
f = = info["name"]
f.created_at = info["created_at"]
f.profile_image_url = info["profile_image_url"]
f.location = info["location"]
f.url = info["url"]
f.lang = info["lang"]
f.geo_enabled = info["geo_enabled"]
f.description = info["description"]

tg ="olovholm")


So, how does this little script work? First it instantiates the work-horse class TwitterGetter which takes the argument of the user which followers’ pictures you want to download. This class creates the directory in which the pictures will be downloaded into. Once instantiated we call the get_follower_list method which accesses twitter data through the REST-API  then parse the JSON stream from   response = Net::HTTP.get("" , "/1/followers/ids.json?cursor=-1&screen_name=#{@name}" ). Once the list is downloaded a script runs through the new list of followers and gathers data from the Twitter API on each of the users. Due to limitation in how many requests one can call to twitter each hour I put the script to sleep for

total time units % requests allowed per hour

(You may request Twitter 150 times per hours, but the lookup user calls download_picture which downloads the image – It may be that this is excluded from the restrictions). Well, the user class stores data from each of the users and has the code and responsibility for downloading the users pictures. It also contains a say_hi method which perhaps would be better as a bit more formal to_s method. The code is more a proof of concept and does not contain error handling for JSON data returned by Twitter (which, believe me, happens quite often) so that would be a good place to start if you want to expand on this code.

2011 – What will happen?

2011 – What will happen?

Soon 2010 will be history, and a new year will begin. 2010 was a long year in which many interesting things happened (as every year). I will now look into my light ball, able to foresee the future, and come with some anticipations about what the new year will bring. As always is it impossible to judge the future, and how things are to become, so this is just some thoughts of what will happen, as a little new years tradition and for the enjoyment it is to read this predictions at this time next year.

2011 will be an interesting year, as every year, but it will not change the world dramatically. It will be a year in which politicians will have to defend their actions during the economic crises, and more countries will have economic problems. This will cause problems in Europe, and the Americas, but Asian countries, mainly China, will to a greater extent succeed due to the entangled economy connecting government to production. This will cause some critic due to the human right conditions in China, and arguments from the west will involve the freedom of the individual, while the arguments from China and a growing share of countries in Asia, America and Africa will focus on the ability to fulfil more primordial needs of Maslow’s  pyramid. This will not result in a crisis, but a general belief that the power centres of the world is moved from the US to other parts of the world.

This will also be continued by embarrassing leaks from the cables which we saw in 2010.  None of this will be fatal in world politics, but diplomatic personnel from the 90’s superpower will lose credibility and more questions will arise about the power in Washington. Especially the BRIC (Brazil, Russia, India and China) countries will try to establish themselves as more prominent players on the international arena, and this will be on the cost of the United States and the most loyal counties in Western Europe. There will be asked more questions about the politics within the European Union, and as more countries get into economic trouble, the focus will shift towards east, and this will improve the means of communication to Russia, but many will be sceptical and question the legitimacy of the rulers in Moscow.

In technology the trend of applications and devices will continue, and Apple will lead this process, at least in the mass medium, however will the early adapters look to other platforms which will emerge. The focus on mobile technology will be around, but will be replaced by a discussion on the nature of Television, which will be brought up as Video on Demand, Google TV and other technologies converging TV with the Internet will be introduced. This will cause another intellectual property debate, as many visual content providers will try to lock their customers into a network decoder relationship and focussing on propitiatory solutions instead of the open sharing. Downloading will still be important, but as more services are provided from the cloud instead through a physical media the control among the broad numbers of consumers will pay for services through subscription services which will be more popular to bundle with electronics sold in stores.

Among the regular consumers will this be the year their old phones are replaced by smart phones, and the vast numbers of users will be attracted this year. More affordable prices will be one of the most important reasons for this, as well as more useful services will be provided through mobile applications. Employers will also develop their internal systems onto portable applications, and this will trigger a debate on security. Security and privacy issues continue to be important and  a major discussion between these two will find place.

Online more people will realise that Facebook poses a threat to their privacy, and a more mature audience will be more aware of what they put online. The popularity the service experienced when it first opened and got popular will dismay, and users between 20 and 35 years will spend less time, but new generation will still think it is fun and spend more. Other social websites will be launched, but not with such popularity. Twitter will be more popular among a more professional audience, and the private users will not embrace the short messages and stick to more extensive sites; Facebook. Integration will be triggered, and 2011 is also a year when APIs are shared, and JSON intercommunication is popular between services. Some topical sites for users will be launched by iconic brands to keep customers loyal and together, this will be a big pat of the political landscape where politicians will try to get more legitimacy through dialogues with their voters, and they will need this as the economic crises expands, and their earlier decisions are being questioned.

This is just some core ideas and questions I think will dominate the next year. I have  not made guesses regarding natural crises, terrorism, integration and snow weather, but they will as well be prevalent topics in the year to come Oh, and I’ll give you an easy to check guess: I guess the Eurovision will be won be an Eastern European Country.

The picture  is the intellectual property of Scott Rivera, it is licensed under creative commons, and found through Flickr

Your organisation and digital media

Your organisation and digital media

Many governmental and corporate offices choose to be present in social media, and to share and gather information here. Internet services such as Facebook, Twitter, Flickr and Youtube have enabled organisational bodies to participate on an arena where also individuals are contributing, commenting and sharing content. Are you working within an organisation being present in one of these arenas or other. Then I want to get in touch with you.

  • On which platforms are your organisation present, and how?
  • How is your organisation organised around these platforms?
  • Which department is responsible for your organisation’s presence on digital social arenas?
  • Are social media just used for external communication, or do co-workers also communicate internal within your organisation using these?
  • What is your organisations official view on social media?
  • Are employees using different social media as a tool in their regular working day?
  • Do your organisation use digital media to surveillance comments and opinions on your organisation online? Which tools are you using to do this?
  • How do your organisation share information online?
  • How do your organisation gather information online?
  • Is digital media a part of your organisation’s branding strategy?
  • What information do your organisation mainly share online?
  • What information do your organisation mainly gather online?

These are just some of the answers I want to know. If you want to contribute, please let me know by contact me through the contact form provided here, on my twitter page or just by sending me an email.

PS: This questions are just meant as examples, if you have any other comments to contribute with you are welcome to do so. I do also want any good stories about digital media.