Surviving a Wordpress hack

March 2nd, 2010

Far from having a hardcore readership in Russia, I learned the hard way that running a custom Wordpress installation invites hackers to manipulate its fallible security measures. It would seem that the variety of users signing-up with a .ru address have figured out how to inject php code into wordpress, and my 2.8.2 version was riddled with custom javascript, php code and lots of messages about those little blue pills that can do so much for your sex life. I have to hand-it to whoever it was, that they took the time at all to suss out the flaws and use wordpress for such a lofty goal. They even managed to get a PHP file uploaded to the application, which is both alarming and annoying.

In the end, I decided that caution was the best policy, and installed a completely fresh installation of Wordpress. I’ve now disabled users (not really sure of the point of them anyway), and added HTTP authentication to my /wp-admin directory. Its now been a couple of quiet weeks, so I’m taking this to mean victory for now.

I suppose this is the main issue of using open-source software; if you find an exploit, you can cruise around the web, looking for older, vulnerable installations and attack them. The customised code of many of the websites I’ve seen are probably far more vulnerable, but their uniqueness brings a form of security of its own- its too much work for script kiddies to figure out the dynamics of every site on the web, and after all, who cares if you hack Dan Garland’s blog; better-off chasing after Disney and Microsoft, where all the geek kudos would be.

Clean-up

For anyone out there who has experienced a hacked wordpress installation and wants to clean it up, these are the steps I took:

  1. Download the latest version of Wordpress.

    You can find the latest verison at http://wordpress.org/latest.tar.gz.

  2. Move / back-up your old installation and move it out of where apache is serving it.

    Don’t make the mistake of leaving your hacked wordpress somewhere on-line that these pricks can get at it.

  3. Install your new wordpress with a new database

    You could point wordpress at your old installation, but you’re running the risk of leaving some code in a comment or post that will leave your installation vulnerable.

  4. Comb through your old database to remove junk entries, spam and anything that has nasty stuff in it.

    Search particularly for long-entries, or any content not authored by yourself.

  5. Use mysqldump to retrieve the bits of data you want to keep, and import them in.

    I decided to keep posts, comments, tags and categories. I used:

      mysqldump my_db -u user -p wp_links > links.sql
      mysqldump my_db -u user -p wp_posts > posts.sql
      mysqldump my_db -u user -p wp_comments > comments.sql
      mysqldump my_db -u user -p wp_links > links.sql
      mysqldump my_db -u user -p wp_term_relationships wp_terms_tp_term_taxonomy > tags.sql
    

    Barring the odd column here and there that may have changed between versions, this worked for me but gave me the chance to vet what content went back into the database.

    mysql my_db -u user -p < links.sql
    ...
  6. Set a strong admin password

  7. Set HTTP authentication on your wp-admin directory.

Background processing and marshalling files in ruby

January 25th, 2010

I’m currently working on a project to develop a content management system for a leading publisher, that generates content for a DVD. The system, developed in Ruby on Rails, naturally has a significant amount of background processing to do, with various assets respresented with large, binary files, often requiring server-side processing. For instance, we have a need to re-size a file that contains the scanned image of a page in a book, and cut it up into individual tiles for use in a Google-maps-style map.

Previously, I had been using backgroundrb for background tasks in ruby quite happily in projects. I was wooed, however, by the design of the workling project, which works as an adapter between several background schedulers, including Starling. The main attraction was the ability to defer the decision of which background scheduler to use until the last possible moment (an important part of agile development), and to switch between different schedulers in different environments. Now, I use Spawn in development and Starling Background job in production. Best of all, I can use the NotRemoteRunner in test mode, which means I can run my tests synchronously, waiting for the results of execution, without changing any code or running a seperate background process.

A good theory- but like all things in life using working had its share of problems. First of all, due to an issue with memcache and rails 2.3, a customised configuration of workling is required, and not well covered by the documentation. Place these snippets in your environment file of choice.

For Spawn runner:

