All posts in My Life

PHP check a website’s Twitter mentions

I started experimenting with social signals as ranking factors in Search Engines; by social signals I mean the count of mentions a website has on a social network such as Facebook, Twitter, LinkedIn, StumbleUpon, Google+ and so forth. I correlated a lot of metrics using a spreadsheet, which was time consuming so I decided to write a script to do it for me. I am 80% complete with the entire script so I’m not going to publish it all, but rather just a taste of what I’m doing.

The code below, when executed on Apache, will crawl Topsy and return the number of times a chosen website has been mentioned on Twitter. This code needs to be run in conjunction with a form that passes a text field with the domain name, so you may have to code that up quickly or later the code to bypass the domain inclusion.

Here’s the code:

<?php

$domain_name = $_POST['domain'];
$domain_name = strtolower(trim($domain_name));

echo "Results for " . $domain_name . ":<br /><br />";

// build search queries
$topsy_twitter = 'http://topsy.com/s?q='.$domain_name;

// cURL contents of queries
$topsy_twitter_contents = grab_contents($topsy_twitter);

// Find match on Topsy for Twitter
if(preg_match('/Search results <strong>1<\/strong>-<strong>10<\/strong> out of (.*?) tweets/sim', $topsy_twitter_contents, $regs)){
    $indexed_pages = substr($regs[1], 0, stripos($regs[1], " "));
    $indexed_pages = strip_tags(str_replace(",","",$indexed_pages));
    echo "Twitter Mentions: " . $indexed_pages;
}else{
    echo "Twitter Mentions: 0";
}

function grab_contents($url){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, 1);
    curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $data = curl_exec($ch);
    curl_close($ch);
    return $data;
}

?>

As I mentioned, I’ve adapted this to cover an assortment of social networks and am deciding whether I should compile it into an advanced WordPress Social Metrics Plugin.. watch this space.

My first carnivorous plant

Ok, well perhaps not my first first as I think we’ve all had a Venus Fly Trap once upon a time, but it’s my first carnivorous plant in many years and I’ve welcomed it into my sanctuary. Don’t worry, I’m still keeping my bonsai collection up to date.

Introducing the Nepenthes Hookeriana X:

The Nepenthes Hookeriana is a pitcher plant, very large intermediate to low land situated plant which is very easy to grow and becomes a monster very quickly, devouring scores of insects weekly – hopefully this will assist with all the darn flies that are around Cape Town at the moment! For those of you who are interested in far more information, you can look on WikiPedia.

If you’d like to buy one, then I suggest you look down at the bottom of my site for the link to Pan’s Carnivores – a fully fledged e-commerce website run by a gentleman in Tokai, Cape Town. He’s a really great guy too, I’ve been fortunate enough to meet him and hope to see him again soon when I buy another plant.

Shout out to Johan for introducing me!

Something New

I’ve wanted to redesign iMod for a long time now, in fact, I have a 5 page document outlining the functionality I want, but unfortunately I just don’t have the time and resources for that just yet so I decided to go for something simple instead. I purchased a framework to use and migrated everything across so that I didn’t lose any elements that exist on iMod.

So, the new theme is far cleaner, easier to navigate and basically just easier. The previous theme was rather cluttered, I didn’t respect the heatmaps I was collecting and it just turned into a mess so I’m hoping this one will suffice for the months to come until I have time and resources to roll out the big change.

Here’s to hoping that this cleaner interface will allow for easier reading and engagement.

Have a great weekend everyone!

Change before it’s too late.

A rather morbid topic lies below, but a topic that is really important to think about. I read an article entitled Top 5 Regrets of the Dying, and although I normally stay away from such topics, this one conveys a message that I’ve often thought about seriously, not specifically the death part, but more the getting older and looking back at regret as I see this as being an incredibly important thing to be aware of.

I always hear people moaning about their jobs, or wishing they could travel more, or wishing they’d told someone how they felt.. the list goes on and everyone can relate to someone else saying one of these things, but how conscious are you of what you’re saying to people. Let’s look at me for a second; I’m not afraid to admit that I work far too hard and a lot of people tell me that I do, but does that make me stop? No. I then read an article that communicates to us the top 5 regrets people have and I see number 2 on the list points to my exact situation – it’s a wake up call!

Take a read of these 5 reasons and their explanations:

