The Datafam Network

DataFam birthday tweets … and a little blog about scope creep and programming

It’s interesting how things evolve, at TC24 (it’s hard to remember which night – there’s even more conversations and meeting new people at night than occurs during the proper daylight conference hours) there was a conversation about ages and birthdays and Annabelle Rincon commented that we (the entire DataFam) should celebrate birthdays more – because it’s fun.

Vince Baumel was brought into the conversation because he used to tweet birthday wishes previously …. ??  Well, that data was lost in the mists of time but the basic idea exploded 2 ways ….

1)  Vince is gathering the birthday data here (LinkedIn link)

2) The automated tweets that are created and posted on our Twitter/X account

Don’t forget to submit YOUR birthday data and subscribe if you’re interested in knowing when other DataFam birthdays are happening so you can celebrate!

So how do the automated tweets work?

The initial design

As much as the saying goes “Excel is not a database”, maybe Google Sheets can be – well it’s enough for this small project (aka “the database”) and Google Sheets is also a really easy way of allowing multiple people to CRUD (Create, Replace, Update, Delete) the data as required.

Now we don’t really care about age, it’s the date that’s important! … but it also needs to be a proper date, so most birthdays in the database have the year set as 2024 and the proper month and day of the birthday – just like you would do right? you may not know how old people are, and that doesn’t really matter – it’s celebrating the birthday that’s the important part.

So there’s a list of names, twitter handles and “birthdays”….

Using my current favourite programming language – Python – it doesn’t take too long to figure out how to connect to Google Sheets and figure out who is having a birthday today.  It did take a bit longer to figure out how to use the Twitter API in order to automatically tweet the result though!

Scope creep starts …

But a tweet that just says “Happy birthday <user> <twitter_handle> from the entire DataFam.” feels a bit too bland.  So let’s add image as well … animated GIFS like …

 

But this causes it’s own problems – assigning an image to each birthday, so there’s 2 options here …

1) the ability to assign an image to a certain person, or ..

2) if no image is assigned, randomly pull from the pool (or pre-approved images obviously!) … and if you have a good animated GIF or other image that you think should be included, please pass it along 🙂

But it’s still a short tweet

So a third sheet (first was birthdays, second was the list of images if we need a random selection) was added for “On this day”.  This sheet is used to add some more excitement/interest in the day.  Again, if there’s anything interesting you want added please pass it along, remember the DataFam is international and we’ve already added “country specific” comments for certain birthdays.

OK, so the automation challenge

Oops!! … hang on … the DataFam is international, so any given date is not the same date in other parts of the world.  If the automated tweet is sent in a USA west coast timezone, then it’s already the next day in Australia (so that birthday is already over), but tweeting in an Australian timezone means that the birthday hasn’t started yet (in the USA).  The solution is to assign a timezone to each person … and it doesn’t have to be deadly accurate …

map of the world showing timezones

So “not deadly accurate” means (as you can see) most of continental Europe and a big piece of Africa are the same timezone.  The eastern part of Australia and Japan are only 1hr difference.  The world is (roughly) 24 vertical slices of timezones …. and now we can (hopefully) tweet on the right day.

Full automation

Currently, the code runs every hour and checks “who is having a birthday today” along with “is it 6am in their timezone’ – if yes, then do they have an image (if not, randomly choose one from our pool), and then add an “on this day” text and the tweet is sent – HAPPY BIRTHDAY!

DataFam help

So how can you help?

1) encourage people to add their birthdays to the list

2) send images that you want added to the random pool, or images for a specific person (that’s always a nice surprise)

3) send “on this day” information for any day of the year.

All this can be sent via the Twitter account

and final thank you …

To Annabelle for the original idea, I think it’s taken off a lot more than she expected but it was an awesome inspiration!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.