config.after_initialize do
  require 'memcache'
  Workling::Remote::Runners::SpawnRunner.options = { :method => :spawn }
  Workling::Remote.dispatcher = Workling::Remote::Runners::SpawnRunner.new
end

For NotRemoteRunnner (good for testing!)

config.after_initialize do
 require 'memcache'
 Workling::Remote.dispatcher = Workling::Remote::Runners::NotRemoteRunner.new
end

For Starling

config.after_initialize do
 Workling::Remote.dispatcher = Workling::Remote::Runners::StarlingRunner.new
end

But the real gotcha is when it comes to dealing with Files, or any IO object in Ruby, asynchronously. Because workling makes no assumptions about which background processor you are using, it will call on the Ruby Marshal class to send your objects to your worker class: which in the case of Starling could be a server on a completely different machine. In my case, handling image files with paperclip required sending a file over the wire, but the documentation is scant on this presumably common use case. The solution is to convert your File handle into a binary String, which can be sent over the wire.

file = File.open("path_to_file", "rb")
file_data = file.read
HardWorker.async_foo(file: => file_data)

This will send the binary data to the HardWorker, which can handle it any way it likes. In my case, I used the RMagick library to read it in from a blob:

image_file = Magick::ImageList.new
image_file.from_blob(file_data)

Be warned! The Starling system is built upon memcache, which by design is hard-coded to limit its memory buckets to 1MB each. This has the effect of limiting any marshalled data to a workling worker using Starling to 1MB, which is going to be a problem if you’re dealing with hi-res images or video. In the end, I used background job for my production image processing needs.

The main thing I learnt from background processing though is that synchronously has a ‘h’ in it. I had to re-factor about five classes :/

Boosting the Hubbub of local shops

November 28th, 2009

Hubbub is a new deliveries service that rounds up notable local shops and provides a single shop-front for them all, allowing customers to pick from the best grub in their borough. Selected for their repute, their ethical standards and their quality, the Hubbub shops collectively offer an alternative to the homogenised offerings of the cartel supermarkets, bringing their individual flavour to their community over the web.

Hubbub

With a butcher, a baker, a and greengrocer in Hubbub’s first catchment area, it is feasible to get your week’s shopping on Hubbub, yet the up-market range of cakes, wines and chocolates means hosting your fancy dinner party won’t be tarnished by ‘taste the difference’ wrappers.

Currently, the site delivers only to Islington, London, with plans to expand to other London boroughs. The site is scoped entirely around these delivery zones, which determines what products and stores are displayed. One technical challenge of the site is ensuring that customers, stores, products, deliveries, refunds, orders and shopping baskets don’t drift from Islington to Fulham. (If you wish to try-out the website, try putting in the example postcode provided). Rails helps out by using nested routes to allow us to scope resources within an area, so that our URLs are always prefixed ‘in-your-area/:id’.

But this was no straightforward e-commerce shopping site. Partly down to the ambitious nature of the developers at Head London when planning the project, the site is a full-blown delivery management system that runs the entire Hubbub business, which is a genuine on-line company. The site has to be aware of what deliveries the Hubbub drivers are available to make, and track customer’s shopping baskets on the website to the delivery slots. These slots equate to hours in the day of the customer’s choosing, when they would like their goods to be delivered, and each have a capacity. So the checkout process has to be integrated with this system, to ensure that Hubbub can fulfil the orders the website is taking.

Hubbub also has a sophisticated payment mechanism, beyond the scope of most normal payment-processing use cases. Due to the nature of selling locally-sourced produce, some items may fluctuate in price from the point they are ordered to when they are delivered; items sold by weight such as meat and cheese may vary, especially when whole items are needed, such as a 1 kilogram chicken might actually vary depending on the individual bird. This plays havoc when coding a quantity, price and order total system, of which Hubbub has an elaborate variety of options for the administrators populating the database. To support this change in price, we take a nominal amount to verify the card, refund it and then process the order, which may have radically altered afterwards, some time after. Using SecureTrading and XPay, we were able to realise these special use cases, without compromising on security, and without storing sensitive credit card information. We built an open-source rails gem called breadmachine, which is capable of handing 3D-secure redirects and standard authorisations transparently.