1. I wish I’d had the courage to live a life true to myself, not the life others expected of me.

“This was the most common regret of all. When people realise that their life is almost over and look back clearly on it, it is easy to see how many dreams have gone unfulfilled. Most people had not honoured even a half of their dreams and had to die knowing that it was due to choices they had made, or not made. Health brings a freedom very few realise, until they no longer have it.”

2. I wish I hadn’t worked so hard.

“This came from every male patient that I nursed. They missed their children’s youth and their partner’s companionship. Women also spoke of this regret, but as most were from an older generation, many of the female patients had not been breadwinners. All of the men I nursed deeply regretted spending so much of their lives on the treadmill of a work existence.”

3. I wish I’d had the courage to express my feelings.

“Many people suppressed their feelings in order to keep peace with others. As a result, they settled for a mediocre existence and never became who they were truly capable of becoming. Many developed illnesses relating to the bitterness and resentment they carried as a result.”

4. I wish I had stayed in touch with my friends.

“Often they would not truly realise the full benefits of old friends until their dying weeks and it was not always possible to track them down. Many had become so caught up in their own lives that they had let golden friendships slip by over the years. There were many deep regrets about not giving friendships the time and effort that they deserved. Everyone misses their friends when they are dying.”

5. I wish that I had let myself be happier.

“This is a surprisingly common one. Many did not realise until the end that happiness is a choice. They had stayed stuck in old patterns and habits. The so-called ‘comfort’ of familiarity overflowed into their emotions, as well as their physical lives. Fear of change had them pretending to others, and to their selves, that they were content, when deep within, they longed to laugh properly and have silliness in their life again.”

When you turn 60 or approach the end of your life, could you see yourself saying one of the 5 things above? Seriously, remove your hands from the keyboard and think about this for a second, read each one carefully, think about your life and if you see yourself relating to one of the 5 reasons then it’s probably time to make changes in your life before it’s too late. You don’t have to the 20 years old to do this, you could be 60 already, there’s always time to change course and try something different that will assist you in approaching those latter years feeling more fulfilled as a person and not harboring a large amount of regret.

I love working, it keeps me motivated, it keeps me passionate and I guess I’m lucky for this, but I do question myself as to whether reason number 2 will hit me.

Are you conscious of the direction your life is going in?

Salsa class was fun

Last night I really wasn’t feeling motivated to be around a lot of people in a salsa class, but I managed to motivate myself to go and I’m glad I did as we did a move that I really enjoy.

It’s a cross body lead with a turn, the video below shows a similar move to what we learnt, we actually went a step further with lifting your hand over the ladies head and then completing the move, after the turn, with a final turn in dance hold. The video gives you an idea though:

Really stoked that I went :)

Braai’s and gardening

This weekend predominantly consisted of two things: Braai’s and gardening. Two things that I enjoy very much and am grateful for the weekend that I’ve just had.

Friday was a busy day at work, as the month of January comes to a close, gearing up for a productive February is incredibly important. When beer ‘o clock arrived I couldn’t believe it as it felt like it was still morning; nevertheless, a good beer ‘o clock happened and then I was off home to have a braai with some friends. Nothing better than awesome Cape Town weather and the smell of meat on the braai. Oh ya, and lots of shots of Apple Sours (I know, I know) along with some awesome Vodka I received from one of my favourite PR companies (I got the hat too). There was huge commotion outside our house in the early hours of the morning when the cops spotted a guy, get this, who was 45 minutes drive away from where he lived, driving around without a license, with someone he said he’d never met and alongside my neighbors car, which was ironically unlocked – eh? Weird.

Saturday I started gardening, there’s a huge tree outside my house and although the roots are causing structural damage, I’ve been ask by the Harfield Village Association to not remove it and so I’m honouring their request. Instead, I’m at least making the area look a great deal better as it has been looking really messy with soil, packets that people drop and so forth. I bought a ton of stones (literally) and some Asparagus Ferns, planted them wherever I could dig down deep enough without hitting impossible-to-penetrate roots. You can see my progress in the photographs – really pleased with where I’ve gotten to and will complete it next weekend. Saturday evening started off quietly, Fe had a job to take care of and I was on the couch until I decided to pay some Harfield friends a visit – Casper and Street Dancing were the movies on the list – good times! Oh yes, almost forgot, Fe and I went tile and showering shopping on Saturday, trying to decide on the right tiles, mixer, head, etc. is quite a mission!