Joining an in-progress project of this size was quite daunting. Given a use case or issue ticket, to comb through fifty model classes and determine what to change made for a steep learning curve. The complex object graph of Hubbub meant that making insular changes was difficult; sometimes a feature ran through the entire system meaning that sufficient tests for regression became an immediate need. We ditched the fixtures, which were becoming unmanageable, with NotaHat’s Machinist to mock the objects, trading the relative ease of object instantiation against an increased test suite running time.

Hubbub enters a busy and unproven, yet growing market of on-line groceries. Some have their doubts, but I think that this market has huge potential. When the quality of locally-sourced produce is considered, as well the environmental benefits, its easy to see on-line groceries go the way of the mobile applications market – initially an expensive and questionable area but eventually viable and sustainable.

Testing UploadColumn with Machinist and Ruby on Rails

October 6th, 2009

In my current Ruby on Rails project, I’m learning about Notahat’s machinist testing framework to build object graphs on which to write unit tests. Its a nice improvement on fixtures; using an object-orientated, programmatic approach to creating test data.

In the pursuit of 100% code coverage, I hit on a problem when trying to test UploadColumn, which was being used for handling images on a Product class. Normally in a Test::Unit class, I could invoke the fixture_file_upload method to simulate the multi-part form upload of an image, but in machinist I couldn’t do that. After finding next to nothing in the way of documentation for testing Upload column, I did some rummaging around in the gem and found the solution.

At the top of your blueprints file, include UploadColumn:

include UploadColumn

Then, in your blueprint, you can use the UploadedImage class to represent your uploaded image:

Product.blueprint do
 title
 description
 image { UploadedFile.upload(File.new(RAILS_ROOT + '/test/fixtures/label.png')) }
end

I hope that helps somebody…

Win at Westfield

September 16th, 2009

I today completed a twelve-day stint working with Westfield London in collaboration with Delete London, working on Ruby on Rails development.

The very lovely digital marketing team had some ideas for quick wins to improve the user experience on the London Westfield website, including adding affiliate product data to the retailer pages, and creating an events booking system. I was brought in to help realise these ideas, and turned around two rapid solutions in the allotted time.

Affiliates

The challenge was to find a way to manage the variety of retailer and affiliate partners that Westfield deal with, in an efficient way. I developed an XML parser using REXML’s stream listener to read XML information from an arbitrary affiliate partner, and create product objects from the live stream. These objects then interface with the existing CMS system and generate XML documents ready to be picked-up in the view. Not only does this vastly improve the look of the retailer pages and raise the profile of their clients, but their click-throughs will earn affiliate fees. Win!

Events

Responding to a very tight deadline, I developed an events booking system, designed for the digital marketing team to administer events with minimal effort. The system, implemented in two days, has an administrative back-end that allows the creation of events, with multiple dates attached, composed in an AJAX-form. I used unobtrusive_date_picker to render a user-friendly date picker, as well as restful_authentication to handle the login process. In order to launch within the timeframe, we decided to build the system as a stand-alone webapp, which was supposed to be hosted on a third-party, but after an eleventh-hour issue, I ended up offering my own server as a host, and therefore have my first corporate client! However, the rendered form sits within an IFRAME to hide the URL from the customer.

Meanwhile, hundreds are signing up to Westfield’s events, and the marketing team can download their required CSV data on demand, and the form will deactivate once individual dates become full.

If you’re into fashion, you should sign-up! http://uk.westfield.com/london/offers-events/events/william-baker-booking

Westfield Stratford City

September 9th, 2009

The first phase of the Westfield Stratford City website has gone live, designed to attract new leasing business and provide information about the huge shopping complex under construction in Stratford.

I’m pleased to see this site go live, as its easily the most complex Ruby on Rails application that I’ve ever worked on. Building on top an existing rails application is relatively uncommon, and Westfield’s international centres require several infrastructural amendments. Not least, the integration with Teamsite, Westfield’s CMS system. The existing framework already defines plugins and libraries for working with the technology, but the challenge was getting my hands dirty and figuring out what was happening from looking at code.

I was involved in all the new Ruby on Rails requirements of the site (I wasn’t responsible for the design, or any of the snazzy effects, quite a bit of which was done in flash), including some features that are still in the latter stages of testing and user acceptance. I developed new templates and views unique to the Stratford site, and created a blogging/news section that has an administrative back-end, allowing moderators to moderate comments on blog entries and publish press-releases. I also created a contact form that prospective clients can use to e-mail Westfield.

Overall the project has been an insightful experience into enterprise-level Ruby on Rails projects. I’ve learned new technologies too- including the RSpec framework. Its interesting to get a feel for the Ruby on Rails experience going into an existing, large project- rather than whipping up a scaffold and turning out webapps in a week.

Before the new features are launched, check-out the new site, including photographs of the construction and a webcam… http://uk.westfield.com/stratfordcity/

Availability Update

August 25th, 2009

I’m glad to be working on some Rails projects with two cool London-based agencies next month. Starting out with a return to Delete London, followed by a project at Head London. Bring it on!

If you have a project starting in October, please let me know.

Questionnaires with Ruby on Rails and AJAX

August 17th, 2009

I approached the task of undertaking market research for my new music start-up company in the typical programmer way: I made a website. I wonder how many of life’s problems I would approach in this way; but having a website seems like a good start.

I wanted to canvass the opinion of friends and colleagues on the habits of their on-line music consumption, particularly pertaining to music subscriptions, which is a central idea within my business plan. I knew that I wasn’t an expert in marketing, so I wanted to design a form that would allow users to customise it as they went; so that they could add choices for others to select as they went along. I accomplished this using a standard ruby on rails website, a form, and some AJAX.

Defining my data

First of all, I wrote down a basic entity-relationship diagram on the back of an envelope of what I wanted my models to look like. I knew I was going to ask a load of questions, so I made a box to represent them. I also knew that each question would have a number of choices to select from, such as ‘Agree’ and ‘Disagree’, which is a one-to-many relationship. Next, I hoped that someone would respond to the questionnaire, by associating a subset of choices with the questions I had asked, so I made a box for ‘responses’. There were multiple choices in the questionnaire and hopefully multiple choices so I needed a many-to-many relationship.

img0081
I even threw in a user model to store a respondant’s age and location; although it was probably overkill.

Iteration #1 – Make some models

I could then ask rails to do lots of work for me using the generate scripts.

ruby script/generate model Question text:text
ruby script/generate model Choice text:string, question_id:integer
ruby script/generate model Response question_id:integer, choice_id:integer, user_id:integer
ruby script/generate model User age:string, location:string

Normally I’d start with a scaffold, but in this case I didn’t want all of the CRUD features for questions and choices available on-line. Instead, I borrowed a trick I’d learnt from hacking around on the hyperactive CMS project to ’seed’ the database by loading in data from YML files, rather like the way fixtures work in the unit tests.

Before I started-up webbrick, I wrote down some unit tests to ensure that the relationships were working the way I expected them to, and to ensure that the basic validation on the models were working correctly.

class QuestionTest < ActiveSupport::TestCase

 test "required fields" do
 question = Question.new
 assert_equal false, question.save
 question.text = 'hi'
 assert question.save
 end

 test "question has choices" do
 assert_equal false, questions(:one).choices.empty?
 assert_equal choices(:emusic), questions(:one).choices.first
 end

end

The first test makes sure I can’t save a question without the question’s text being populated. Rather than testing the rails validation framework, this gives me the peace of mind that I remembered to write the validation, and the test will tell me if I accidentally remove the validation in a future re-factor.

The second test ensures that I have my model relationships configured correctly, so that I can access a question’s choices via an attribute.