Yesterday I spent indoors mostly, it was so incredibly hot that I couldn’t do much, but I did manage to do a little gardening, some work and have a quick braai with some friends to end things off. Talking of ending things off, the minute this post is complete, I really need to end things off with a phat sleep!

So that’s it folks, things are going well on my side despite the increased pressure I’m experiencing in certain areas of my life. But then again, what’s life without pressure? ;)

Be good to each other (cheesy sign off award please?)

I finally have a watch I love!

I started looking for a watch that I would fall in love with about 3 or so years ago and the only one I came across was a CK watch, which was well out of my price range, so instead I resorted to a Guess watch as a temporary measure. It was quite trendy and professional, but it never sat on my wrist as I would have liked it to have and after 2 years the thing finally died and it was an opportunity to find something new.

I wasn’t expecting to have to by a watch, so I opened up my budget and looked at my personal/gadget expense columns and because the columns were much lower than usual for November, December and January, I decided to spoil myself despite. I looked at my projections, decided what I was able to afford and started looking. Amazingly, I stumbled across a watch on an overseas website, one which literally fulfilled this image I’ve had in my head for all these years. The problem was now whether I’d take the chance of ordering it online and praying that it would make it to South Africa, or would I go into Hugo Boss and see if they could source it. Century City wasn’t too helpful, so I went through to the Waterfront and decided to go to the ladies store, as the women in these stores are often far less arrogant and more helpful, which was the case. The lady there explained how I could go about it, but she said I should cruise past the gents store and it was apparently quite a good one, so I did just that.

She was right. The watch that I wanted was sitting right there in the front counter, I couldn’t believe it! The sales guy, who was incredibly nice told me (after I’d purchased it) that they were very popular and that I was lucky to get one as he’d sold 3 last week alone. I was thrilled with my purchase and really think it’s going to fit into my style perfectly :)

Here’s what it looks like:

Quite a nice one hey?

A story will help you with your startup/venture

Last week I was catching up on some shows on This Week in Startups and in the one show a studio guest mentioned that having a story behind the startup is important, he didn’t elaborate much and if I recall correctly, he merely mentioned it in a sentence, but I didn’t hear only a sentence, I heard an entire discussion and was intrigued to write about what came to my mind.

So I’m no expert in the startup world and I wanted to get that out and about, but what I do do is read a lot and I love entrepreneurship, so I do feel that my opinion is built on relevant material at least.

Right, a story behind a company – I think in every entrepreneur’s life they’ll attend a conference or an industry event in which they’ll meet other people, in fact, I doubt any entrepreneur wouldn’t, it’s one of the best ways to build contacts. Whilst you’re at an event you’re more than likely going to ask someone what they do and you’ll no doubt be asked to tell them what you do. Now if someone asked me, what do you do, I would more than likely tell them that I do digital marketing and search engine optimization. Do you think they’ll remember me? Possibly, but I highly doubt that everyone will, unless I slip them a business card (which I still don’t think works too well if a person’s just meeting people, the business card goes into a wallet and dies). Imagine I was asked what I do and instead of saying digital marketing and then going onto explain what SEO is (haha, trust me, it happens over and over), I instead tell them a story, a story about myself and how I started the company, or a catchy story that explains what SEO is, something different and unique, something that might increase the chances of that person remembering you, and most importantly, the service you offer – See, you want your name to be associated with a service and remembered, that’s one of the biggest things I’ve worked on for many years when it comes to “Christopher Mills”, “iMod Blog” and “SEO” – I like to categorize it as personal branding, and to be honest, it’s changed my entire life, but that’s a story (see what I did there) for another day.

Talking about SEO and how to get people to remember it, I can tell you a little trick that I do from time to time which appears to work well; it’s by no means a wow story, but it’s a little more than just talking about search engine results pages (yawn). About a month ago I was getting my tires replaced at Tiger Wheel and Tyre, and a gentleman walked over, introduced himself and asked if the SEO on my license plate stands for Search Engine Optimization to which I confirmed his guess. He then went on to ask me what is was exactly and what I did (and asked for him to do so in one sentence). Instead of talking about myself, I asked the gentleman what he did, this moved the conversation back over to him and he told me about his business in a sentence, let’s say he said, “I am a plumber”. I then went on to say something like, “SEO is the practice of having people find your website in Google when they’re searching. Wouldn’t it be awesome if a person went to Google and searched for “Plumber Cape Town” and your website appeared right up top?” The man paused for a second and said, “That would get me a lot of leads” to which I smiled and told him that that is exactly what I do and that I was put here on earth to make other people money.. he laughed and smiled. Long story short, I received an email from him a couple days later, he’d looked for me online (remembered my name) and said that he would like to discuss SEO with me in March.