I could then go away and implement my model:

class Question < ActiveRecord::Base

 validates_presence_of :text
 has_many :choices, :order => 'choice_index, text'

end

I approached the remaining models in the same way. Before I could see anything in a browser, I needed to populate the database using the YML files I mentioned before. So I wrote the following rake task to populate the database (lives in lib/tasks).

namespace :db do
 desc "Load seed fixtures (from db/seed) into the current environment's database."
 task :seed => :environment do
 require 'active_record/fixtures'
 Dir.glob(RAILS_ROOT + '/db/seed/*.yml').each do |file|
 Fixtures.create_fixtures('db/seed', File.basename(file, '.*'))
 end
 end
end

Which allowed me to structure the data of my questionnaire in the following way:

(db/seed/questions.yml)

three:
 id: 3
 text: 'What music websites do you currently use?'

(db/seed/choices.yml)

emusic:
 question_id: 3
 text: 'E-music'

napster:
 question_id: 3
 text: 'Napster'

spotify:
 question_id: 3
 text: 'Spotify'

I could then run rake db:seed and my database would be populated with the questionnaire data. I could now fire-up a browser and begin programming the view.

Iteration #2: First form

The next job was to create a form that would allow my respondents to view the questions in my database, along with the choices, and make some responses. I had a bit of plumbing to do here, without the scaffold in place, so I generated a controller, added some views and updated by routes.rb.

Once I had a view, I could create a form. I decided to treat the form as an ordered-list, so I created a partial that would supply the HTML for each question and enclosed it in a OL and LI tag:

<% form_tag '/respond' do -%>

<ol>
 <% @questions.each do |q| %>
 <%=render :partial => 'questionnaires/question', :locals => { :q => q } %>
 <% end %>
</ol>

<div id="submit">
 <p>That's all for now! Press this button to complete the survey.</p>
 <%=submit_tag 'Submit Questionnaire'%>
</div>
<% end -%>

This approach immediately posed the problem of how to read in the form data, when the view doesn’t know what questions and choices are being visualised in advance. The solution rested in the correct naming convention that allowed rails to convert the form data into a manageable collection. I wanted a collection of responses, that would each contain a collection of those selected choices a user had made, and this is done by naming each input ‘responses[]X[]‘, where X is the id of the question being asked. This results in a nice collection called ‘responses’, which I can access in the controller through params[:responses], each containing a collection of choices organised by their question_id.

So I could code my question partial (q is the current question):

<% question_name = 'responses[]' + q.id.to_s + '[]' %>
<li class="question" >
      <%=label_tag 'text' + q.id.to_s, q.text%>
      <%=text_field_tag question_name, nil, {:id=> 'text' + q.id.to_s} %>
</li>

However, I realised that I couldn’t determine what type of question is was yet; should I display a text-box, a check-box or a radio-box? Back to the drawing-board.

Iteration #3: Multiple-choices

I needed a way of determining what type of question I was asking: would I allow multiple responses to the same question (appropriate when asking ‘which of the following…), or only one (agree, disagree). I accomplished this by adding a allow_multiple flag to my question model, which I could then read in the view to determine whether or not to display a checkbox (for multiple responses) or a radio-box (for one-choice). When there were no choices for a question, I would assume a text-box was reuqired, and that is how the age/location fields work.

Once I had updated my fixtures, model and database, I could return to the view:

<% if q.choices.empty? %>
  <%=label_tag 'text' + q.id.to_s, q.text%>
   <%=text_field_tag question_name, nil, {:id=> 'text' + q.id.to_s} %>
<% else %>
      <p><%=q.text%></p>
      <% q.choices.each do |c| %>
      <div class="choice">
        <%=label_tag 'choice' + c.id.to_s, c.text%>
        <% if q.multiple_choice %>
          <%=check_box_tag question_name, c.id, nil, :id=> 'choice' + c.id.to_s%>
        <% else %>
          <%=radio_button_tag question_name, c.id, nil, :id=> 'choice' + c.id.to_s%>
        <% end %>
      </div>
      <% end %>

I could now view my form and see the correct input fields being displayed, ready for my controller to save the responses.

Iteration #4: Adding new choices

The main reason for developing a new questionnaire in rails was to allow my respondents to add choices which I hadn’t anticipated, in turn allowing others to choose the same response. This is proving useful for the ‘which music services do you use’ question, throwing-up websites I might not have otherwise heard of and I can now benchmark and investigate.

To add a new choice, I needed a way of distinguishing which questions I would allow new choices for and which I would not, so I added another field to question called ‘allow_new’. I updated my model, fixture, database (and unit test of course!) and was ready to up-date my view.

 <% if q.allow_new %>
      <div class="choice">
        <label>Other (please specify)</label>
        <div id="new<%=q.id%>">
          <%=text_field_tag 'newchoice', nil, {:id => 'newchoice' + q.id.to_s} %>
          <%=hidden_field_tag 'question_id', q.id, {:id => 'question_id' + q.id.to_s} %>
          <%=submit_to_remote 'add_btn', 'Add', :update => ('q' + q.id.to_s),
          :url => '/addchoice', :submit => 'q' + q.id.to_s%>
        </div>
      </div>
      <% end %>

I added a textfield labelled ‘Other – please specify’ and a button with an AJAX action, so that respondants could add their new choice as they went along, without submitting the entire form. In order to achieve that, I used the submit_to_remote button, which in effect allowed me to nest multiple forms within a single form. Although intuitively, I wanted to create additonal form tags to surround the new text field, this approach didn’t seem to work cross-browser and only the one form is needed. Instead, the :submit option is used to tell javascript to serialise all of the form elements underneath the element with the given ID. The beauty is that this element doesn’t have to be a form element- so here I use the DIV surrounding the question, serialising only the text field for the new choice, along with the existing choices (which I later used to pre-populate the choices that had already been selected). I also pass along the question_id in a hidden field, so that the controller knows which question the new choice belongs to.

IE GOTCHAS: Developers beware! This approach of including multiple AJAX submit buttons in IE is very fickle; unless you play by its rules it wont work and you’ll probably waste time trying to figure it out. Don’t fall into these traps:

  1. You cannot nest multiple AJAX forms inside a larger form. It might work in Firefox, but IE won’t know which button you’ve pressed and won’t submit or update your chosen element properly. I found that I couldn’t even submit the main form using this approach!
  2. You cannot nominate any element for the :submit option. I tried using the <li> element at first, but in the end I surrounded the entire <li> with a <div>, and updated that- which works fine cross-browser.

Iteration #5: Finishing up

I had a working questionniare, but I wanted to ensure that at least the age and location fields were completed, and that any previously-completed form elements were not lost in the event that validation failed.

The first task here is to ensure that the user model validates for this information:

class User < ActiveRecord::Base

  validates_presence_of :location
  validates_numericality_of :age, :allow_nil => false

  has_many :responses

end

Now if I try to call save! on the User class, I’ll get an error in my controller. Using a begin/rescue block, I could now take appropriate action:

rescue
     @errors = true
     @questions = Question.find(:all, :order => 'question_order')

     render :action => 'index'
   end

  end

I didn’t want my validation to be too sophisticated. Here I used a flag stored in @errors that I check for in my view to display an error message.

To ensure that the form pre-populates with the previous responses, I had to pass the relevant data back out of the params object as the value parameter for the form tag helpers. In the case of the checkboxes, these values would be within a collection that stores the primary key of the choices that had been made, so a little logic was needed to detmermine whether or not to check the box controls:

checked = prevvalue.include?(c.id.to_s) or c.text == params[:newchoice]

The second test here checks the new choice created by the AJAX form, determined by whether or not the text in the submitted box matches the newly-created test.

So, an afternoon invested in a new questionnaire and hopefully some intriguing insights into our music consumption habits. If you have any observations about my approach here, or have spotted something that I could have done better or more efficiently, please leave a comment as I’d be glad to know about it.