It’s not an amazing analogy or story, but the point I’m stressing is that I interacted, and I used his knowledge to point a point across that is otherwise often misunderstood. No point giving an SEO example about development software to someone who might not have a clue – but it really was the interaction that made him remember what SEO was as well as remember my name, I know because I asked him – I like to close loops :)

There are companies with really awesome stories and such, a great example was spoken about on the KISSmetrics blog, where they tell a story about a company called 52 Teas, here’s the story:

52 Teas is just another tea brewing company, until you realize that each week, they brew a completely new tea.

With teas such as the Red Hot Cinnamon Chai Tea, the Oatmeal Raisin Cookie Black Tea, and the Cranberry Black Tea, 52Teas is telling a unique story to the hard core tea connoisseur.

One of the most impressive parts about the story that 52Teas tells is that they let their customer participate. They brew new teas based on suggestions they get from Twitter and emails.

Most businesses aren’t going to be able to change their product every week to accommodate the taste of their customers. However, if an industry as old as tea brewing can have a new twist, then chances are your company can as well.

Think about that, “We make tea flavours” compared to “We make tea flavours based on what people suggest on Twitter” – one has a much higher chance of being remembered than the other, I bet you can guess which one.

So that’s what I wanted to share with you tonight, hopefully it’ll inspire you to speak differently next time you’re asked what you do and perhaps it’ll even lead you to more business and I can once again say I was sent to earth to make other people money ;)

Busy week so far!

After Sunday afternoon’s stress, Monday started on an exhausted note, but a meeting and some tight deadlines worked just as well as a few strong coffee’s, and before I knew it I was racing through the day and on my way home. Last night was busy for some reason, I arrived home and just had lists of things to get through. I was sitting outside on my Mac researching some new SEO tactics that I want to test – completely lost track of the time and it was passed 2am! Today was busy too, I’m fairly hands on with a new staff member that is going to take over quite a bit of the work I have been doing up until now so it’s important for me to put the hours in to ensure that he feels comfortable, motivated and most important, passionate.

I had another salsa class this evening, good grief it was hot, wow! We learnt a really easy move, which wasn’t the best, but it was great to be back again, moving to the salsa beats and meeting new people. If you missed it, I’ve gone back to salsa, you can read about that here.

Looks like the weather’s not really going to change much, so prepare yourself for many more hot days:

Oh, and I have to end on this, dare I say that what Matt says below is something I’ve been preaching for years and years – ranking means nothing compared to converting! Sure, ranking highly normally results in more traffic (depending on the search term’s estimate traffic of course), but there’s no point getting thousands of hits to a site if they’re not converting. Take a watch:

Nicely said Matt!

 

Awesome weekend at Zapata and Home Bar

I’ve gone on about my goals for 2012 quite a bit, I guess it’s more for me than anyone else, keep my eyes on the goals and all. One of the goals was more balance and I’m working really hard to achieve this. This weekend was a good one as I did just that.

On Friday evening a group of us went out to Home Bar in Harfield Village for dinner and drinks. It’s the first time I had the Home Burger as I usually go for the espitada or a steak, but I can confidently say that the burger was delicious and I wasn’t the only one who had it and agreed. Drinks flowed, great conversation happened and I was still home and in bed just after midnight.

Saturday evening saw us at Zapata Restaurant once again, great margherita’s as usual and even better bacon wrapped chili poppers. I gota tell you, it only takes a couple of those margherita’s to get the smile going – thank goodness we’re around the corner and can walk! This time I had the courage to get up and dance some salsa with Fe, which was a lot of fun and earned us a little round of applause ;)

Zapata Chili Poppers

All in all it was a fantastic weekend excluding the emergency ER run.

I hope you all had a good weekend too!

PS. Let’s hope the troll doesn’t pay us a visit again.