Of course, don’t forget to complete the questionnaire!

http://mostrated.com/questionnaires/

<% form_tag ‘/respond’ do -%>

<ol>
<% @questions.each do |q| %>

<%=render :partial => ‘questionnaires/question’, :locals => { :q => q } %>

<% end %>
</ol>

<div id=”submit”>
<p>That’s all for now! Press this button to complete the survey.</p>
<%=submit_tag ‘Submit Questionnaire’%>
</div>
<% end -%>

Top Ten Google Define Autocompletes

August 12th, 2009

I often use the nifty Google search feature ‘define’ to look-up definitions of dictionary words. There are a few widgets kicking-about on the various desktop environments I use; but none are quicker than firing up my browser and hitting ‘define something’ and receiving a response (apparently something is a single by Lasgo from the album ‘Some Things’, according to Google).

However, I discovered that if you don’t type something in quickly enough, an AJAX trigger calls up Google to suggest some definitions, presumably stored in a trie somewhere on-line, to auto-complete the form. Interestingly, it doesn’t even wait for a first-letter suggestion, so typing in ‘define’ and waiting a few seconds gives you the top-ten words people want definitions for.

Assuming that people looking for definitions are in want of understanding of a given phrase, or want a better, clearer representation of these concepts, it makes for an interesting list:

  1. Globalisationgrowth to a global or worldwide scale; “the globalization of the communication industry”
    My definition: The prevailing free-market idealology of the last thirty years. Big business can go where they like, in a post-nationalist, centralised, hierarchical and acutely unequal world.
    Quite why the uneducated, semi-literate masses would be interested in a system that is designed for their superior plutocratic banking masters seems a mystery.
  2. Narcissistic egotistic: characteristic of those having an inflated idea of their own importance.
    It makes sense that narcissists would neglect to learn this definition until it had reached an advanced stage, as it would require a sufficient degree of empathy for them to consider how other people perceive them in the first place. Of the definition, they probably thought ‘that doesn’t apply to me’, before returning to Twitter to tell their followers what they had for breakfast that morning.
  3. Lovea strong positive emotion of regard and affection; “his love for his work”; “children need a lot of love”
    Huey Lewis’ definition: “The power of love is a curious thing, it makes one man weep and another man sing”.
    We might have hoped that Love would have made it in the list; there is still some interest in this essential emotion it seems. The narrow definition thrown-up by Google seems both consice and completely inadequate. Does anyone know what this thing is? Spinoza says rather un-poeticly,  “Love is joy, accompanied by the idea of an external cause” and goes on to say that “love and desire can be excessive”. Schopenhaur gives the game away when he says: “Every kind of love, however ethereal it may seem to be, springs entirely from the instinct of sex”. Perhaps if he were alive today and working at Google, he’d put ‘Did you mean : sex‘ above the search results.
  4. Culturea particular society at a particular time and place; “early Mayan civilization”
    No, I think Google’s got the wrong idea here. People are searching for culture because they are in want of it: they’re trying to justify an existance on reality TV, auto-tuned boy/girl-bands, sports enacted by millionaires and naff video clips on-line. Perhaps they were hoping for the definition: “watching operas through Twitter”.
  5. Marketing- selling: the exchange of goods for an agreed sum of money
    I thought this was an interesting definition, because I thought marketing was something to do with questionnaires, cold-calling, advertisements and sponsorships. But as it goes, its nothing to do with that at all- its all just selling shit. Presumably our narcissist works in marketing? If so I’m sure he’d have something to say to improve that definition. Maybe: ‘the essential activity of producing jingles, brochures and slogans that enables informed buying decisions, without which the world would come to an end’.
  6. Motivationthe psychological feature that arouses an organism to action toward a desired goal; the reason for the action; that which gives purpose and direction to behavior) “we did not understand his motivation”; “he acted with the best of motives”
    Must we imagine a scene when a boss or someone’s dad says “You should change your attitude- get motivated”, and some hapless person who doesn’t really know what this means, rather than asking someone, reaches to their keyboard to ask Google what it is? Hardly self-actualisation. I suppose we must credit Google users for being bothered to find out what its definition is.
  7. Communication - the activity of communicating; the activity of conveying information; “they could not act without official communication from Moscow”
    Of all the things two human beings could communicate, this definition is illustrated by some obscure allusion to Cold war Russia. Are people searching for a definition of communication on Google, because somehow, e-mail, twitter, facebook and instant messaging don’t capture the range of human emotion in communication? Do we want to communicate more effectively? Is anyone actually listening? Do you love me baby? Leave me a comment. Don’t forget to rate!
  8. Stressthe relative prominence of a syllable or musical note (especially with regard to stress or pitch); “he put the stress on the wrong syllable”
    A corporate cover-up? Maybe Google isn’t just censoring China. Of course, people are searching for definitions to the spectrum of mental sufferings we know today as stress; or the deep contradiction we feel in ourselves that maybe we amount to more than hamsters on a wheel, struggling for bits of paper, in contrast with our natural inclination to live, thrive and survive, with possibily a bit of room for the appreciation of the sublime beauty of life. But don’t worry about stress. Take a deep breath and carry on. Of course your job is important! Without you, the entire globalised word would come crashing down.
  9. Recessionthe state of the economy declines; a widespread decline in the GDP and employment and trade lasting from six months to a year.
    Ahh yes, the recession. The definition of (1) neglected to mention that part. The good news is that Google predicts the recession is only going to last a year in the worst case.
    Who would require clarification on the definition of recession? Presuambly not wind-farm workers out of a job. Maybe MPs trying to play down the financial problems of the last year are looking for some positives in the definition, maybe a blog for ‘top ten tips for beating a recession’.
  10. Healtha healthy state of wellbeing free from disease; “physicians should be held responsible for the health of their patients”
    A weak definition when read up to the first five words in, that improves slightly by the end. A rather negative definition too; absence of disease doesn’t necessarily indicate health. According to the World Health Organisation, depression is the second-largest thief of disability-adjusted-life-years, or the sum of time lost to a disability, in the 15-44 age group, and is projected to be for all ages by 2020. What do they know that we don’t? That a futureless, indebted, cultureless, stressed, under-motivated, sex-mad, unemployed, mis-communicated, bunch of marketing narcissists can’t get it together and all end up depressed? Define gutted.

The web’s great isn’t it? We don’t need art, philosophy, community or religion to help us understand the word: just ask Google!

Twitter updates crash my blogs

August 7th, 2009

I haven’t found sufficient reason to listen to my inner sceptisism about the awful writer’s bolemia website, widely known as Twitter. I’m ridiculously proud of my forty-something followers, some of whom are not even real people (I’m referring to websites and places of work, I’m not making a jibe at my own followers- goodness gracious do you think I’m MAD?), and I like having my Twitter updates appearing on my blogs. Its very fashionable in the blogging world- a little blog inside your blog. Like Russian dolls, except if the smallest doll breaks, the bigger one is screwed too.

I’ve seen a dip in traffic today, probably because of the massive denial of service attack on Twitter today, causing the Twitter link to timeout, making my blog look like its crashing too. Admittedly, my own server would likely collapse like a tower of jamjars should any hacker target it, but I’m really starting to wonder whether its a good idea to have Twitter on my homepage. I never visit someone’s blog and read their Twitter updates, let alone follow them- that’s most likely to happen while reading Twitter itself.

Yet I find myself reluctant to change the situation. In all truth, I think Twitter is rubbish, but I’m hooked in an unpleasantly high degree.

Anyone had any good workarounds for embedding Twitter in their blogs and avoiding such problems? I’ve stuck my Twitter javascript code at the bottom of the HTML near the </body> tag; would it be better to pull-in the RSS of my tweets within my Rails view?